ts-d2 0.0.21 → 0.0.22

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/dist/index.d.cts CHANGED
@@ -5,12 +5,6 @@ declare abstract class DocumentElement {
5
5
  }
6
6
  type Content = string | DocumentElement | (DocumentElement | string)[];
7
7
 
8
- declare class Text extends DocumentElement {
9
- constructor(content: string);
10
- content: string;
11
- toDocFrame(): Proto.Node;
12
- }
13
-
14
8
  declare abstract class BranchDocumentElement<P = never> extends DocumentElement {
15
9
  protected children: DocumentElement[];
16
10
  protected _props?: P;
@@ -24,6 +18,58 @@ declare abstract class BranchDocumentElement<P = never> extends DocumentElement
24
18
  get props(): P | undefined;
25
19
  }
26
20
 
21
+ /**
22
+ * WsArea (Widow/orphan and Split area) wraps content to control
23
+ * page break behavior.
24
+ */
25
+ declare class WsArea extends BranchDocumentElement {
26
+ constructor(content?: Content);
27
+ toDocFrame(): Proto.Node;
28
+ }
29
+
30
+ type VariableSpecialType = "table-number" | "doc-page-count" | "doc-cur-page" | "cur-page" | "page-count" | "prev-page" | "section-page" | "updated-at" | "generated-at";
31
+ interface VariableProperties {
32
+ /** Data path to the variable */
33
+ path?: string;
34
+ /** Static content value */
35
+ content?: string;
36
+ /** UUID of the format to apply */
37
+ formatUuid?: string;
38
+ /** Special type of the variable (e.g. page number) */
39
+ specialType?: VariableSpecialType;
40
+ /** UUID */
41
+ uuid?: string;
42
+ }
43
+ declare class Variable extends DocumentElement {
44
+ props: VariableProperties;
45
+ constructor(props: VariableProperties);
46
+ toDocFrame(): Proto.Node;
47
+ }
48
+
49
+ declare class Text extends DocumentElement {
50
+ constructor(content: string);
51
+ content: string;
52
+ toDocFrame(): Proto.Node;
53
+ }
54
+
55
+ interface TagProperties {
56
+ /** Tag name */
57
+ name: string;
58
+ /** UUID */
59
+ uuid?: string;
60
+ /** Tag parameters */
61
+ params?: string[];
62
+ /** Name code expression */
63
+ nameCode?: string;
64
+ /** Whether name is in code mode */
65
+ codeMode?: boolean;
66
+ }
67
+ declare class Tag extends DocumentElement {
68
+ props: TagProperties;
69
+ constructor(props: TagProperties);
70
+ toDocFrame(): Proto.Node;
71
+ }
72
+
27
73
  type AbsoluteMeasureUnit = "pt" | "cm" | "mm" | "in" | "px";
28
74
  type RelativeMeasureUnit = "%";
29
75
  type MeasureUnit = AbsoluteMeasureUnit | RelativeMeasureUnit;
@@ -66,6 +112,15 @@ declare class TableRow extends BranchDocumentElement<TableRowProperties> {
66
112
  toDocFrame(): Proto.Node;
67
113
  }
68
114
 
