diff --git a/types/jsreport-html-embedded-in-docx/index.d.ts b/types/jsreport-html-embedded-in-docx/index.d.ts new file mode 100644 index 0000000000..6570649fb4 --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/index.d.ts @@ -0,0 +1,17 @@ +// Type definitions for jsreport-html-embedded-in-docx 1.0 +// Project: https://github.com/jsreport/jsreport-html-embedded-in-docx +// Definitions by: taoqf +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +import { ExtensionDefinition } from 'jsreport-core'; + +declare module 'jsreport-core' { + interface Template { + recipe: 'html-embedded-in-docx' | string; + } +} + +declare function JsReportHtmlEmbeddedInDocx(): ExtensionDefinition; + +export = JsReportHtmlEmbeddedInDocx; diff --git a/types/jsreport-html-embedded-in-docx/jsreport-html-embedded-in-docx-tests.ts b/types/jsreport-html-embedded-in-docx/jsreport-html-embedded-in-docx-tests.ts new file mode 100644 index 0000000000..296553bdf7 --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/jsreport-html-embedded-in-docx-tests.ts @@ -0,0 +1,17 @@ +import JsReport = require('jsreport-core'); +import JsreportHtml2docx = require('jsreport-html-embedded-in-docx'); + +const jsreport = JsReport(); +jsreport.use(JsreportHtml2docx()); + +(async () => { + const content = `

Hello

`; + await jsreport.init(); + await jsreport.render({ + template: { + content, + engine: 'none', + recipe: 'html-embedded-in-docx' + } + }); +})(); diff --git a/types/jsreport-html-embedded-in-docx/tsconfig.json b/types/jsreport-html-embedded-in-docx/tsconfig.json new file mode 100644 index 0000000000..812be786ee --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/tsconfig.json @@ -0,0 +1,23 @@ +{ + "compilerOptions": { + "strictFunctionTypes": true, + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsreport-html-embedded-in-docx-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jsreport-html-embedded-in-docx/tslint.json b/types/jsreport-html-embedded-in-docx/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/jsreport-html-embedded-in-docx/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }