Merge pull request #29177 from taoqf/master

Add declarations for `jsreport-html-embedded-in-docx`
This commit is contained in:
Andrew Casey
2018-09-26 10:25:30 -07:00
committed by GitHub
4 changed files with 58 additions and 0 deletions
+17
View File
@@ -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 <https://github.com/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;
@@ -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 = `<h1>Hello</h1>`;
await jsreport.init();
await jsreport.render({
template: {
content,
engine: 'none',
recipe: 'html-embedded-in-docx'
}
});
})();
@@ -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"
]
}
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }