From ff156de57b1cdc96da961c4efde48e1f7ae47416 Mon Sep 17 00:00:00 2001 From: taoqf Date: Tue, 25 Sep 2018 17:35:56 +0800 Subject: [PATCH 1/3] add definition jsreport-html-embedded-in-docx --- .../jsreport-html-embedded-in-docx/index.d.ts | 17 ++++++++++++++ .../jsreport-html-embedded-in-docx-tests.ts | 17 ++++++++++++++ .../tsconfig.json | 23 +++++++++++++++++++ .../tslint.json | 1 + 4 files changed, 58 insertions(+) create mode 100644 types/jsreport-html-embedded-in-docx/index.d.ts create mode 100644 types/jsreport-html-embedded-in-docx/jsreport-html-embedded-in-docx-tests.ts create mode 100644 types/jsreport-html-embedded-in-docx/tsconfig.json create mode 100644 types/jsreport-html-embedded-in-docx/tslint.json 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..2262377605 --- /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: My Self +// 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; 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" } From 3133990958283b549fbb5b71b0fc0d9f06f24f26 Mon Sep 17 00:00:00 2001 From: taoqf Date: Tue, 25 Sep 2018 17:45:05 +0800 Subject: [PATCH 2/3] upgrade ts version to 2.3 --- types/jsreport-html-embedded-in-docx/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jsreport-html-embedded-in-docx/index.d.ts b/types/jsreport-html-embedded-in-docx/index.d.ts index 2262377605..6758c803b0 100644 --- a/types/jsreport-html-embedded-in-docx/index.d.ts +++ b/types/jsreport-html-embedded-in-docx/index.d.ts @@ -2,7 +2,7 @@ // Project: https://github.com/jsreport/jsreport-html-embedded-in-docx // Definitions by: My Self // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 +// TypeScript Version: 2.3 import { ExtensionDefinition } from 'jsreport-core'; From fd4267dea3d0053a6e54ca5b38b53a7ec7685ed1 Mon Sep 17 00:00:00 2001 From: taoqf Date: Wed, 26 Sep 2018 15:47:07 +0800 Subject: [PATCH 3/3] update authorlist --- types/jsreport-html-embedded-in-docx/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/jsreport-html-embedded-in-docx/index.d.ts b/types/jsreport-html-embedded-in-docx/index.d.ts index 6758c803b0..6570649fb4 100644 --- a/types/jsreport-html-embedded-in-docx/index.d.ts +++ b/types/jsreport-html-embedded-in-docx/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for jsreport-html-embedded-in-docx 1.0 // Project: https://github.com/jsreport/jsreport-html-embedded-in-docx -// Definitions by: My Self +// Definitions by: taoqf // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3