htmltojsx

This commit is contained in:
Basarat Syed
2015-07-03 13:06:43 +10:00
parent d73cbcb405
commit 304aa490ec
2 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
/// <reference path="htmltojsx.d.ts"/>
import HTMLtoJSX = require("htmltojsx");
var converter = new HTMLtoJSX({
createClass: true,
outputClassName: 'AwesomeComponent'
});
var output = converter.convert('<div>Hello world!</div>');

15
htmltojsx/htmltojsx.d.ts vendored Normal file
View File

@@ -0,0 +1,15 @@
// Type definitions for htmltojsx
// Project: https://www.npmjs.com/package/htmltojsx
// Definitions by: Basarat Ali Syed <https://github.com/basarat>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'htmltojsx' {
class HTMLtoJSX {
constructor(options?: {
createClass?: boolean;
outputClassName?: string;
});
convert(html: string): string;
}
export = HTMLtoJSX;
}