diff --git a/types/jsreport-html-to-xlsx/index.d.ts b/types/jsreport-html-to-xlsx/index.d.ts
index 84b37480aa..83ac765c1f 100644
--- a/types/jsreport-html-to-xlsx/index.d.ts
+++ b/types/jsreport-html-to-xlsx/index.d.ts
@@ -1,4 +1,4 @@
-// Type definitions for jsreport-html-to-xlsx 1.4
+// Type definitions for jsreport-html-to-xlsx 2.0
// Project: https://github.com/jsreport/jsreport-html-to-xlsx
// Definitions by: My Self
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -8,7 +8,9 @@ import { ExtensionDefinition } from 'jsreport-core';
import { Options as BaseOptions } from 'jsreport-xlsx';
declare module 'jsreport-core' {
+ type htmlEngine = 'phantom' | 'chrome';
interface Template {
+ htmlToXlsx: { htmlEngine: htmlEngine; };
recipe: 'html-to-xlsx' | string;
}
}
diff --git a/types/jsreport-html-to-xlsx/v1/index.d.ts b/types/jsreport-html-to-xlsx/v1/index.d.ts
new file mode 100644
index 0000000000..84b37480aa
--- /dev/null
+++ b/types/jsreport-html-to-xlsx/v1/index.d.ts
@@ -0,0 +1,24 @@
+// Type definitions for jsreport-html-to-xlsx 1.4
+// Project: https://github.com/jsreport/jsreport-html-to-xlsx
+// Definitions by: My Self
+// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
+// TypeScript Version: 2.3
+
+import { ExtensionDefinition } from 'jsreport-core';
+import { Options as BaseOptions } from 'jsreport-xlsx';
+
+declare module 'jsreport-core' {
+ interface Template {
+ recipe: 'html-to-xlsx' | string;
+ }
+}
+
+declare namespace JsReportHtml2Xlsx {
+ interface Options extends BaseOptions {
+ strategy: string;
+ }
+}
+
+declare function JsReportHtml2Xlsx(options?: Partial): ExtensionDefinition;
+
+export = JsReportHtml2Xlsx;
diff --git a/types/jsreport-html-to-xlsx/v1/jsreport-html-to-xlsx-tests.ts b/types/jsreport-html-to-xlsx/v1/jsreport-html-to-xlsx-tests.ts
new file mode 100644
index 0000000000..9540cf7929
--- /dev/null
+++ b/types/jsreport-html-to-xlsx/v1/jsreport-html-to-xlsx-tests.ts
@@ -0,0 +1,19 @@
+import JsReport = require('jsreport-core');
+import JsreportHtml2Xlsx = require('jsreport-html-to-xlsx');
+import JsreportXlsx = require('jsreport-xlsx');
+
+const jsreport = JsReport();
+jsreport.use(JsreportXlsx());
+jsreport.use(JsreportHtml2Xlsx());
+
+(async () => {
+ const content = ``;
+ await jsreport.init();
+ const resp = await jsreport.render({
+ template: {
+ content,
+ engine: 'none',
+ recipe: 'xlsx'
+ }
+ });
+})();
diff --git a/types/jsreport-html-to-xlsx/v1/tsconfig.json b/types/jsreport-html-to-xlsx/v1/tsconfig.json
new file mode 100644
index 0000000000..6b073aa725
--- /dev/null
+++ b/types/jsreport-html-to-xlsx/v1/tsconfig.json
@@ -0,0 +1,26 @@
+{
+ "compilerOptions": {
+ "module": "commonjs",
+ "lib": [
+ "esnext"
+ ],
+ "strictFunctionTypes": true,
+ "noImplicitAny": true,
+ "noImplicitThis": true,
+ "strictNullChecks": true,
+ "baseUrl": "../../",
+ "typeRoots": [
+ "../../"
+ ],
+ "paths": {
+ "jsreport-html-to-xlsx": [ "jsreport-html-to-xlsx/v1" ]
+ },
+ "types": [],
+ "noEmit": true,
+ "forceConsistentCasingInFileNames": true
+ },
+ "files": [
+ "index.d.ts",
+ "jsreport-html-to-xlsx-tests.ts"
+ ]
+}
diff --git a/types/jsreport-html-to-xlsx/v1/tslint.json b/types/jsreport-html-to-xlsx/v1/tslint.json
new file mode 100644
index 0000000000..3db14f85ea
--- /dev/null
+++ b/types/jsreport-html-to-xlsx/v1/tslint.json
@@ -0,0 +1 @@
+{ "extends": "dtslint/dt.json" }