@office-open/docx 0.6.3 → 0.6.4

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.mts CHANGED
@@ -61,7 +61,7 @@ declare function buildDocumentAttributes(ns: readonly DocumentAttributeNamespace
61
61
  declare abstract class HeaderFooterBase extends InitializableXmlComponent {
62
62
  private readonly refId;
63
63
  protected constructor(tagName: string, referenceNumber: number, namespaces: readonly DocumentAttributeNamespace[], initContent?: XmlComponent);
64
- get ReferenceId(): number;
64
+ get referenceId(): number;
65
65
  add(item: FileChild): void;
66
66
  }
67
67
  //#endregion
@@ -271,7 +271,7 @@ declare class Media {
271
271
  private readonly map;
272
272
  constructor();
273
273
  addImage(key: string, mediaData: IMediaData): void;
274
- get Array(): readonly IMediaData[];
274
+ get array(): readonly IMediaData[];
275
275
  }
276
276
  //#endregion
277
277
  //#region src/file/footer-wrapper.d.ts
@@ -280,15 +280,13 @@ interface DocumentFooter {
280
280
  readonly type: (typeof HeaderFooterReferenceType)[keyof typeof HeaderFooterReferenceType];
281
281
  }
282
282
  declare class FooterWrapper implements ViewWrapper {
283
- private readonly media;
284
283
  private readonly footer;
285
- private readonly relationships;
284
+ readonly relationships: Relationships;
285
+ readonly media: Media;
286
286
  constructor(media: Media, referenceId: number, initContent?: XmlComponent);
287
287
  add(item: FileChild): void;
288
288
  addChildElement(childElement: XmlComponent): void;
289
- get View(): Footer$1;
290
- get Relationships(): Relationships;
291
- get Media(): Media;
289
+ get view(): Footer$1;
292
290
  }
293
291
  //#endregion
294
292
  //#region src/file/header/header.d.ts
@@ -302,15 +300,13 @@ interface DocumentHeader {
302
300
  readonly type: (typeof HeaderFooterReferenceType)[keyof typeof HeaderFooterReferenceType];
303
301
  }
304
302
  declare class HeaderWrapper implements ViewWrapper {
305
- private readonly media;
306
303
  private readonly header;
307
- private readonly relationships;
304
+ readonly relationships: Relationships;
305
+ readonly media: Media;
308
306
  constructor(media: Media, referenceId: number, initContent?: XmlComponent);
309
307
  add(item: FileChild): HeaderWrapper;
310
308
  addChildElement(childElement: XmlComponent | string): void;
311
- get View(): Header$1;
312
- get Relationships(): Relationships;
313
- get Media(): Media;
309
+ get view(): Header$1;
314
310
  }
315
311
  //#endregion
316
312
  //#region src/file/track-revision/track-revision.d.ts
@@ -805,10 +801,9 @@ interface DocumentOptions {
805
801
  readonly background?: DocumentBackgroundOptions;
806
802
  }
807
803
  declare class Document extends XmlComponent {
808
- private readonly body;
804
+ readonly body: Body;
809
805
  constructor(options: DocumentOptions);
810
806
  add(item: FileChild | ConcreteHyperlink): Document;
811
- get Body(): Body;
812
807
  }
813
808
  //#endregion
814
809
  //#region src/file/endnotes/endnotes.d.ts
@@ -1511,7 +1506,7 @@ declare class AltChunkCollection {
1511
1506
  private readonly map;
1512
1507
  constructor();
1513
1508
  addAltChunk(key: string, data: AltChunkData): void;
1514
- get Array(): readonly AltChunkData[];
1509
+ get array(): readonly AltChunkData[];
1515
1510
  }
1516
1511
  //#endregion
1517
1512
  //#region src/file/checkbox/checkbox-util.d.ts
@@ -2003,8 +1998,8 @@ declare class DeletedTableCell extends XmlComponent {
2003
1998
  //#endregion
2004
1999
  //#region src/file/track-revision/track-revision-components/cell-merge.d.ts
2005
2000
  declare const VerticalMergeRevisionType: {
2006
- readonly CONTINUE: "cont";
2007
- readonly RESTART: "rest";
2001
+ readonly CONTINUE: "continue";
2002
+ readonly RESTART: "restart";
2008
2003
  };
2009
2004
  type ICellMergeAttributes = ChangedAttributesProperties & {
2010
2005
  readonly verticalMerge?: (typeof VerticalMergeRevisionType)[keyof typeof VerticalMergeRevisionType];
@@ -2143,7 +2138,7 @@ declare class TableRow extends BaseXmlComponent {
2143
2138
  private extraCells;
2144
2139
  private readonly coercedChildren;
2145
2140
  constructor(options: TableRowOptions);
2146
- get CellCount(): number;
2141
+ get cellCount(): number;
2147
2142
  get cells(): readonly TableCell[];
2148
2143
  addCellToColumnIndex(cell: TableCell, columnIndex: number): void;
2149
2144
  rootIndexToColumnIndex(rootIndex: number): number;
@@ -2201,7 +2196,7 @@ interface SdtRowOptions {
2201
2196
  declare class StructuredDocumentTagRow extends XmlComponent {
2202
2197
  private readonly rows;
2203
2198
  constructor(options: SdtRowOptions);
2204
- get CellCount(): number;
2199
+ get cellCount(): number;
2205
2200
  get cells(): readonly TableCell[];
2206
2201
  addCellToColumnIndex(cell: TableCell, columnIndex: number): void;
2207
2202
  }
@@ -2215,7 +2210,7 @@ declare class SubDocCollection {
2215
2210
  private readonly map;
2216
2211
  constructor();
2217
2212
  addSubDoc(key: string, data: SubDocData): void;
2218
- get Array(): readonly SubDocData[];
2213
+ get array(): readonly SubDocData[];
2219
2214
  }
2220
2215
  //#endregion
2221
2216
  //#region src/file/paragraph/formatting/break.d.ts
@@ -2435,7 +2430,7 @@ declare const FractionType: {
2435
2430
  readonly NO_BAR: "noBar";
2436
2431
  };
2437
2432
  interface MathFractionPropertiesOptions {
2438
- readonly fractionType?: keyof typeof FractionType;
2433
+ readonly fractionType?: (typeof FractionType)[keyof typeof FractionType];
2439
2434
  }
2440
2435
  declare const createMathFractionProperties: (options: MathFractionPropertiesOptions) => XmlComponent;
2441
2436
  //#endregion
@@ -2800,7 +2795,7 @@ type MathJson = MathComponent | string | {
2800
2795
  readonly fraction: {
2801
2796
  readonly numerator: readonly MathJson[];
2802
2797
  readonly denominator: readonly MathJson[];
2803
- readonly fractionType?: keyof typeof FractionType;
2798
+ readonly fractionType?: (typeof FractionType)[keyof typeof FractionType];
2804
2799
  };
2805
2800
  } | {
2806
2801
  readonly superScript: {
@@ -3365,11 +3360,10 @@ declare class Comment extends XmlComponent {
3365
3360
  }: CommentOptions);
3366
3361
  }
3367
3362
  declare class Comments extends XmlComponent {
3368
- private readonly relationships;
3363
+ readonly relationships: Relationships;
3369
3364
  constructor({
3370
3365
  children
3371
3366
  }: CommentsOptions);
3372
- get Relationships(): Relationships;
3373
3367
  }
3374
3368
  //#endregion
3375
3369
  //#region src/file/paragraph/run/positional-tab.d.ts
@@ -3410,7 +3404,7 @@ declare const RubyAlign: {
3410
3404
  interface RubyOptions {
3411
3405
  readonly text: string;
3412
3406
  readonly base: string;
3413
- readonly alignment?: keyof typeof RubyAlign;
3407
+ readonly alignment?: (typeof RubyAlign)[keyof typeof RubyAlign];
3414
3408
  readonly fontSize?: number;
3415
3409
  readonly raise?: number;
3416
3410
  readonly baseFontSize?: number;
@@ -3482,15 +3476,14 @@ declare class EndnoteReferenceRun extends Run {
3482
3476
  //#endregion
3483
3477
  //#region src/file/document-wrapper.d.ts
3484
3478
  interface ViewWrapper {
3485
- readonly View: Document | Footer$1 | Header$1 | FootNotes | Endnotes | XmlComponent;
3486
- readonly Relationships: Relationships;
3479
+ readonly view: Document | Footer$1 | Header$1 | FootNotes | Endnotes | XmlComponent;
3480
+ readonly relationships: Relationships;
3487
3481
  }
3488
3482
  declare class DocumentWrapper implements ViewWrapper {
3489
3483
  private readonly document;
3490
- private readonly relationships;
3484
+ readonly relationships: Relationships;
3491
3485
  constructor(options: DocumentOptions);
3492
- get View(): Document;
3493
- get Relationships(): Relationships;
3486
+ get view(): Document;
3494
3487
  }
3495
3488
  //#endregion
3496
3489
  //#region src/file/bibliography/bibliography.d.ts
@@ -3517,9 +3510,8 @@ interface BibliographyOptions {
3517
3510
  readonly styleName?: string;
3518
3511
  }
3519
3512
  declare class Bibliography extends XmlComponent {
3520
- private readonly relationships;
3513
+ readonly relationships: Relationships;
3521
3514
  constructor(options: BibliographyOptions);
3522
- get Relationships(): Relationships;
3523
3515
  }
3524
3516
  //#endregion
3525
3517
  //#region src/file/content-types/content-types.d.ts
@@ -3568,11 +3560,10 @@ type EmbeddedFontOptionsWithKey = EmbeddedFontOptions & {
3568
3560
  declare class FontWrapper implements ViewWrapper {
3569
3561
  readonly options: readonly EmbeddedFontOptions[];
3570
3562
  private readonly fontTable;
3571
- private readonly relationships;
3563
+ readonly relationships: Relationships;
3572
3564
  readonly fontOptionsWithKey: readonly EmbeddedFontOptionsWithKey[];
3573
3565
  constructor(options: readonly EmbeddedFontOptions[]);
3574
- get View(): XmlComponent;
3575
- get Relationships(): Relationships;
3566
+ get view(): XmlComponent;
3576
3567
  }
3577
3568
  //#endregion
3578
3569
  //#region src/file/fonts/font-table.d.ts
@@ -3874,8 +3865,8 @@ declare class Numbering extends XmlComponent {
3874
3865
  constructor(options: NumberingOptions);
3875
3866
  prepForXml(context: Context): IXmlableObject | undefined;
3876
3867
  createConcreteNumberingInstance(reference: string, instance: number): void;
3877
- get ConcreteNumbering(): readonly ConcreteNumbering[];
3878
- get ReferenceConfig(): readonly Record<string, any>[];
3868
+ get concreteNumbering(): readonly ConcreteNumbering[];
3869
+ get referenceConfig(): readonly Record<string, any>[];
3879
3870
  }
3880
3871
  //#endregion
3881
3872
  //#region src/file/numbering/abstract-numbering.d.ts
@@ -4069,19 +4060,17 @@ declare class CoreProperties extends XmlComponent {
4069
4060
  //#region src/file/endnotes-wrapper.d.ts
4070
4061
  declare class EndnotesWrapper implements ViewWrapper {
4071
4062
  private readonly endnotes;
4072
- private readonly relationships;
4063
+ readonly relationships: Relationships;
4073
4064
  constructor();
4074
- get View(): Endnotes;
4075
- get Relationships(): Relationships;
4065
+ get view(): Endnotes;
4076
4066
  }
4077
4067
  //#endregion
4078
4068
  //#region src/file/footnotes-wrapper.d.ts
4079
4069
  declare class FootnotesWrapper implements ViewWrapper {
4080
- private readonly footnotess;
4081
- private readonly relationships;
4070
+ private readonly footnotes;
4071
+ readonly relationships: Relationships;
4082
4072
  constructor();
4083
- get View(): FootNotes;
4084
- get Relationships(): Relationships;
4073
+ get view(): FootNotes;
4085
4074
  }
4086
4075
  //#endregion
4087
4076
  //#region src/file/header.d.ts
@@ -4113,28 +4102,28 @@ interface SectionOptions {
4113
4102
  readonly children: readonly SectionChild[];
4114
4103
  }
4115
4104
  declare class File {
4116
- private currentRelationshipId;
4117
- private readonly documentWrapper;
4118
- private readonly headers;
4119
- private readonly footers;
4120
- private readonly coreProperties;
4121
- private readonly numbering;
4122
- private readonly media;
4123
- private readonly charts;
4124
- private readonly smartArts;
4125
- private readonly altChunks;
4126
- private readonly subDocs;
4127
- private readonly fileRelationships;
4128
- private readonly footnotesWrapper;
4129
- private readonly endnotesWrapper;
4130
- private readonly settings;
4131
- private readonly contentTypes;
4132
- private readonly customProperties;
4133
- private readonly appProperties;
4134
- private readonly styles;
4135
- private readonly comments;
4136
- private readonly bibliography;
4137
- private readonly fontWrapper;
4105
+ private _currentRelationshipId;
4106
+ readonly document: DocumentWrapper;
4107
+ private readonly _headers;
4108
+ private readonly _footers;
4109
+ readonly coreProperties: CoreProperties;
4110
+ readonly numbering: Numbering;
4111
+ readonly media: Media;
4112
+ readonly charts: ChartCollection;
4113
+ readonly smartArts: SmartArtCollection;
4114
+ readonly altChunks: AltChunkCollection;
4115
+ readonly subDocs: SubDocCollection;
4116
+ readonly fileRelationships: Relationships;
4117
+ readonly footNotes: FootnotesWrapper;
4118
+ readonly endnotes: EndnotesWrapper;
4119
+ readonly settings: Settings;
4120
+ readonly contentTypes: ContentTypes;
4121
+ readonly customProperties: CustomProperties;
4122
+ readonly appProperties: AppProperties;
4123
+ readonly styles: Styles;
4124
+ readonly comments: Comments;
4125
+ readonly bibliography: Bibliography | undefined;
4126
+ readonly fontTable: FontWrapper;
4138
4127
  constructor(options: PropertiesOptions);
4139
4128
  private addSection;
4140
4129
  private createHeader;
@@ -4142,27 +4131,8 @@ declare class File {
4142
4131
  private addHeaderToDocument;
4143
4132
  private addFooterToDocument;
4144
4133
  private addDefaultRelationships;
4145
- get Document(): DocumentWrapper;
4146
- get Styles(): Styles;
4147
- get CoreProperties(): CoreProperties;
4148
- get Numbering(): Numbering;
4149
- get Media(): Media;
4150
- get Charts(): ChartCollection;
4151
- get SmartArts(): SmartArtCollection;
4152
- get AltChunks(): AltChunkCollection;
4153
- get SubDocs(): SubDocCollection;
4154
- get FileRelationships(): Relationships;
4155
- get Headers(): readonly HeaderWrapper[];
4156
- get Footers(): readonly FooterWrapper[];
4157
- get ContentTypes(): ContentTypes;
4158
- get CustomProperties(): CustomProperties;
4159
- get AppProperties(): AppProperties;
4160
- get FootNotes(): FootnotesWrapper;
4161
- get Endnotes(): EndnotesWrapper;
4162
- get Settings(): Settings;
4163
- get Comments(): Comments;
4164
- get Bibliography(): Bibliography | undefined;
4165
- get FontTable(): FontWrapper;
4134
+ get headers(): readonly HeaderWrapper[];
4135
+ get footers(): readonly FooterWrapper[];
4166
4136
  }
4167
4137
  //#endregion
4168
4138
  //#region src/file/xml-components/base.d.ts
@@ -4356,6 +4326,7 @@ interface DocxPartRefs {
4356
4326
  interface DocxDocument {
4357
4327
  doc: ParsedDocument;
4358
4328
  body: Element;
4329
+ background?: Element;
4359
4330
  styles?: Element;
4360
4331
  numbering?: Element;
4361
4332
  settings?: Element;