@turbodocx/html-to-docx 1.15.2 → 1.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/html-to-docx.esm.js +2 -2
- package/dist/html-to-docx.umd.js +2 -2
- package/index.d.ts +25 -0
- package/package.json +17 -4
package/index.d.ts
CHANGED
|
@@ -36,6 +36,30 @@ declare namespace HTMLtoDOCX {
|
|
|
36
36
|
restart: "continuous" | "newPage" | "newSection";
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
interface HeadingSpacing {
|
|
40
|
+
before?: number;
|
|
41
|
+
after?: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface HeadingStyle {
|
|
45
|
+
font?: string;
|
|
46
|
+
fontSize?: number;
|
|
47
|
+
bold?: boolean;
|
|
48
|
+
spacing?: HeadingSpacing;
|
|
49
|
+
keepLines?: boolean;
|
|
50
|
+
keepNext?: boolean;
|
|
51
|
+
outlineLevel?: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
interface HeadingConfig {
|
|
55
|
+
heading1?: HeadingStyle;
|
|
56
|
+
heading2?: HeadingStyle;
|
|
57
|
+
heading3?: HeadingStyle;
|
|
58
|
+
heading4?: HeadingStyle;
|
|
59
|
+
heading5?: HeadingStyle;
|
|
60
|
+
heading6?: HeadingStyle;
|
|
61
|
+
}
|
|
62
|
+
|
|
39
63
|
interface DocumentOptions {
|
|
40
64
|
orientation?: "portrait" | "landscape";
|
|
41
65
|
pageSize?: PageSize;
|
|
@@ -64,6 +88,7 @@ declare namespace HTMLtoDOCX {
|
|
|
64
88
|
numbering?: {
|
|
65
89
|
defaultOrderedListStyleType?: string;
|
|
66
90
|
};
|
|
91
|
+
heading?: HeadingConfig;
|
|
67
92
|
decodeUnicode?: boolean;
|
|
68
93
|
lang?: string;
|
|
69
94
|
direction?: "ltr" | "rtl";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turbodocx/html-to-docx",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "HTML to DOCX converter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"html-to-docx",
|
|
@@ -47,7 +47,8 @@
|
|
|
47
47
|
"types": "index.d.ts",
|
|
48
48
|
"files": [
|
|
49
49
|
"dist",
|
|
50
|
-
"scripts",
|
|
50
|
+
"scripts/postinstall.js",
|
|
51
|
+
"scripts/messages.json",
|
|
51
52
|
"index.d.ts",
|
|
52
53
|
"README.md",
|
|
53
54
|
"LICENSE"
|
|
@@ -55,9 +56,13 @@
|
|
|
55
56
|
"scripts": {
|
|
56
57
|
"test": "npm run build && node example/example-node.js",
|
|
57
58
|
"test:rtl": "npm run build && node example/example-rtl.js",
|
|
59
|
+
"test:headings": "npm run build && node example/example-heading-styles.js",
|
|
58
60
|
"test:ts": "npm run build && cross-env TS_NODE_PROJECT=example/typescript/tsconfig.json ts-node -r tsconfig-paths/register example/typescript/typescript-example.ts",
|
|
59
61
|
"test:ts-rtl": "npm run build && cross-env TS_NODE_PROJECT=example/typescript/tsconfig.json ts-node -r tsconfig-paths/register example/typescript/rtl-example.ts",
|
|
60
|
-
"test:all": "npm run test && npm run test:ts && npm run test:ts-rtl",
|
|
62
|
+
"test:all": "npm run test:unit && npm run test && npm run test:headings && npm run test:ts && npm run test:ts-rtl",
|
|
63
|
+
"test:unit": "jest",
|
|
64
|
+
"test:unit:watch": "jest --watch",
|
|
65
|
+
"test:unit:coverage": "jest --coverage",
|
|
61
66
|
"prerelease": "npm run build:prod",
|
|
62
67
|
"release": "standard-version",
|
|
63
68
|
"lint": "eslint --fix .",
|
|
@@ -66,6 +71,7 @@
|
|
|
66
71
|
"build": "rollup -c",
|
|
67
72
|
"build:dev": "NODE_ENV=development rollup -c",
|
|
68
73
|
"build:prod": "NODE_ENV=production rollup -c",
|
|
74
|
+
"diff:docx": "node scripts/diff-docx.js",
|
|
69
75
|
"prepare": "husky install",
|
|
70
76
|
"postinstall": "node scripts/postinstall.js",
|
|
71
77
|
"test:ts-example": "npm run build && cross-env TS_NODE_PROJECT=example/typescript/tsconfig.json ts-node -r tsconfig-paths/register example/typescript/typescript-example.ts"
|
|
@@ -100,7 +106,8 @@
|
|
|
100
106
|
"shareefalis",
|
|
101
107
|
"adymo",
|
|
102
108
|
"Srajan-Sanjay-Saxena",
|
|
103
|
-
"jcasner"
|
|
109
|
+
"jcasner",
|
|
110
|
+
"demomacro"
|
|
104
111
|
],
|
|
105
112
|
"license": "MIT",
|
|
106
113
|
"bugs": {
|
|
@@ -108,19 +115,25 @@
|
|
|
108
115
|
},
|
|
109
116
|
"homepage": "https://github.com/TurboDocx/html-to-docx#readme",
|
|
110
117
|
"devDependencies": {
|
|
118
|
+
"@babel/core": "^7.28.4",
|
|
119
|
+
"@babel/preset-env": "^7.28.3",
|
|
111
120
|
"@commitlint/cli": "^19.8.1",
|
|
112
121
|
"@commitlint/config-conventional": "^13.1.0",
|
|
113
122
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
114
123
|
"@rollup/plugin-json": "^4.1.0",
|
|
115
124
|
"@rollup/plugin-node-resolve": "^13.1.1",
|
|
125
|
+
"babel-jest": "^30.2.0",
|
|
116
126
|
"cross-env": "^7.0.3",
|
|
127
|
+
"diff": "^5.2.0",
|
|
117
128
|
"eslint": "^7.32.0",
|
|
118
129
|
"eslint-config-airbnb-base": "^14.2.1",
|
|
119
130
|
"eslint-config-prettier": "^8.3.0",
|
|
120
131
|
"eslint-plugin-import": "^2.24.2",
|
|
121
132
|
"eslint-plugin-prettier": "^4.0.0",
|
|
122
133
|
"husky": "^7.0.0",
|
|
134
|
+
"jest": "^29.7.0",
|
|
123
135
|
"lint-staged": "^11.1.2",
|
|
136
|
+
"lodash-es": "^4.17.21",
|
|
124
137
|
"prettier": "^2.4.1",
|
|
125
138
|
"rollup": "^2.62.0",
|
|
126
139
|
"rollup-plugin-cleaner": "^1.0.0",
|