add definition jsreport-html-embedded-in-docx

This commit is contained in:
taoqf
2018-09-25 17:35:56 +08:00
parent ba38e1bc8b
commit ff156de57b
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: My Self <https://github.com/me>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
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" }