115
+ interface TableContentGroupProperties {
116
+ /** UUID */
117
+ uuid?: string;
118
+ }
119
+ declare class TableContentGroup extends BranchDocumentElement<TableContentGroupProperties> {
120
+ constructor(content?: Content, props?: TableContentGroupProperties);
121
+ toDocFrame(): Proto.Node;
122
+ }
123
+
69
124
  declare class HorizontalAlignment {
70
125
  readonly value: Proto.ProtoHorizontalAlignment;
71
126
  constructor(value: Proto.ProtoHorizontalAlignment);
@@ -76,6 +131,20 @@ declare class VerticalAlignment {
76
131
  constructor(value: Proto.ProtoVerticalAlignment);
77
132
  toDocFrame(): Proto.ProtoVerticalAlignment;
78
133
  }
134
+ declare namespace Alignment {
135
+ const Horizontal: {
136
+ Left: HorizontalAlignment;
137
+ Center: HorizontalAlignment;
138
+ Right: HorizontalAlignment;
139
+ Justify: HorizontalAlignment;
140
+ FullJustify: HorizontalAlignment;
141
+ };
142
+ const Vertical: {
143
+ Top: VerticalAlignment;
144
+ Middle: VerticalAlignment;
145
+ Bottom: VerticalAlignment;
146
+ };
147
+ }
79
148
 
80
149
  declare class Color {
81
150
  private color;
@@ -110,6 +179,8 @@ interface TableCellProperties {
110
179
  padding?: SideMeasures;
111
180
  verticalAlignment?: VerticalAlignment;
112
181
  width?: Measure$1;
182
+ rotation?: number;
183
+ defaultParagraphFormat?: string;
113
184
  }
114
185
  declare class TableCell extends BranchDocumentElement<TableCellProperties> {
115
186
  constructor(content?: Content, props?: TableCellProperties);
@@ -119,17 +190,36 @@ declare class TableCell extends BranchDocumentElement<TableCellProperties> {
119
190
  interface TableSettings {
120
191
  width?: Measure$1;
121
192
  xOffset?: Measure$1;
193
+ leftMeasure?: boolean;
194
+ repeatHeader?: number;
122
195
  }
123
196
  declare class Table extends BranchDocumentElement<TableSettings> {
124
197
  constructor(content?: Content, props?: TableSettings);
125
198
  toDocFrame(): Proto.Node;
126
199
  }
127
200
 
201
+ type SubTotalPosition = "above-footer" | "below-content";
202
+ interface SubTotalProperties {
203
+ /** Whether to apply immediately */
204
+ applyImmediate?: boolean;
205
+ /** Position of the sub total */
206
+ position?: SubTotalPosition;
207
+ /** Height of the sub total area */
208
+ height?: Measure$1;
209
+ }
210
+ declare class SubTotal extends BranchDocumentElement<SubTotalProperties> {
211
+ constructor(content?: Content, props?: SubTotalProperties);
212
+ toDocFrame(): Proto.Node;
213
+ }
214
+
128
215
  interface SpanProperties {
129
216
  bold?: boolean;
130
217
  italic?: boolean;
131
218
  underline?: boolean;
132
219
  strikethrough?: boolean;
220
+ color?: Color;
221
+ subscript?: boolean;
222
+ superscript?: boolean;
133
223
  }
134
224
  declare class Span extends BranchDocumentElement<SpanProperties> {
135
225
  constructor(content?: Content, props?: SpanProperties);
@@ -142,6 +232,82 @@ declare class SpaceVertically extends DocumentElement {
142
232
  toDocFrame(): Proto.Node;
143
233
  }
144
234
 
235
+ interface SelectionEntryProperties {
236
+ /** UUID */
237
+ uuid?: string;
238
+ /** Internal name for the selection entry */
239
+ internalName?: string;
240
+ /** Display name */
241
+ name?: string;
242
+ /** Whether this entry is selected */
243
+ selected?: boolean;
244
+ }
245
+ declare class SelectionEntry extends BranchDocumentElement<SelectionEntryProperties> {
246
+ constructor(content?: Content, props?: SelectionEntryProperties);
247
+ toDocFrame(): Proto.Node;
248
+ }
249
+
250
+ interface SelectionProperties {
251
+ /** UUID */
252
+ uuid?: string;
253
+ /** Internal name for the selection */
254
+ internalName?: string;
255
+ /** Display name */
256
+ name?: string;
257
+ /** Whether multiple entries can be selected */
258
+ multi?: boolean;
259
+ /** Minimum number of selections required */
260
+ min?: number;
261
+ /** Maximum number of selections allowed */
262
+ max?: number;
263
+ }
264
+ declare class Selection extends BranchDocumentElement<SelectionProperties> {
265
+ constructor(content?: Content, props?: SelectionProperties);
266
+ toDocFrame(): Proto.Node;
267
+ }
268
+
269
+ interface SectionProperties {
270
+ uuid?: string;
271
+ /** UUID of the column definition to apply to this section */
272
+ cDefUuid?: string;
273
+ }
274
+ declare class Section extends BranchDocumentElement<SectionProperties> {
275
+ constructor(content?: Content, props?: SectionProperties);
276
+ toDocFrame(): Proto.Node;
277
+ }
278
+
279
+ type RuleStyle = "solid" | "sparse-shading" | "medium-shading" | "dense-shading" | "light-dotted" | "medium-dotted" | "heavy-dotted" | "light-dashed" | "medium-dashed" | "heavy-dashed" | "dash-pattern" | "double";
280
+ type RuleMode = "normal" | "boundary";
281
+ interface RuleBoundaries {
282
+ start?: Measure$1;
283
+ end?: Measure$1;
284
+ }
285
+ interface RuleProperties {
286
+ /** Horizontal offset */
287
+ xOffset?: Measure$1;
288
+ /** Vertical offset */
289
+ yOffset?: Measure$1;
290
+ /** Width of the rule */
291
+ width?: Measure$1;
292
+ /** Thickness of the rule line */
293
+ thickness?: Measure$1;
294
+ /** Rotation in degrees */
295
+ rotation?: number;
296
+ /** Rule color */
297
+ color?: Color;
298
+ /** Rule style (solid, dashed, dotted, etc.) */
299
+ style?: RuleStyle;
300
+ /** Rule mode */
301
+ mode?: RuleMode;
302
+ /** Rule boundaries for boundary mode */
303
+ boundaries?: RuleBoundaries;
304
+ }
305
+ declare class Rule extends DocumentElement {
306
+ props: RuleProperties;
307
+ constructor(props: RuleProperties);
308
+ toDocFrame(): Proto.Node;
309
+ }
310
+
145
311
  declare class Font {
146
312
  private name;
147
313
  constructor(name: string);
@@ -187,15 +353,143 @@ declare class PageDefinition {
187
353
  toDocFrame(): Proto.ProtoPDef;
188
354
  }
189
355
 
356
+ interface PageConditionProperties {
357
+ /** UUID */
358
+ uuid?: string;
359
+ /** Code expression to evaluate per page */
360
+ code?: string;
361
+ }
362
+ declare class PageCondition extends BranchDocumentElement<PageConditionProperties> {
363
+ constructor(content?: Content, props?: PageConditionProperties);
364
+ toDocFrame(): Proto.Node;
365
+ }
366
+
190
367
  declare class Pagebreak extends DocumentElement {
191
368
  toDocFrame(): Proto.Node;
192
369
  }
193
370
 
371
+ interface LoopEntryProperties {
372
+ /** Data path for this loop entry */
373
+ path?: string;
374
+ /** Index of this entry in the loop */
375
+ index?: number;
376
+ /** UUID */
377
+ uuid?: string;
378
+ }
379
+ declare class LoopEntry extends BranchDocumentElement<LoopEntryProperties> {
380
+ constructor(content?: Content, props?: LoopEntryProperties);
381
+ toDocFrame(): Proto.Node;
382
+ }
383
+
384
+ interface LoopProperties {
385
+ /** Data path to iterate over */
386
+ path?: string;
387
+ /** UUID */
388
+ uuid?: string;
389
+ }
390
+ declare class Loop extends BranchDocumentElement<LoopProperties> {
391
+ constructor(content?: Content, props?: LoopProperties);
392
+ toDocFrame(): Proto.Node;
393
+ }
394
+
395
+ interface LinkProperties {
396
+ /** The URL to link to */
397
+ url: string;
398
+ }
399
+ declare class Link extends BranchDocumentElement<LinkProperties> {
400
+ constructor(content?: Content, url?: string);
401
+ toDocFrame(): Proto.Node;
402
+ }
403
+
194
404
  declare class Linebreak extends DocumentElement {
195
405
  toDocFrame(): Proto.Node;
196
406
  }
197
407
 
198
- declare class Header extends BranchDocumentElement<never> {
408
+ interface IndentationProperties {
409
+ /** Left indentation */
410
+ left?: Measure$1;
411
+ /** Right indentation */
412
+ right?: Measure$1;
413
+ /** UUID */
414
+ uuid?: string;
415
+ }
416
+ declare class Indentation extends BranchDocumentElement<IndentationProperties> {
417
+ constructor(content?: Content, props?: IndentationProperties);
418
+ toDocFrame(): Proto.Node;
419
+ }
420
+
421
+ /**
422
+ * A ReferencePoint is used for elements like barcodes to specify the reference point
423
+ * of an object.
424
+ * Example:
425
+ * When specified reference point "top-left", the top-left point of a barcode is positioned
426
+ * relative to the top-left edge of the current line or page.
427
+ */
428
+ type ReferencePoint = "top-left" | "top-right" | "center" | "bottom-left" | "bottom-right";
429
+
430
+ type ImageScaleType = "relative" | "absolute" | "relative-to-column";
431
+ interface FlipSettings {
432
+ x?: boolean;
433
+ y?: boolean;
434
+ }
435
+ interface CropSettings {
436
+ x?: Measure$1;
437
+ y?: Measure$1;
438
+ width?: Measure$1;
439
+ height?: Measure$1;
440
+ }
441
+ interface ImageProperties {
442
+ /** Alternative text for accessibility */
443
+ alt?: string;
444
+ /** Image name */
445
+ name?: string;
446
+ /** Image source URL or path */
447
+ src?: string;
448
+ /** Image filename */
449
+ filename?: string;
450
+ /** Scale factor (e.g. 1.0 = 100%) */
451
+ scale?: number;
452
+ /** Scale relative to column width (e.g. 0.5 = 50% of column) */
453
+ columnScale?: number;
454
+ /** Image width */
455
+ width?: Measure$1;
456
+ /** Image height */
457
+ height?: Measure$1;
458
+ /** X position */
459
+ x?: Measure$1;
460
+ /** Y position */
461
+ y?: Measure$1;
462
+ /** Whether the image is positioned absolutely */
463
+ positionAbsolute?: boolean;
464
+ /** Rotation in degrees */
465
+ rotation?: number;
466
+ /** Flip settings */
467
+ flip?: FlipSettings;
468
+ /** Crop settings */
469
+ crop?: CropSettings;
470
+ /** Reference point for positioning */
471
+ referencePoint?: ReferencePoint;
472
+ /** Hyperlink URL */
473
+ hyperlink?: string;
474
+ /** Scale type */
475
+ scaleType?: ImageScaleType;
476
+ /** UUID */
477
+ uuid?: string;
478
+ /** Inline image content as base64-encoded string */
479
+ imageContent?: string;
480
+ }
481
+ declare class Image extends DocumentElement {
482
+ props: ImageProperties;
483
+ constructor(props: ImageProperties);
484
+ toDocFrame(): Proto.Node;
485
+ }
486
+
487
+ type HeaderMode = "append-initial" | "append" | "extend" | "replace";
488
+ interface HeaderProperties {
489
+ mode?: HeaderMode;
490
+ }
491
+ declare class Header extends BranchDocumentElement<HeaderProperties> {
492
+ constructor(content?: Content, props?: HeaderProperties);
199
493
  toDocFrame(): Proto.Node;
200
494
  }
201
495
 
@@ -208,7 +502,12 @@ declare class Formatted extends DocumentElement {
208
502
  toDocFrame(): Proto.Node;
209
503
  }
210
504
 
211
- declare class Footer extends BranchDocumentElement {
505
+ type FooterMode = "append-initial" | "append" | "extend" | "replace";
506
+ interface FooterProperties {
507
+ mode?: FooterMode;
508
+ }
509
+ declare class Footer extends BranchDocumentElement<FooterProperties> {
510
+ constructor(content?: Content, props?: FooterProperties);
212
511
  toDocFrame(): Proto.Node;
213
512
  }
214
513
 
@@ -294,18 +593,40 @@ declare class Document extends BranchDocumentElement<DocumentProperties> {
294
593
  toDocFrame(): Proto.Node;
295
594
  }
296
595
 
297
- declare class Directory extends BranchDocumentElement {
596
+ type SemanticType = "none" | "part" | "art" | "sect" | "div";
597
+ interface DirectoryProperties {
598
+ name?: string;
599
+ editable?: boolean;
600
+ semanticType?: SemanticType;
601
+ }
602
+ declare class Directory extends BranchDocumentElement<DirectoryProperties> {
603
+ constructor(content?: Content, props?: DirectoryProperties);
604
+ toDocFrame(): Proto.Node;
605
+ }
606
+
607
+ interface ConditionProperties {
608
+ /** UUID */
609
+ uuid?: string;
610
+ /** Code expression to evaluate */
611
+ code?: string;
612
+ /** Pre-evaluated result */
613
+ result?: boolean;
614
+ /** Whether the condition should be re-evaluated on regeneration */
615
+ regenerate?: boolean;
616
+ }
617
+ declare class Condition extends BranchDocumentElement<ConditionProperties> {
618
+ constructor(content?: Content, props?: ConditionProperties);
298
619
  toDocFrame(): Proto.Node;
299
620
  }
300
621
 
301
622
  /**
302
- * A ReferencePoint is used for elements like barcodes to specify the reference point
303
- * of an object.
304
- * Example:
305
- * When specified reference point "top-left", the top-left point of a barcode is positioned
306
- * relative to the top-left edge of the current line or page.
623
+ * CarryOver defines content that is carried over to the next page
624
+ * when a table or other element breaks across pages.
307
625
  */
308
- type ReferencePoint = "top-left" | "top-right" | "center" | "bottom-left" | "bottom-right";
626
+ declare class CarryOver extends BranchDocumentElement {
627
+ constructor(content?: Content);
628
+ toDocFrame(): Proto.Node;
629
+ }
309
630
 
310
631
  interface BarcodeProperties {
311
632
  type: Proto.ProtoBarcodeType;
@@ -320,6 +641,10 @@ interface BarcodeProperties {
320
641
  height: AbsoluteMeasure;
321
642
  data: string;
322
643
  positionAbsolute: boolean;
644
+ padding?: AbsoluteMeasure;
645
+ code?: string;
646
+ altText?: string;
647
+ uuid?: string;
323
648
  }
324
649
  declare class Barcode extends DocumentElement {
325
650
  props: BarcodeProperties;
@@ -327,6 +652,41 @@ declare class Barcode extends DocumentElement {
327
652
  toDocFrame(): Proto.Node;
328
653
  }
329
654
 
655
+ type TextFlowType = "around" | "no-flow" | "foreground" | "background";
656
+ interface AdvancedIllustrationAreaProperties {
657
+ /** UUID */
658
+ uuid?: string;
659
+ /** Whether the AIA is absolutely positioned */
660
+ absolute?: boolean;
661
+ /** Width */
662
+ width?: Measure$1;
663
+ /** Height */
664
+ height?: Measure$1;
665
+ /** X position */
666
+ x?: Measure$1;
667
+ /** Y position */
668
+ y?: Measure$1;
669
+ /** How text flows around the AIA */
670
+ textFlow?: TextFlowType;
671
+ /** Rotation in degrees */
672
+ rotation?: number;
673
+ }
674
+ declare class AdvancedIllustrationArea extends BranchDocumentElement<AdvancedIllustrationAreaProperties> {
675
+ constructor(content?: Content, props?: AdvancedIllustrationAreaProperties);
676
+ toDocFrame(): Proto.Node;
677
+ }
678
+
679
+ interface AdjustHorizontallyProperties {
680
+ /** Minimum font size for horizontal adjustment */
681
+ minFontSize?: Measure$1;
682
+ /** Maximum font size for horizontal adjustment */
683
+ maxFontSize?: Measure$1;
684
+ }
685
+ declare class AdjustHorizontally extends BranchDocumentElement<AdjustHorizontallyProperties> {
686
+ constructor(content?: Content, props?: AdjustHorizontallyProperties);
687
+ toDocFrame(): Proto.Node;
688
+ }
689
+
330
690
  declare class Connection {
331
691
  url: string;
332
692
  token: string;
@@ -336,6 +696,7 @@ declare class Connection {
336
696
  }
337
697
 
338
698
  declare const _default: {
699
+ Alignment: typeof Alignment;
339
700
  Border: {
340
701
  Border: typeof Border;
341
702
  SideBorders: typeof SideBorders;
@@ -346,24 +707,43 @@ declare const _default: {
346
707
  };
347
708
  Connection: typeof Connection;
348
709
  Content: {
710
+ AdjustHorizontally: typeof AdjustHorizontally;
711
+ AdvancedIllustrationArea: typeof AdvancedIllustrationArea;
349
712
  Barcode: typeof Barcode;
713
+ CarryOver: typeof CarryOver;
350
714
  ColumnDefinition: typeof ColumnDefinition;
351
715
  ColumnPosition: typeof ColumnPosition;
716
+ Condition: typeof Condition;
352
717
  Directory: typeof Directory;
353
718
  Document: typeof Document;
354
719
  Footer: typeof Footer;
355
720
  Formatted: typeof Formatted;
356
721
  Header: typeof Header;
722
+ Image: typeof Image;
723
+ Indentation: typeof Indentation;
357
724
  Linebreak: typeof Linebreak;
725
+ Link: typeof Link;
726
+ Loop: typeof Loop;
727
+ LoopEntry: typeof LoopEntry;
358
728
  Pagebreak: typeof Pagebreak;
729
+ PageCondition: typeof PageCondition;
359
730
  PageDefinition: typeof PageDefinition;
360
731
  Paragraph: typeof Paragraph;
732
+ Rule: typeof Rule;
733
+ Section: typeof Section;
734
+ Selection: typeof Selection;
735
+ SelectionEntry: typeof SelectionEntry;
361
736
  SpaceVertically: typeof SpaceVertically;
362
737
  Span: typeof Span;
738
+ SubTotal: typeof SubTotal;
363
739
  Table: typeof Table;
364
740
  TableCell: typeof TableCell;
741
+ TableContentGroup: typeof TableContentGroup;
365
742
  TableRow: typeof TableRow;
743
+ Tag: typeof Tag;
366
744
  Text: typeof Text;
745
+ Variable: typeof Variable;
746
+ WsArea: typeof WsArea;
367
747
  };
368
748
  Font: {
369
749
  Font: typeof Font;