docx 9.7.1 → 9.8.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 +27 -0
- package/dist/charts.cjs +4802 -0
- package/dist/charts.d.cts +1235 -0
- package/dist/charts.d.ts +1235 -0
- package/dist/charts.iife.js +4804 -0
- package/dist/charts.mjs +4800 -0
- package/dist/charts.umd.cjs +4805 -0
- package/dist/index.cjs +6367 -3360
- package/dist/index.d.cts +10160 -52
- package/dist/index.d.ts +10160 -52
- package/dist/index.iife.js +6367 -3360
- package/dist/index.mjs +6357 -3361
- package/dist/index.umd.cjs +6367 -3360
- package/dist/math.cjs +522 -0
- package/dist/math.d.cts +360 -0
- package/dist/math.d.ts +360 -0
- package/dist/math.iife.js +524 -0
- package/dist/math.mjs +314 -0
- package/dist/math.umd.cjs +525 -0
- package/dist/shapes.cjs +10854 -0
- package/dist/shapes.d.cts +2276 -0
- package/dist/shapes.d.ts +2276 -0
- package/dist/shapes.iife.js +10856 -0
- package/dist/shapes.mjs +10851 -0
- package/dist/shapes.umd.cjs +10857 -0
- package/dist/watermarks.cjs +1268 -0
- package/dist/watermarks.d.cts +173 -0
- package/dist/watermarks.d.ts +173 -0
- package/dist/watermarks.iife.js +1270 -0
- package/dist/watermarks.mjs +1266 -0
- package/dist/watermarks.umd.cjs +1271 -0
- package/package.json +77 -15
package/dist/math.d.cts
ADDED
|
@@ -0,0 +1,360 @@
|
|
|
1
|
+
import { BuilderElement } from 'docx';
|
|
2
|
+
import { createMathAccentCharacter } from 'docx';
|
|
3
|
+
import { createMathBase } from 'docx';
|
|
4
|
+
import { createMathLimitLocation } from 'docx';
|
|
5
|
+
import { createMathNAryProperties } from 'docx';
|
|
6
|
+
import { createMathPreSubSuperScriptProperties } from 'docx';
|
|
7
|
+
import { createMathSubScriptElement } from 'docx';
|
|
8
|
+
import { createMathSubScriptProperties } from 'docx';
|
|
9
|
+
import { createMathSubSuperScriptProperties } from 'docx';
|
|
10
|
+
import { createMathSuperScriptElement } from 'docx';
|
|
11
|
+
import { createMathSuperScriptProperties } from 'docx';
|
|
12
|
+
import { IMathFractionOptions } from 'docx';
|
|
13
|
+
import { IMathFunctionOptions } from 'docx';
|
|
14
|
+
import { IMathIntegralOptions } from 'docx';
|
|
15
|
+
import { IMathLimitLowerOptions } from 'docx';
|
|
16
|
+
import { IMathLimitUpperOptions } from 'docx';
|
|
17
|
+
import { IMathOptions } from 'docx';
|
|
18
|
+
import { IMathPreSubSuperScriptOptions } from 'docx';
|
|
19
|
+
import { IMathRadicalOptions } from 'docx';
|
|
20
|
+
import { IMathSubScriptOptions } from 'docx';
|
|
21
|
+
import { IMathSubSuperScriptOptions } from 'docx';
|
|
22
|
+
import { IMathSumOptions } from 'docx';
|
|
23
|
+
import { IMathSuperScriptOptions } from 'docx';
|
|
24
|
+
import { Math as Math_2 } from 'docx';
|
|
25
|
+
import { MathAngledBrackets } from 'docx';
|
|
26
|
+
import { MathComponent } from 'docx';
|
|
27
|
+
import { MathCurlyBrackets } from 'docx';
|
|
28
|
+
import { MathDegree } from 'docx';
|
|
29
|
+
import { MathDenominator } from 'docx';
|
|
30
|
+
import { MathFraction } from 'docx';
|
|
31
|
+
import { MathFunction } from 'docx';
|
|
32
|
+
import { MathFunctionName } from 'docx';
|
|
33
|
+
import { MathFunctionProperties } from 'docx';
|
|
34
|
+
import { MathIntegral } from 'docx';
|
|
35
|
+
import { MathLimit } from 'docx';
|
|
36
|
+
import { MathLimitLower } from 'docx';
|
|
37
|
+
import { MathLimitUpper } from 'docx';
|
|
38
|
+
import { MathNumerator } from 'docx';
|
|
39
|
+
import { MathPreSubSuperScript } from 'docx';
|
|
40
|
+
import { MathRadical } from 'docx';
|
|
41
|
+
import { MathRadicalProperties } from 'docx';
|
|
42
|
+
import { MathRoundBrackets } from 'docx';
|
|
43
|
+
import { MathRun } from 'docx';
|
|
44
|
+
import { MathRunOptions } from 'docx';
|
|
45
|
+
import { MathSquareBrackets } from 'docx';
|
|
46
|
+
import { MathSubScript } from 'docx';
|
|
47
|
+
import { MathSubSuperScript } from 'docx';
|
|
48
|
+
import { MathSum } from 'docx';
|
|
49
|
+
import { MathSuperScript } from 'docx';
|
|
50
|
+
|
|
51
|
+
export { createMathAccentCharacter }
|
|
52
|
+
|
|
53
|
+
export { createMathBase }
|
|
54
|
+
|
|
55
|
+
export { createMathLimitLocation }
|
|
56
|
+
|
|
57
|
+
export { createMathNAryProperties }
|
|
58
|
+
|
|
59
|
+
export { createMathPreSubSuperScriptProperties }
|
|
60
|
+
|
|
61
|
+
export { createMathSubScriptElement }
|
|
62
|
+
|
|
63
|
+
export { createMathSubScriptProperties }
|
|
64
|
+
|
|
65
|
+
export { createMathSubSuperScriptProperties }
|
|
66
|
+
|
|
67
|
+
export { createMathSuperScriptElement }
|
|
68
|
+
|
|
69
|
+
export { createMathSuperScriptProperties }
|
|
70
|
+
|
|
71
|
+
export { IMathFractionOptions }
|
|
72
|
+
|
|
73
|
+
export { IMathFunctionOptions }
|
|
74
|
+
|
|
75
|
+
export { IMathIntegralOptions }
|
|
76
|
+
|
|
77
|
+
export { IMathLimitLowerOptions }
|
|
78
|
+
|
|
79
|
+
export { IMathLimitUpperOptions }
|
|
80
|
+
|
|
81
|
+
export { IMathOptions }
|
|
82
|
+
|
|
83
|
+
export { IMathPreSubSuperScriptOptions }
|
|
84
|
+
|
|
85
|
+
export { IMathRadicalOptions }
|
|
86
|
+
|
|
87
|
+
export { IMathSubScriptOptions }
|
|
88
|
+
|
|
89
|
+
export { IMathSubSuperScriptOptions }
|
|
90
|
+
|
|
91
|
+
export { IMathSumOptions }
|
|
92
|
+
|
|
93
|
+
export { IMathSuperScriptOptions }
|
|
94
|
+
|
|
95
|
+
export { Math_2 as Math }
|
|
96
|
+
|
|
97
|
+
export { MathAngledBrackets }
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Brackets of any characters around math (`m:d`), such as |x|, ‖v‖, ⟨a|b⟩ or a brace on one side only. They grow
|
|
101
|
+
* with what they hold.
|
|
102
|
+
*
|
|
103
|
+
* `MathRoundBrackets`, `MathSquareBrackets`, `MathCurlyBrackets` and `MathAngledBrackets` are fixed pairs of these.
|
|
104
|
+
*
|
|
105
|
+
* @example
|
|
106
|
+
* ```typescript
|
|
107
|
+
* new MathBrackets({ open: "|", close: "|", children: [new MathRun("x")] });
|
|
108
|
+
* new MathBrackets({ open: "⟨", close: "⟩", items: [[new MathRun("a")], [new MathRun("b")]] });
|
|
109
|
+
* new MathBrackets({ open: "{", close: "", children: [new MathRun("x")] });
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
export declare class MathBrackets extends BuilderElement {
|
|
113
|
+
constructor(options: MathBracketsOptions);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Options for {@link MathBrackets}: the brackets, and what goes between them.
|
|
118
|
+
*/
|
|
119
|
+
export declare type MathBracketsOptions = {
|
|
120
|
+
/**
|
|
121
|
+
* The opening bracket: one character, such as `"|"` or `"⟨"`, or `""` for none (`m:begChr`).
|
|
122
|
+
* @default "("
|
|
123
|
+
*/
|
|
124
|
+
readonly open?: string;
|
|
125
|
+
/**
|
|
126
|
+
* The closing bracket: one character, or `""` for none (`m:endChr`).
|
|
127
|
+
* @default ")"
|
|
128
|
+
*/
|
|
129
|
+
readonly close?: string;
|
|
130
|
+
/**
|
|
131
|
+
* The character between `items`, such as `","` (`m:sepChr`).
|
|
132
|
+
* @default "|"
|
|
133
|
+
*/
|
|
134
|
+
readonly separator?: string;
|
|
135
|
+
/**
|
|
136
|
+
* Whether the brackets grow to the height of what they hold (`m:grow`). LibreOffice and Pages always grow them.
|
|
137
|
+
* @default true
|
|
138
|
+
*/
|
|
139
|
+
readonly grow?: boolean;
|
|
140
|
+
} & ({
|
|
141
|
+
/** What goes between the brackets */
|
|
142
|
+
readonly children: readonly MathComponent[];
|
|
143
|
+
readonly items?: never;
|
|
144
|
+
} | {
|
|
145
|
+
/** Several things between the brackets, with `separator` between them, such as ⟨a|b⟩ */
|
|
146
|
+
readonly items: readonly (readonly MathComponent[])[];
|
|
147
|
+
readonly children?: never;
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* One case: a value, and the condition it holds under.
|
|
152
|
+
*/
|
|
153
|
+
export declare type MathCase = {
|
|
154
|
+
/** The value, such as `−x,` */
|
|
155
|
+
readonly value: readonly MathComponent[];
|
|
156
|
+
/**
|
|
157
|
+
* The condition, such as `if x < 0`. Words such as "if" and "otherwise" read best as normal text:
|
|
158
|
+
* `new MathRun({ text: "if ", normalText: true })`.
|
|
159
|
+
*/
|
|
160
|
+
readonly condition?: readonly MathComponent[];
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Cases, as LaTeX's `cases`: values, each with its condition, one to a line, in a brace on the left. The values and
|
|
165
|
+
* the conditions each line up on the left.
|
|
166
|
+
*
|
|
167
|
+
* They are written as pandoc writes them: a matrix of two columns in a brace with no closing bracket. Word's own
|
|
168
|
+
* equation editor lines the conditions up with an `&` instead, which LibreOffice draws.
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```typescript
|
|
172
|
+
* new MathCases({
|
|
173
|
+
* cases: [
|
|
174
|
+
* { value: [new MathRun("x,")], condition: [new MathRun({ text: "if ", normalText: true }), new MathRun("x≥0")] },
|
|
175
|
+
* { value: [new MathRun("−x,")], condition: [new MathRun({ text: "otherwise", normalText: true })] },
|
|
176
|
+
* ],
|
|
177
|
+
* });
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
export declare class MathCases extends BuilderElement {
|
|
181
|
+
constructor({ cases }: MathCasesOptions);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Options for {@link MathCases}.
|
|
186
|
+
*/
|
|
187
|
+
export declare type MathCasesOptions = {
|
|
188
|
+
/** The cases, one to a line. Word allows at most 256 */
|
|
189
|
+
readonly cases: readonly MathCase[];
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
/** Where the cells of a column go across it (`m:mcJc`). LibreOffice and Pages centre them all */
|
|
193
|
+
export declare type MathColumnAlignment = "left" | "center" | "right";
|
|
194
|
+
|
|
195
|
+
export { MathComponent }
|
|
196
|
+
|
|
197
|
+
export { MathCurlyBrackets }
|
|
198
|
+
|
|
199
|
+
export { MathDegree }
|
|
200
|
+
|
|
201
|
+
export { MathDenominator }
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* An equation array (`m:eqArr`): rows of math, one to a line, lined up at the points between their parts, as LaTeX's
|
|
205
|
+
* `align` and `aligned`, with an equation number at the end of any row.
|
|
206
|
+
*
|
|
207
|
+
* Word marks the points with an `&`, and the number with a `#`, in the text. So an `&` or a `#` in a `MathRun` in the
|
|
208
|
+
* array is taken as one too. LibreOffice shows the `&` and `#`, and centres the rows; Pages lines them up, but shows
|
|
209
|
+
* the `#`.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* ```typescript
|
|
213
|
+
* new MathEquationArray({
|
|
214
|
+
* rows: [
|
|
215
|
+
* { parts: [[new MathRun("y")], [new MathRun("=mx+b")]], equationNumber: "(1)" },
|
|
216
|
+
* { parts: [[new MathRun("y′")], [new MathRun("=m")]], equationNumber: "(2)" },
|
|
217
|
+
* ],
|
|
218
|
+
* });
|
|
219
|
+
* ```
|
|
220
|
+
*/
|
|
221
|
+
export declare class MathEquationArray extends BuilderElement {
|
|
222
|
+
constructor({ rows, verticalAlignment }: MathEquationArrayOptions);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Options for {@link MathEquationArray}.
|
|
227
|
+
*/
|
|
228
|
+
export declare type MathEquationArrayOptions = {
|
|
229
|
+
/** The rows, one to a line. Word allows at most 64 */
|
|
230
|
+
readonly rows: readonly MathEquationArrayRow[];
|
|
231
|
+
/**
|
|
232
|
+
* Where the array sits on its line.
|
|
233
|
+
* @default "center"
|
|
234
|
+
*/
|
|
235
|
+
readonly verticalAlignment?: MathVerticalAlignment;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* One row of an equation array.
|
|
240
|
+
*/
|
|
241
|
+
export declare type MathEquationArrayRow = {
|
|
242
|
+
/**
|
|
243
|
+
* The row's parts. Word lines up the points between them with the same points in the other rows, as LaTeX's `&`
|
|
244
|
+
* does: the first, third and every other point line up (such as at an `=`), and the space goes at the others, as
|
|
245
|
+
* between the columns of `align`. A part can be empty, such as the first part of a row that goes on from the row
|
|
246
|
+
* before.
|
|
247
|
+
*/
|
|
248
|
+
readonly parts: readonly (readonly MathComponent[])[];
|
|
249
|
+
/**
|
|
250
|
+
* The row's equation number, such as `"(1)"`, which Word 2016 and later put at the right margin. Word 2013 and
|
|
251
|
+
* older, LibreOffice and Pages show it after a `#`.
|
|
252
|
+
*/
|
|
253
|
+
readonly equationNumber?: string;
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
export { MathFraction }
|
|
257
|
+
|
|
258
|
+
export { MathFunction }
|
|
259
|
+
|
|
260
|
+
export { MathFunctionName }
|
|
261
|
+
|
|
262
|
+
export { MathFunctionProperties }
|
|
263
|
+
|
|
264
|
+
export { MathIntegral }
|
|
265
|
+
|
|
266
|
+
export { MathLimit }
|
|
267
|
+
|
|
268
|
+
export { MathLimitLower }
|
|
269
|
+
|
|
270
|
+
export { MathLimitUpper }
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* A matrix (`m:m`), in brackets or none (`m:d`): LaTeX's `matrix`, `pmatrix`, `bmatrix`, `Bmatrix`, `vmatrix` and
|
|
274
|
+
* `Vmatrix`.
|
|
275
|
+
*
|
|
276
|
+
* Word lines up each column's cells as `columnAlignment` says, and hides the placeholders of empty cells. LibreOffice
|
|
277
|
+
* and Pages centre every column.
|
|
278
|
+
*
|
|
279
|
+
* @example
|
|
280
|
+
* ```typescript
|
|
281
|
+
* new MathMatrix({
|
|
282
|
+
* brackets: "round",
|
|
283
|
+
* rows: [
|
|
284
|
+
* [[new MathRun("1")], [new MathRun("2")]],
|
|
285
|
+
* [[new MathRun("3")], [new MathRun("4")]],
|
|
286
|
+
* ],
|
|
287
|
+
* });
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
export declare class MathMatrix extends BuilderElement {
|
|
291
|
+
constructor({ brackets, ...options }: MathMatrixOptions);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* The brackets around a matrix:
|
|
296
|
+
*
|
|
297
|
+
* - `"none"`: none, as LaTeX's `matrix`;
|
|
298
|
+
* - `"round"`: ( ), as `pmatrix`;
|
|
299
|
+
* - `"square"`: [ ], as `bmatrix`;
|
|
300
|
+
* - `"curly"`: { }, as `Bmatrix`;
|
|
301
|
+
* - `"angled"`: ⟨ ⟩;
|
|
302
|
+
* - `"verticalBars"`: | |, as `vmatrix`, for determinants;
|
|
303
|
+
* - `"doubleVerticalBars"`: ‖ ‖, as `Vmatrix`, for norms.
|
|
304
|
+
*/
|
|
305
|
+
export declare type MathMatrixBrackets = "none" | "round" | "square" | "curly" | "angled" | "verticalBars" | "doubleVerticalBars";
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Options for {@link MathMatrix}.
|
|
309
|
+
*/
|
|
310
|
+
export declare type MathMatrixOptions = {
|
|
311
|
+
/**
|
|
312
|
+
* The rows, each a list of cells, and each cell the math in it (`m:mr`, `m:e`). A row shorter than the longest gets
|
|
313
|
+
* empty cells at its end. Word allows at most 256 rows and 64 cells in a row.
|
|
314
|
+
*/
|
|
315
|
+
readonly rows: readonly (readonly (readonly MathComponent[])[])[];
|
|
316
|
+
/**
|
|
317
|
+
* The brackets around the matrix.
|
|
318
|
+
* @default "none"
|
|
319
|
+
*/
|
|
320
|
+
readonly brackets?: MathMatrixBrackets;
|
|
321
|
+
/**
|
|
322
|
+
* Where the cells go across their columns: one alignment for every column, or one for each column.
|
|
323
|
+
* @default "center"
|
|
324
|
+
*/
|
|
325
|
+
readonly columnAlignment?: MathColumnAlignment | readonly MathColumnAlignment[];
|
|
326
|
+
/**
|
|
327
|
+
* Where the matrix sits on its line.
|
|
328
|
+
* @default "center"
|
|
329
|
+
*/
|
|
330
|
+
readonly verticalAlignment?: MathVerticalAlignment;
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
export { MathNumerator }
|
|
334
|
+
|
|
335
|
+
export { MathPreSubSuperScript }
|
|
336
|
+
|
|
337
|
+
export { MathRadical }
|
|
338
|
+
|
|
339
|
+
export { MathRadicalProperties }
|
|
340
|
+
|
|
341
|
+
export { MathRoundBrackets }
|
|
342
|
+
|
|
343
|
+
export { MathRun }
|
|
344
|
+
|
|
345
|
+
export { MathRunOptions }
|
|
346
|
+
|
|
347
|
+
export { MathSquareBrackets }
|
|
348
|
+
|
|
349
|
+
export { MathSubScript }
|
|
350
|
+
|
|
351
|
+
export { MathSubSuperScript }
|
|
352
|
+
|
|
353
|
+
export { MathSum }
|
|
354
|
+
|
|
355
|
+
export { MathSuperScript }
|
|
356
|
+
|
|
357
|
+
/** Where a matrix or equation array sits on its line (`m:baseJc`): its top, its middle or its bottom on the line */
|
|
358
|
+
export declare type MathVerticalAlignment = "top" | "center" | "bottom";
|
|
359
|
+
|
|
360
|
+
export { }
|