@silurus/ooxml 0.43.0 → 0.44.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.
@@ -124,7 +124,12 @@ export declare type DocRun = {
124
124
  type: 'field';
125
125
  } & FieldRun | {
126
126
  type: 'shape';
127
- } & ShapeRun;
127
+ } & ShapeRun | {
128
+ type: 'math';
129
+ nodes: MathNode[];
130
+ display: boolean;
131
+ fontSize: number;
132
+ };
128
133
 
129
134
  declare interface DocTable {
130
135
  colWidths: number[];
@@ -134,6 +139,8 @@ declare interface DocTable {
134
139
  cellMarginBottom: number;
135
140
  cellMarginLeft: number;
136
141
  cellMarginRight: number;
142
+ /** table horizontal alignment on the page: 'left' | 'center' | 'right'. */
143
+ jc: string;
137
144
  }
138
145
 
139
146
  declare interface DocTableCell {
@@ -379,6 +386,109 @@ declare interface LoadOptions_2 {
379
386
  useGoogleFonts?: boolean;
380
387
  }
381
388
 
389
+ /** Accent (`m:acc`), e.g. hat, bar, vector arrow over the base. */
390
+ declare interface MathAccent {
391
+ kind: 'accent';
392
+ char: string;
393
+ base: MathNode[];
394
+ }
395
+
396
+ /** Matrix (`m:m`) or aligned equation array (`m:eqArr`). rows → cells → nodes. */
397
+ declare interface MathArray {
398
+ kind: 'array';
399
+ rows: MathNode[][][];
400
+ /** 'eq' = alternating right/left (eqArr); 'center' = matrix; 'left'. */
401
+ align: 'eq' | 'center' | 'left';
402
+ }
403
+
404
+ /** Over/under bar (`m:bar`). */
405
+ declare interface MathBar {
406
+ kind: 'bar';
407
+ pos: 'top' | 'bot';
408
+ base: MathNode[];
409
+ }
410
+
411
+ declare interface MathDelimiter {
412
+ kind: 'delimiter';
413
+ /** opening char (default '('). */
414
+ begChar: string;
415
+ /** closing char (default ')'). */
416
+ endChar: string;
417
+ /** separated groups (e.g. for cases / multiple args). */
418
+ items: MathNode[][];
419
+ }
420
+
421
+ declare interface MathFraction {
422
+ kind: 'fraction';
423
+ num: MathNode[];
424
+ den: MathNode[];
425
+ /** false = no rule (e.g. binomial); defaults to true. */
426
+ bar?: boolean;
427
+ }
428
+
429
+ declare interface MathFunc {
430
+ kind: 'func';
431
+ name: MathNode[];
432
+ arg: MathNode[];
433
+ }
434
+
435
+ declare interface MathGroup {
436
+ kind: 'group';
437
+ items: MathNode[];
438
+ }
439
+
440
+ /** Group character (`m:groupChr`), e.g. under/over brace. */
441
+ declare interface MathGroupChr {
442
+ kind: 'groupChr';
443
+ char: string;
444
+ pos: 'top' | 'bot';
445
+ base: MathNode[];
446
+ }
447
+
448
+ /** Lower/upper limit (`m:limLow` / `m:limUpp`), e.g. lim under n→∞. */
449
+ declare interface MathLimit {
450
+ kind: 'limit';
451
+ base: MathNode[];
452
+ lower?: MathNode[];
453
+ upper?: MathNode[];
454
+ }
455
+
456
+ declare interface MathNary {
457
+ kind: 'nary';
458
+ /** operator char, e.g. '∑', '∫', '∏'. */
459
+ op: string;
460
+ /** limit location (`m:limLoc`): 'subSup' = beside the op, 'undOvr' = above/below.
461
+ * Empty/omitted = default by operator class (integrals → subSup, others → undOvr). */
462
+ limLoc?: string;
463
+ sub?: MathNode[];
464
+ sup?: MathNode[];
465
+ body: MathNode[];
466
+ }
467
+
468
+ declare type MathNode = MathRun | MathFraction | MathScript | MathNary | MathDelimiter | MathRadical | MathLimit | MathArray | MathGroupChr | MathBar | MathAccent | MathFunc | MathGroup;
469
+
470
+ declare interface MathRadical {
471
+ kind: 'radical';
472
+ /** optional index (e.g. cube root); empty/omitted = square root. */
473
+ index?: MathNode[];
474
+ radicand: MathNode[];
475
+ }
476
+
477
+ declare interface MathRun {
478
+ kind: 'run';
479
+ text: string;
480
+ style: MathStyle;
481
+ }
482
+
483
+ declare interface MathScript {
484
+ kind: 'sup' | 'sub' | 'subSup';
485
+ base: MathNode[];
486
+ sup?: MathNode[];
487
+ sub?: MathNode[];
488
+ }
489
+
490
+ declare type MathStyle = 'roman' | 'italic' | 'bold' | 'boldItalic';
491
+
382
492
  declare interface NumberingInfo {
383
493
  numId: number;
384
494
  level: number;
@@ -705,7 +705,12 @@ declare type DocRun = {
705
705
  type: 'field';
706
706
  } & FieldRun | {
707
707
  type: 'shape';
708
- } & ShapeRun;
708
+ } & ShapeRun | {
709
+ type: 'math';
710
+ nodes: MathNode[];
711
+ display: boolean;
712
+ fontSize: number;
713
+ };
709
714
 
710
715
  declare interface DocTable {
711
716
  colWidths: number[];
@@ -715,6 +720,8 @@ declare interface DocTable {
715
720
  cellMarginBottom: number;
716
721
  cellMarginLeft: number;
717
722
  cellMarginRight: number;
723
+ /** table horizontal alignment on the page: 'left' | 'center' | 'right'. */
724
+ jc: string;
718
725
  }
719
726
 
720
727
  declare interface DocTableCell {
@@ -1150,6 +1157,109 @@ declare interface ManualLayout {
1150
1157
  h?: number;
1151
1158
  }
1152
1159
 
1160
+ /** Accent (`m:acc`), e.g. hat, bar, vector arrow over the base. */
1161
+ declare interface MathAccent {
1162
+ kind: 'accent';
1163
+ char: string;
1164
+ base: MathNode[];
1165
+ }
1166
+
1167
+ /** Matrix (`m:m`) or aligned equation array (`m:eqArr`). rows → cells → nodes. */
1168
+ declare interface MathArray {
1169
+ kind: 'array';
1170
+ rows: MathNode[][][];
1171
+ /** 'eq' = alternating right/left (eqArr); 'center' = matrix; 'left'. */
1172
+ align: 'eq' | 'center' | 'left';
1173
+ }
1174
+
1175
+ /** Over/under bar (`m:bar`). */
1176
+ declare interface MathBar {
1177
+ kind: 'bar';
1178
+ pos: 'top' | 'bot';
1179
+ base: MathNode[];
1180
+ }
1181
+
1182
+ declare interface MathDelimiter {
1183
+ kind: 'delimiter';
1184
+ /** opening char (default '('). */
1185
+ begChar: string;
1186
+ /** closing char (default ')'). */
1187
+ endChar: string;
1188
+ /** separated groups (e.g. for cases / multiple args). */
1189
+ items: MathNode[][];
1190
+ }
1191
+
1192
+ declare interface MathFraction {
1193
+ kind: 'fraction';
1194
+ num: MathNode[];
1195
+ den: MathNode[];
1196
+ /** false = no rule (e.g. binomial); defaults to true. */
1197
+ bar?: boolean;
1198
+ }
1199
+
1200
+ declare interface MathFunc {
1201
+ kind: 'func';
1202
+ name: MathNode[];
1203
+ arg: MathNode[];
1204
+ }
1205
+
1206
+ declare interface MathGroup {
1207
+ kind: 'group';
1208
+ items: MathNode[];
1209
+ }
1210
+
1211
+ /** Group character (`m:groupChr`), e.g. under/over brace. */
1212
+ declare interface MathGroupChr {
1213
+ kind: 'groupChr';
1214
+ char: string;
1215
+ pos: 'top' | 'bot';
1216
+ base: MathNode[];
1217
+ }
1218
+
1219
+ /** Lower/upper limit (`m:limLow` / `m:limUpp`), e.g. lim under n→∞. */
1220
+ declare interface MathLimit {
1221
+ kind: 'limit';
1222
+ base: MathNode[];
1223
+ lower?: MathNode[];
1224
+ upper?: MathNode[];
1225
+ }
1226
+
1227
+ declare interface MathNary {
1228
+ kind: 'nary';
1229
+ /** operator char, e.g. '∑', '∫', '∏'. */
1230
+ op: string;
1231
+ /** limit location (`m:limLoc`): 'subSup' = beside the op, 'undOvr' = above/below.
1232
+ * Empty/omitted = default by operator class (integrals → subSup, others → undOvr). */
1233
+ limLoc?: string;
1234
+ sub?: MathNode[];
1235
+ sup?: MathNode[];
1236
+ body: MathNode[];
1237
+ }
1238
+
1239
+ declare type MathNode = MathRun | MathFraction | MathScript | MathNary | MathDelimiter | MathRadical | MathLimit | MathArray | MathGroupChr | MathBar | MathAccent | MathFunc | MathGroup;
1240
+
1241
+ declare interface MathRadical {
1242
+ kind: 'radical';
1243
+ /** optional index (e.g. cube root); empty/omitted = square root. */
1244
+ index?: MathNode[];
1245
+ radicand: MathNode[];
1246
+ }
1247
+
1248
+ declare interface MathRun {
1249
+ kind: 'run';
1250
+ text: string;
1251
+ style: MathStyle;
1252
+ }
1253
+
1254
+ declare interface MathScript {
1255
+ kind: 'sup' | 'sub' | 'subSup';
1256
+ base: MathNode[];
1257
+ sup?: MathNode[];
1258
+ sub?: MathNode[];
1259
+ }
1260
+
1261
+ declare type MathStyle = 'roman' | 'italic' | 'bold' | 'boldItalic';
1262
+
1153
1263
  declare interface MediaElement {
1154
1264
  type: 'media';
1155
1265
  x: number;