From 304aa490ecbd9d4ea64ea11b27e572422495a374 Mon Sep 17 00:00:00 2001 From: Basarat Syed Date: Fri, 3 Jul 2015 13:06:43 +1000 Subject: [PATCH] htmltojsx --- htmltojsx/htmltojsx-tests.ts | 7 +++++++ htmltojsx/htmltojsx.d.ts | 15 +++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 htmltojsx/htmltojsx-tests.ts create mode 100644 htmltojsx/htmltojsx.d.ts diff --git a/htmltojsx/htmltojsx-tests.ts b/htmltojsx/htmltojsx-tests.ts new file mode 100644 index 0000000000..052ae8baa4 --- /dev/null +++ b/htmltojsx/htmltojsx-tests.ts @@ -0,0 +1,7 @@ +/// +import HTMLtoJSX = require("htmltojsx"); +var converter = new HTMLtoJSX({ + createClass: true, + outputClassName: 'AwesomeComponent' +}); +var output = converter.convert('
Hello world!
'); diff --git a/htmltojsx/htmltojsx.d.ts b/htmltojsx/htmltojsx.d.ts new file mode 100644 index 0000000000..06040a67c2 --- /dev/null +++ b/htmltojsx/htmltojsx.d.ts @@ -0,0 +1,15 @@ +// Type definitions for htmltojsx +// Project: https://www.npmjs.com/package/htmltojsx +// Definitions by: Basarat Ali Syed +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'htmltojsx' { + class HTMLtoJSX { + constructor(options?: { + createClass?: boolean; + outputClassName?: string; + }); + convert(html: string): string; + } + export = HTMLtoJSX; +}