@docx-editor.dev/editor-api 2.23.0 → 2.25.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.
@@ -1,73 +1,6 @@
1
1
  import { AutomationHandle, AutomationSpan, AutomationOperation, AutomationValue, AutomationSpanRef, RevisionBatchResult, AutomationHost, AutomationCapabilities, AutomationPaginationOptions } from '@docx-editor.dev/core/automation';
2
2
  import { CollaborationModuleContribution } from '@docx-editor.dev/core/collaboration';
3
3
 
4
- /** Locations used by Office-shaped insertion calls. Each call validates its allowed subset. @public */
5
- declare enum InsertLocation {
6
- replace = "Replace",
7
- start = "Start",
8
- end = "End",
9
- before = "Before",
10
- after = "After"
11
- }
12
- /** Paragraph alignment vocabulary. Mixed and unknown are read states, not authoring modes. @public */
13
- declare enum Alignment {
14
- mixed = "Mixed",
15
- unknown = "Unknown",
16
- left = "Left",
17
- centered = "Centered",
18
- right = "Right",
19
- justified = "Justified"
20
- }
21
- /** Physical page orientation. @public */
22
- declare enum PageOrientation {
23
- portrait = "Portrait",
24
- landscape = "Landscape"
25
- }
26
- /** Tracking policy vocabulary. Unsupported policies fail explicitly at sync. @public */
27
- declare enum ChangeTrackingMode {
28
- off = "Off",
29
- trackAll = "TrackAll",
30
- trackMineOnly = "TrackMineOnly"
31
- }
32
- /** Vertical placement of content within a table cell. Mixed cannot be authored. @public */
33
- declare enum VerticalAlignment {
34
- mixed = "Mixed",
35
- top = "Top",
36
- center = "Center",
37
- bottom = "Bottom"
38
- }
39
- /** Office break vocabulary; enum presence does not imply support for every break kind. @public */
40
- declare enum BreakType {
41
- line = "Line",
42
- page = "Page",
43
- next = "Next",
44
- sectionNext = "SectionNext",
45
- sectionContinuous = "SectionContinuous",
46
- sectionEven = "SectionEven",
47
- sectionOdd = "SectionOdd"
48
- }
49
- /** Content-control kinds, including the read subtypes that insertion does not accept. @public */
50
- declare enum ContentControlType {
51
- unknown = "Unknown",
52
- richText = "RichText",
53
- plainText = "PlainText",
54
- picture = "Picture",
55
- buildingBlockGallery = "BuildingBlockGallery",
56
- checkBox = "CheckBox",
57
- comboBox = "ComboBox",
58
- datePicker = "DatePicker",
59
- dropDownList = "DropDownList",
60
- group = "Group",
61
- repeatingSection = "RepeatingSection",
62
- plainTextInline = "PlainTextInline",
63
- plainTextParagraph = "PlainTextParagraph",
64
- richTextInline = "RichTextInline",
65
- richTextParagraphs = "RichTextParagraphs",
66
- richTextTable = "RichTextTable",
67
- richTextTableCell = "RichTextTableCell",
68
- richTextTableRow = "RichTextTableRow"
69
- }
70
-
71
4
  /**
72
5
  * What the host is told to look at.
73
6
  *
@@ -196,6 +129,67 @@ declare class ActionQueue {
196
129
  clear(): void;
197
130
  }
198
131
 
132
+ declare abstract class ModelObject extends ClientObject {
133
+ /** Runtime-wide revision view behind standard Office-compatible text reads and searches. */
134
+ protected revisionTextView(): 'allMarkup' | 'original';
135
+ /** Queue a read whose text answer becomes the loaded property `name`. */
136
+ protected loadTextInto(name: string, plan: () => AutomationOperation): void;
137
+ /** Queue a command with nothing to answer. Nothing is written until `sync()`. */
138
+ protected command(name: string, plan: () => AutomationOperation, dispose?: () => void): void;
139
+ /**
140
+ * Queue a command whose answer this call has no use for.
141
+ *
142
+ * `clear()` is the case: the operation behind it is a replacement, and a replacement answers the
143
+ * range it wrote — a range over no text, here. The answer is dropped rather than checked for a
144
+ * shape the method does not return, so that the operation stays the same one an insertion uses.
145
+ */
146
+ protected commandDiscarding(name: string, plan: () => AutomationOperation): void;
147
+ /** Queue a command whose answer names something the caller keeps. */
148
+ protected commandAnswering(label: string, plan: () => AutomationOperation, settle: (value: AutomationValue) => void, dispose?: () => void): void;
149
+ /** Queue a read whose answer is hydrated by the caller. */
150
+ protected read(label: string, plan: () => AutomationOperation, settle: (value: AutomationValue) => void): void;
151
+ /** The properties a load asked for, refusing any name this object does not have. */
152
+ protected selection(request: ResolvedLoadOptions, available: readonly string[]): readonly string[];
153
+ /** @internal Plan the read this object's `load(...)` asked for. */
154
+ protected onLoad(request: ResolvedLoadOptions): void;
155
+ }
156
+
157
+ /**
158
+ * Core document properties. Load explicit names before reads; assignments commit at sync.
159
+ * Values are XML-safe strings of at most 4096 characters. Tracked writes are unsupported.
160
+ * Individual dates and custom properties are unsupported. Document.removeDocumentInformation can remove property parts.
161
+ * Collaborative writes require an existing core-properties part.
162
+ * Create properties before joining collaboration when the input omits that part.
163
+ * @public
164
+ */
165
+ declare class DocumentProperties extends ModelObject {
166
+ #private;
167
+ /** @internal */
168
+ static of(context: RequestContext, owner: ObjectPath): DocumentProperties;
169
+ private constructor();
170
+ /** Last saved author, from cp:lastModifiedBy. Load before reading. */
171
+ get lastAuthor(): string;
172
+ /** Document author metadata, separate from the revision author. Load before reading; assign before sync. */
173
+ get author(): string;
174
+ set author(value: string);
175
+ /** Document title metadata. Load before reading; assign before sync. */
176
+ get title(): string;
177
+ set title(value: string);
178
+ /** Document subject metadata. Load before reading; assign before sync. */
179
+ get subject(): string;
180
+ set subject(value: string);
181
+ /** Document search keywords. Load before reading; assign before sync. */
182
+ get keywords(): string;
183
+ set keywords(value: string);
184
+ /** Document description metadata, separate from review comments. Load before reading; assign before sync. */
185
+ get comments(): string;
186
+ set comments(value: string);
187
+ /** Document category metadata. Load before reading; assign before sync. */
188
+ get category(): string;
189
+ set category(value: string);
190
+ protected onLoad(request: ResolvedLoadOptions): void;
191
+ }
192
+
199
193
  /** What a promised member is told once the read that looked for it has answered. */
200
194
  interface PromisedItem {
201
195
  /** @internal The member was there, at this address. */
@@ -251,29 +245,94 @@ declare abstract class HandleCollection<T extends ClientObject & PromisedItem> e
251
245
  protected addressAt(value: AutomationValue, label: string, index: number): ObjectAddress | undefined;
252
246
  }
253
247
 
254
- declare abstract class ModelObject extends ClientObject {
255
- /** Runtime-wide revision view behind standard Office-compatible text reads and searches. */
256
- protected revisionTextView(): 'allMarkup' | 'original';
257
- /** Queue a read whose text answer becomes the loaded property `name`. */
258
- protected loadTextInto(name: string, plan: () => AutomationOperation): void;
259
- /** Queue a command with nothing to answer. Nothing is written until `sync()`. */
260
- protected command(name: string, plan: () => AutomationOperation, dispose?: () => void): void;
261
- /**
262
- * Queue a command whose answer this call has no use for.
263
- *
264
- * `clear()` is the case: the operation behind it is a replacement, and a replacement answers the
265
- * range it wrote — a range over no text, here. The answer is dropped rather than checked for a
266
- * shape the method does not return, so that the operation stays the same one an insertion uses.
267
- */
268
- protected commandDiscarding(name: string, plan: () => AutomationOperation): void;
269
- /** Queue a command whose answer names something the caller keeps. */
270
- protected commandAnswering(label: string, plan: () => AutomationOperation, settle: (value: AutomationValue) => void, dispose?: () => void): void;
271
- /** Queue a read whose answer is hydrated by the caller. */
272
- protected read(label: string, plan: () => AutomationOperation, settle: (value: AutomationValue) => void): void;
273
- /** The properties a load asked for, refusing any name this object does not have. */
274
- protected selection(request: ResolvedLoadOptions, available: readonly string[]): readonly string[];
275
- /** @internal Plan the read this object's `load(...)` asked for. */
276
- protected onLoad(request: ResolvedLoadOptions): void;
248
+ /** Locations used by Office-shaped insertion calls. Each call validates its allowed subset. @public */
249
+ declare enum InsertLocation {
250
+ replace = "Replace",
251
+ start = "Start",
252
+ end = "End",
253
+ before = "Before",
254
+ after = "After"
255
+ }
256
+ /** Paragraph alignment vocabulary. Mixed and unknown are read states, not authoring modes. @public */
257
+ declare enum Alignment {
258
+ mixed = "Mixed",
259
+ unknown = "Unknown",
260
+ left = "Left",
261
+ centered = "Centered",
262
+ right = "Right",
263
+ justified = "Justified"
264
+ }
265
+ /** Physical page orientation. @public */
266
+ declare enum PageOrientation {
267
+ portrait = "Portrait",
268
+ landscape = "Landscape"
269
+ }
270
+ /** Tracking policy vocabulary. Unsupported policies fail explicitly at sync. @public */
271
+ declare enum ChangeTrackingMode {
272
+ off = "Off",
273
+ trackAll = "TrackAll",
274
+ trackMineOnly = "TrackMineOnly"
275
+ }
276
+ /** Vertical placement of content within a table cell. Mixed cannot be authored. @public */
277
+ declare enum VerticalAlignment {
278
+ mixed = "Mixed",
279
+ top = "Top",
280
+ center = "Center",
281
+ bottom = "Bottom"
282
+ }
283
+ /** Office break vocabulary; enum presence does not imply support for every break kind. @public */
284
+ declare enum BreakType {
285
+ line = "Line",
286
+ page = "Page",
287
+ next = "Next",
288
+ sectionNext = "SectionNext",
289
+ sectionContinuous = "SectionContinuous",
290
+ sectionEven = "SectionEven",
291
+ sectionOdd = "SectionOdd"
292
+ }
293
+ /** Content-control kinds, including the read subtypes that insertion does not accept. @public */
294
+ declare enum ContentControlType {
295
+ unknown = "Unknown",
296
+ richText = "RichText",
297
+ plainText = "PlainText",
298
+ picture = "Picture",
299
+ buildingBlockGallery = "BuildingBlockGallery",
300
+ checkBox = "CheckBox",
301
+ comboBox = "ComboBox",
302
+ datePicker = "DatePicker",
303
+ dropDownList = "DropDownList",
304
+ group = "Group",
305
+ repeatingSection = "RepeatingSection",
306
+ plainTextInline = "PlainTextInline",
307
+ plainTextParagraph = "PlainTextParagraph",
308
+ richTextInline = "RichTextInline",
309
+ richTextParagraphs = "RichTextParagraphs",
310
+ richTextTable = "RichTextTable",
311
+ richTextTableCell = "RichTextTableCell",
312
+ richTextTableRow = "RichTextTableRow"
313
+ }
314
+ /** Document information categories. Only DocumentProperties removal is supported. @public */
315
+ declare enum RemoveDocInfoType {
316
+ all = "All",
317
+ atMentions = "AtMentions",
318
+ commentReactions = "CommentReactions",
319
+ comments = "Comments",
320
+ contentType = "ContentType",
321
+ documentIntelligence = "DocumentIntelligence",
322
+ documentManagementPolicy = "DocumentManagementPolicy",
323
+ documentProperties = "DocumentProperties",
324
+ documentServerProperties = "DocumentServerProperties",
325
+ documentTasks = "DocumentTasks",
326
+ documentWorkspace = "DocumentWorkspace",
327
+ emailHeader = "EmailHeader",
328
+ inkAnnotations = "InkAnnotations",
329
+ removePersonalInformation = "RemovePersonalInformation",
330
+ revisions = "Revisions",
331
+ routingSlip = "RoutingSlip",
332
+ sendForReview = "SendForReview",
333
+ taskpaneWebExtensions = "TaskpaneWebExtensions",
334
+ template = "Template",
335
+ versions = "Versions"
277
336
  }
278
337
 
279
338
  /** Supported Word bullet styles. @public */
@@ -492,6 +551,43 @@ declare class Font extends ModelObject {
492
551
  protected onLoad(request: ResolvedLoadOptions): void;
493
552
  }
494
553
 
554
+ /** An inert Word field. Code writes and evaluation support PAGE and NUMPAGES. @public */
555
+ declare class Field extends ModelObject implements PromisedItem {
556
+ #private;
557
+ /** @internal */
558
+ static at(context: RequestContext, label: string, address: ObjectAddress): Field;
559
+ /** @internal */
560
+ static promised(context: RequestContext, label: string, nullable: boolean): Field;
561
+ private constructor();
562
+ /** @internal */
563
+ hydrateAddress(address: ObjectAddress): void;
564
+ /** @internal */
565
+ hydrateNull(): void;
566
+ get code(): string;
567
+ set code(value: string);
568
+ /** Remove this field, including its cached result. Other fields remain inert and unchanged. */
569
+ delete(): void;
570
+ /** Compute a cached result using actual host pagination. Missing pagination refuses explicitly. */
571
+ updateResult(): void;
572
+ protected onLoad(request: ResolvedLoadOptions): void;
573
+ }
574
+ /** Fields contained within a body or range. @public */
575
+ declare class FieldCollection extends ItemCollection<Field> {
576
+ #private;
577
+ /** @internal */
578
+ static of(context: RequestContext, label: string, owner: ObjectPath, kind: SpanOwner): FieldCollection;
579
+ private constructor();
580
+ getFirst(): Field;
581
+ getLast(): Field;
582
+ getFirstOrNullObject(): Field;
583
+ getLastOrNullObject(): Field;
584
+ protected listing(): AutomationOperation;
585
+ protected size(value: AutomationValue, label: string): number;
586
+ protected addressAt(value: AutomationValue, label: string, index: number): ObjectAddress | undefined;
587
+ protected itemAt(label: string, address: ObjectAddress): Field;
588
+ protected promised(label: string, nullable: boolean): Field & PromisedItem;
589
+ }
590
+
495
591
  /** Office field types. This runtime authors Page, NumPages, and Empty with a supported code. @public */
496
592
  declare enum FieldType {
497
593
  addin = "Addin",
@@ -641,7 +737,10 @@ declare class Table extends ModelObject implements PromisedItem {
641
737
  hydrateAddress(address: ObjectAddress): void;
642
738
  /** @internal */
643
739
  hydrateNull(): void;
644
- /** Cell text by row. A write replaces the whole rectangular matrix; rich cell content refuses. */
740
+ /**
741
+ * Cell text by row. Writes require the current dimensions and ordinary cell text.
742
+ * TrackMineOnly records text revisions outside collaboration; collaborative tracked writes refuse.
743
+ */
645
744
  get values(): string[][];
646
745
  set values(value: string[][]);
647
746
  /** Table style display name. Writes must name an existing table style in the document. */
@@ -658,11 +757,18 @@ declare class Table extends ModelObject implements PromisedItem {
658
757
  get rows(): TableRowCollection;
659
758
  /** Address a cell by zero-based row and column. Read-derived operations may share its next sync. */
660
759
  getCell(rowIndex: number, cellIndex: number): TableCell;
661
- /** Add rows at an edge. Sync before configuring the returned rows; omitted values create empty cells. */
760
+ /**
761
+ * Add rows at an edge. Sync before configuring the returned rows; omitted values create empty cells.
762
+ * Ordinary edge rows can belong to a table with unrelated merged headers.
763
+ * TrackMineOnly records native row insertion revisions, including supplied initial values.
764
+ */
662
765
  addRows(insertLocation: InsertLocation.start | InsertLocation.end | 'Start' | 'End', rowCount: number, values?: string[][]): TableRowCollection;
663
766
  /** Add columns at an edge. Values are row-major; new columns initially copy the nearest edge width. */
664
767
  addColumns(insertLocation: InsertLocation.start | InsertLocation.end | 'Start' | 'End', columnCount: number, values?: string[][]): void;
665
- /** Delete consecutive rows from a zero-based index. Defaults to one row. */
768
+ /**
769
+ * Delete consecutive rows from a zero-based index. Defaults to one row.
770
+ * Tracking requires one row without a pending deletion to remain and refuses pending row or cell structure revisions.
771
+ */
666
772
  deleteRows(rowIndex: number, rowCount?: number): void;
667
773
  /** Delete consecutive columns from a zero-based index. Defaults to one column. */
668
774
  deleteColumns(columnIndex: number, columnCount?: number): void;
@@ -682,6 +788,12 @@ declare class TableRow extends ModelObject implements PromisedItem {
682
788
  hydrateAddress(address: ObjectAddress): void;
683
789
  /** @internal */
684
790
  hydrateNull(): void;
791
+ /**
792
+ * Insert ordinary rows before or after this row. Sync before using the returned rows.
793
+ * Unrelated merged headers remain unchanged. Merged source rows and crossing merges refuse.
794
+ * TrackMineOnly records native row insertion revisions, including initial values.
795
+ */
796
+ insertRows(insertLocation: InsertLocation.before | InsertLocation.after | 'Before' | 'After', rowCount: number, values?: string[][]): TableRowCollection;
685
797
  /** Stable cell collection for this row. Load `items` and sync before reading. */
686
798
  get cells(): TableCellCollection;
687
799
  }
@@ -699,7 +811,10 @@ declare class TableCell extends ModelObject implements PromisedItem {
699
811
  hydrateNull(): void;
700
812
  /** A body scoped to this cell for text, ranges, formatting, and nested table navigation. */
701
813
  get body(): Body;
702
- /** Plain cell text. Replacing complex content refuses; use the scoped body for targeted edits. */
814
+ /**
815
+ * Plain cell text. Replacing complex content refuses; use the scoped body for targeted edits.
816
+ * TrackMineOnly records text revisions outside collaboration; collaborative tracked writes refuse.
817
+ */
703
818
  get value(): string;
704
819
  set value(value: string);
705
820
  /** Width in points. A write affects the whole grid column, not only this cell. */
@@ -965,6 +1080,7 @@ declare class ContentControl extends ModelObject implements PromisedItem {
965
1080
  setValue(value: ContentControlValue): void;
966
1081
  /**
967
1082
  * Put text into the control: over what it holds, or at one end of it.
1083
+ * Supports text-like controls. Date, checkbox, and other typed controls refuse with NotSupported.
968
1084
  *
969
1085
  * `Replace` goes through the control's own value path, so the prompt it was showing and a
970
1086
  * `w:temporary` wrapper are dealt with there rather than a second time here. The range comes
@@ -1388,8 +1504,9 @@ declare class Range extends ModelObject implements PromisedItem {
1388
1504
  * Await `context.sync()` before loading or addressing that returned range.
1389
1505
  *
1390
1506
  * With server `document.changeTrackingMode = 'TrackMineOnly'`, this creates a tracked text
1391
- * edit attributed to the runtime author. Tracked edits must stay within one paragraph and
1392
- * cannot touch pending revisions. Structural and formatting tracking are not supported.
1507
+ * edit attributed to the runtime author. Tracked range replacement supports adjacent sibling paragraphs outside collaboration.
1508
+ * Table and wrapper boundaries and foreign pending revisions refuse. Font and paragraph
1509
+ * formatting support property revisions.
1393
1510
  * Empty text with `Replace` deletes the range; empty text at an insertion point is a no-op.
1394
1511
  * Agent tools that intend a replacement should validate non-empty model output first.
1395
1512
  *
@@ -1399,7 +1516,7 @@ declare class Range extends ModelObject implements PromisedItem {
1399
1516
  * gets back is a range naming the text that was written, in every case.
1400
1517
  */
1401
1518
  insertText(text: string, insertLocation: InsertLocation | 'Replace' | 'Start' | 'End' | 'Before' | 'After'): Range;
1402
- /** Delete this range's content. TrackMineOnly preserves inline text as a pending deletion. */
1519
+ /** Delete range content. Tracking supports adjacent sibling paragraphs outside collaboration. */
1403
1520
  delete(): void;
1404
1521
  /** Clear this range's content, preserving the surrounding structure. */
1405
1522
  clear(): void;
@@ -1412,15 +1529,25 @@ declare class Range extends ModelObject implements PromisedItem {
1412
1529
  */
1413
1530
  insertComment(commentText: string): Comment;
1414
1531
  /**
1415
- * Wrap this single-paragraph range in a rich-text or plain-text content control.
1532
+ * Wrap this single-paragraph range in a rich-text, plain-text, or date-picker content control.
1416
1533
  * Await sync before configuring the returned control. Other types explicitly refuse.
1534
+ * TrackMineOnly supports nonempty ordinary text outside collaboration.
1535
+ * Existing revisions and empty tracked ranges refuse with NotSupported.
1417
1536
  */
1418
1537
  insertContentControl(contentControlType?: ContentControlType.richText | ContentControlType.plainText | ContentControlType.buildingBlockGallery | ContentControlType.checkBox | ContentControlType.comboBox | ContentControlType.datePicker | ContentControlType.dropDownList | ContentControlType.group | ContentControlType.picture | ContentControlType.repeatingSection | 'RichText' | 'PlainText' | 'BuildingBlockGallery' | 'CheckBox' | 'ComboBox' | 'DatePicker' | 'DropDownList' | 'Group' | 'Picture' | 'RepeatingSection'): ContentControl;
1419
1538
  /** Tables contained by this range, in document order. */
1420
1539
  get tables(): TableCollection;
1421
1540
  /** Fields fully contained within this range. */
1422
1541
  get fields(): FieldCollection;
1542
+ /**
1543
+ * Insert PAGE, NUMPAGES, or an inert TOC field with supported switches.
1544
+ * TOC entries are not calculated. Tracked field insertion refuses.
1545
+ */
1423
1546
  insertField(insertLocation: InsertLocation | 'Before' | 'After' | 'Start' | 'End' | 'Replace', fieldType?: FieldType, text?: string, removeFormatting?: boolean): Field;
1547
+ /**
1548
+ * Insert PAGE, NUMPAGES, or an inert TOC field with supported switches.
1549
+ * TOC entries are not calculated. Tracked field insertion refuses.
1550
+ */
1424
1551
  insertField(insertLocation: InsertLocation | 'Before' | 'After' | 'Start' | 'End' | 'Replace', fieldType?: FieldTypeLiteral, text?: string, removeFormatting?: boolean): Field;
1425
1552
  /** Inline pictures fully contained within this snapshot range. */
1426
1553
  get inlinePictures(): InlinePictureCollection;
@@ -1428,7 +1555,11 @@ declare class Range extends ModelObject implements PromisedItem {
1428
1555
  insertInlinePictureFromBase64(base64EncodedImage: string, insertLocation: InsertLocation | 'Before' | 'After' | 'Start' | 'End' | 'Replace'): InlinePicture;
1429
1556
  /** Page and next-page section breaks are supported; other break types refuse at sync. */
1430
1557
  insertBreak(breakType: BreakType | 'Page' | 'SectionNext' | 'Next' | 'Line' | 'SectionContinuous' | 'SectionEven' | 'SectionOdd', insertLocation: InsertLocation.before | InsertLocation.after | 'Before' | 'After'): void;
1431
- /** Insert a rectangular table before or after this range. */
1558
+ /**
1559
+ * Insert a rectangular table before or after this range.
1560
+ * TrackMineOnly records native row/cell insertions, including initial values.
1561
+ * Sync before configuring the returned table. Nested table authoring refuses.
1562
+ */
1432
1563
  insertTable(rowCount: number, columnCount: number, insertLocation: InsertLocation.before | InsertLocation.after | 'Before' | 'After', values?: string[][]): Table;
1433
1564
  /** Add a paragraph before or after the one this range starts or ends in. */
1434
1565
  insertParagraph(paragraphText: string, insertLocation: InsertLocation.before | InsertLocation.after | 'Before' | 'After'): Paragraph;
@@ -1649,80 +1780,6 @@ declare class RangeCollection extends ItemCollection<Range> {
1649
1780
  protected promised(label: string, nullable: boolean): Range & PromisedItem;
1650
1781
  }
1651
1782
 
1652
- /** Which kind of note: Word's own two. */
1653
- type NoteItemType = 'Footnote' | 'Endnote';
1654
- /**
1655
- * One footnote or endnote: text that belongs to the document but not to its flow.
1656
- *
1657
- * A note IS a story. Its {@link NoteItem.body} is an ordinary {@link Body} — paragraphs,
1658
- * formatting, styles, the same operations — laid out at the foot of a page or the end of the
1659
- * document rather than in the column, so everything the object model can do to the main story it
1660
- * can do to a note without a second vocabulary.
1661
- *
1662
- * `delete()` removes the reference too. A note's body and the citation that reached it are one
1663
- * thing to a reader, and deleting the body alone would leave a mark pointing at nothing. The
1664
- * engine spells that as a package-level transaction, which is why it travels alone in its batch.
1665
- *
1666
- * @public
1667
- */
1668
- declare class NoteItem extends ModelObject implements PromisedItem {
1669
- #private;
1670
- /** @internal A note a read has already named. */
1671
- static at(context: RequestContext, label: string, address: ObjectAddress): NoteItem;
1672
- /** @internal A note a queued read will name, or report as nothing. */
1673
- static promised(context: RequestContext, label: string, nullable: boolean): NoteItem;
1674
- private constructor();
1675
- /** @internal Bind this object to the address the owning read answered. */
1676
- hydrateAddress(address: ObjectAddress): void;
1677
- /** @internal Settle as the null object: the read found nothing to name. */
1678
- hydrateNull(): void;
1679
- /** Whether this is a footnote or an endnote. */
1680
- get type(): NoteItemType;
1681
- /**
1682
- * The note's plain text.
1683
- *
1684
- * This is the same value as loading `text` from {@link NoteItem.body}: every paragraph in the
1685
- * note story, in reading order, joined by one carriage return per paragraph mark. Load it
1686
- * directly when structured traversal or editing through {@link NoteItem.body} is not needed.
1687
- */
1688
- get text(): string;
1689
- /** The note's own story. */
1690
- get body(): Body;
1691
- /**
1692
- * Remove the note and every reference to it.
1693
- *
1694
- * A package transaction, so it is the ONLY operation its `sync()` may carry — the host refuses it
1695
- * any company rather than committing half a batch. Two syncs get a delete and anything else.
1696
- */
1697
- delete(): void;
1698
- /** The next note of the same kind. `ItemNotFound` at the sync when this is the last one. */
1699
- getNext(): NoteItem;
1700
- /** @internal Plan the read this object's `load(...)` asked for. */
1701
- protected onLoad(request: ResolvedLoadOptions): void;
1702
- }
1703
- /**
1704
- * The notes of one kind, in the order the notes part writes them.
1705
- *
1706
- * DocxEditor's own collection type: the pinned reference fixture does not carry
1707
- * `Word.NoteItemCollection`, so it is not measured for conformance — recorded as an omission in
1708
- * `compat/manifest.json` — while `NoteItem` itself is. Without it a note would be unreachable, which
1709
- * is the one thing worse than an unmeasured collection.
1710
- */
1711
- declare class NoteItemCollection extends HandleCollection<NoteItem> {
1712
- #private;
1713
- /** @internal A collection a named read will answer. */
1714
- static of(context: RequestContext, label: string, owner: ObjectPath, plan: () => AutomationOperation): NoteItemCollection;
1715
- private constructor();
1716
- /** The first note. `ItemNotFound` at the sync if the document has none of this kind. */
1717
- getFirst(): NoteItem;
1718
- /** @internal The read that answers this collection's members. */
1719
- protected listing(): AutomationOperation;
1720
- /** @internal Build one member from an address the listing answered. */
1721
- protected itemAt(label: string, address: ObjectAddress): NoteItem;
1722
- /** @internal A member an edge accessor named before the sync that finds it. */
1723
- protected promised(label: string, nullable: boolean): NoteItem & PromisedItem;
1724
- }
1725
-
1726
1783
  /** Which header or footer of a section: Word's own three variants. */
1727
1784
  type HeaderFooterType = 'Primary' | 'FirstPage' | 'EvenPages';
1728
1785
  /**
@@ -1883,6 +1940,15 @@ declare class Document extends ModelObject {
1883
1940
  * back a fresh proxy per access would put the load on one and the read on another.
1884
1941
  */
1885
1942
  get body(): Body;
1943
+ /**
1944
+ * Remove standard core, extended, and custom document-property parts in one sync.
1945
+ * Only DocumentProperties is supported. Tracking and collaboration refuse with NotSupported.
1946
+ * This command must be the only write in its sync. It does not anonymize document content.
1947
+ */
1948
+ removeDocumentInformation(removeDocInfoType: RemoveDocInfoType): void;
1949
+ removeDocumentInformation(removeDocInfoType: 'Comments' | 'Revisions' | 'Versions' | 'RemovePersonalInformation' | 'EmailHeader' | 'RoutingSlip' | 'SendForReview' | 'DocumentProperties' | 'Template' | 'DocumentWorkspace' | 'InkAnnotations' | 'DocumentServerProperties' | 'DocumentManagementPolicy' | 'ContentType' | 'TaskpaneWebExtensions' | 'AtMentions' | 'DocumentTasks' | 'DocumentIntelligence' | 'CommentReactions' | 'All'): void;
1950
+ /** Core document metadata. Reads require load; writes commit at sync. */
1951
+ get properties(): DocumentProperties;
1886
1952
  /** The main story's paragraphs, in reading order. */
1887
1953
  get paragraphs(): ParagraphCollection;
1888
1954
  /** The document's sections, in document order. */
@@ -1903,9 +1969,7 @@ declare class Document extends ModelObject {
1903
1969
  /**
1904
1970
  * The document's footnotes, in the order its notes part writes them.
1905
1971
  *
1906
- * DocxEditor's own accessor: upstream reaches notes through `Body#footnotes`, whose collection type
1907
- * the pinned reference fixture does not carry — see `compat/manifest.json`. Without an accessor a
1908
- * note would be unreachable, so it is published here and recorded as unmeasured.
1972
+ * Legacy document-wide accessor. Prefer the Office.js-shaped `body.footnotes` accessor.
1909
1973
  */
1910
1974
  get footnotes(): NoteItemCollection;
1911
1975
  /** The document's endnotes, in the order its notes part writes them. */
@@ -2378,41 +2442,78 @@ declare class DocxEditorError extends Error {
2378
2442
  */
2379
2443
  declare function isDocxEditorError(value: unknown): value is DocxEditorError;
2380
2444
 
2381
- /** An inert Word field. Code writes and evaluation support PAGE and NUMPAGES. @public */
2382
- declare class Field extends ModelObject implements PromisedItem {
2445
+ /** Which kind of note: Word's own two. */
2446
+ type NoteItemType = 'Footnote' | 'Endnote';
2447
+ /**
2448
+ * One footnote or endnote: text that belongs to the document but not to its flow.
2449
+ *
2450
+ * A note IS a story. Its {@link NoteItem.body} is an ordinary {@link Body} — paragraphs,
2451
+ * formatting, styles, the same operations — laid out at the foot of a page or the end of the
2452
+ * document rather than in the column, so everything the object model can do to the main story it
2453
+ * can do to a note without a second vocabulary.
2454
+ *
2455
+ * `delete()` removes the reference too. A note's body and the citation that reached it are one
2456
+ * thing to a reader, and deleting the body alone would leave a mark pointing at nothing. The
2457
+ * engine spells that as a package-level transaction, which is why it travels alone in its batch.
2458
+ *
2459
+ * @public
2460
+ */
2461
+ declare class NoteItem extends ModelObject implements PromisedItem {
2383
2462
  #private;
2384
- /** @internal */
2385
- static at(context: RequestContext, label: string, address: ObjectAddress): Field;
2386
- /** @internal */
2387
- static promised(context: RequestContext, label: string, nullable: boolean): Field;
2463
+ /** @internal A note a read has already named. */
2464
+ static at(context: RequestContext, label: string, address: ObjectAddress): NoteItem;
2465
+ /** @internal A note a queued read will name, or report as nothing. */
2466
+ static promised(context: RequestContext, label: string, nullable: boolean): NoteItem;
2388
2467
  private constructor();
2389
- /** @internal */
2468
+ /** @internal Bind this object to the address the owning read answered. */
2390
2469
  hydrateAddress(address: ObjectAddress): void;
2391
- /** @internal */
2470
+ /** @internal Settle as the null object: the read found nothing to name. */
2392
2471
  hydrateNull(): void;
2393
- get code(): string;
2394
- set code(value: string);
2395
- /** Remove this field, including its cached result. Other fields remain inert and unchanged. */
2472
+ /** Whether this is a footnote or an endnote. */
2473
+ get type(): NoteItemType;
2474
+ /**
2475
+ * The note's plain text.
2476
+ *
2477
+ * This is the same value as loading `text` from {@link NoteItem.body}: every paragraph in the
2478
+ * note story, in reading order, joined by one carriage return per paragraph mark. Load it
2479
+ * directly when structured traversal or editing through {@link NoteItem.body} is not needed.
2480
+ */
2481
+ get text(): string;
2482
+ /** The note's own story. */
2483
+ get body(): Body;
2484
+ /**
2485
+ * Remove the note and every reference to it.
2486
+ *
2487
+ * A package transaction, so it is the ONLY operation its `sync()` may carry — the host refuses it
2488
+ * any company rather than committing half a batch. Two syncs get a delete and anything else.
2489
+ */
2396
2490
  delete(): void;
2397
- /** Compute a cached result using actual host pagination. Missing pagination refuses explicitly. */
2398
- updateResult(): void;
2491
+ /** The next note of the same kind. `ItemNotFound` at the sync when this is the last one. */
2492
+ getNext(): NoteItem;
2493
+ /** @internal Plan the read this object's `load(...)` asked for. */
2399
2494
  protected onLoad(request: ResolvedLoadOptions): void;
2400
2495
  }
2401
- /** Fields contained within a body or range. @public */
2402
- declare class FieldCollection extends ItemCollection<Field> {
2496
+ /**
2497
+ * The notes of one kind, in the order the notes part writes them.
2498
+ *
2499
+ * DocxEditor's own collection type: the pinned reference fixture does not carry
2500
+ * `Word.NoteItemCollection`, so it is not measured for conformance — recorded as an omission in
2501
+ * `compat/manifest.json` — while `NoteItem` itself is. Without it a note would be unreachable, which
2502
+ * is the one thing worse than an unmeasured collection.
2503
+ */
2504
+ declare class NoteItemCollection extends HandleCollection<NoteItem> {
2403
2505
  #private;
2404
- /** @internal */
2405
- static of(context: RequestContext, label: string, owner: ObjectPath, kind: SpanOwner): FieldCollection;
2506
+ /** @internal A collection a named read will answer. */
2507
+ static of(context: RequestContext, label: string, owner: ObjectPath, plan: () => AutomationOperation): NoteItemCollection;
2406
2508
  private constructor();
2407
- getFirst(): Field;
2408
- getLast(): Field;
2409
- getFirstOrNullObject(): Field;
2410
- getLastOrNullObject(): Field;
2509
+ /** The first note. `ItemNotFound` at the sync if the document has none of this kind. */
2510
+ getFirst(): NoteItem;
2511
+ /** @internal The read that answers this collection's members. */
2411
2512
  protected listing(): AutomationOperation;
2412
- protected size(value: AutomationValue, label: string): number;
2413
- protected addressAt(value: AutomationValue, label: string, index: number): ObjectAddress | undefined;
2414
- protected itemAt(label: string, address: ObjectAddress): Field;
2415
- protected promised(label: string, nullable: boolean): Field & PromisedItem;
2513
+ /** @internal Build one member from an address the listing answered. */
2514
+ protected itemAt(label: string, address: ObjectAddress): NoteItem;
2515
+ /** @internal A member an edge accessor named before the sync that finds it. */
2516
+ protected promised(label: string, nullable: boolean): NoteItem & PromisedItem;
2416
2517
  }
2417
2518
 
2418
2519
  /**
@@ -2433,6 +2534,10 @@ declare class FieldCollection extends ItemCollection<Field> {
2433
2534
  */
2434
2535
  declare class Body extends ModelObject {
2435
2536
  #private;
2537
+ /** Footnotes referenced within this body, in reference order. */
2538
+ get footnotes(): NoteItemCollection;
2539
+ /** Endnotes referenced within this body, in reference order. */
2540
+ get endnotes(): NoteItemCollection;
2436
2541
  /** @internal The main story of the document this context is running against. */
2437
2542
  static main(context: RequestContext, label: string): Body;
2438
2543
  /**
@@ -2614,4 +2719,5 @@ interface CreateServerOptions {
2614
2719
  /** Options for {@link createCollaborative}. @public */
2615
2720
  type CreateCollaborativeOptions = CreateServerOptions;
2616
2721
 
2617
- export { PageOrientation as $, Alignment as A, type BesideLocation as B, type CreateServerOptions as C, type DocxEditorServerRuntime as D, type DocxEditorErrorCode as E, type DocxEditorErrorInit as F, type DocxEditorRuntime as G, type EditorModule as H, Field as I, FieldCollection as J, FieldType as K, type FieldTypeLiteral as L, Font as M, type HeaderFooterType as N, InlinePicture as O, InlinePictureCollection as P, InsertLocation as Q, List as R, ListBullet as S, ListCollection as T, ListItem as U, ListNumbering as V, type LoadOption as W, type LoadQueryOptions as X, NoteItem as Y, NoteItemCollection as Z, type NoteItemType as _, type CreateCollaborativeOptions as a, PageSetup as a0, Paragraph as a1, type ParagraphAlignment as a2, ParagraphCollection as a3, type ParagraphInsertTextLocation as a4, Range as a5, RangeCollection as a6, type RangeInsertTextLocation as a7, RequestContext as a8, Revision as a9, RevisionCollection as aa, type RevisionTextView as ab, type RevisionType as ac, type RunCallback as ad, type SearchOptions as ae, Section as af, SectionCollection as ag, type SelectionMode as ah, type ServerPaginationOptions as ai, Table as aj, TableCell as ak, TableCellCollection as al, TableCollection as am, TableRow as an, TableRowCollection as ao, TrackedObjects as ap, UnderlineType as aq, VerticalAlignment as ar, isDocxEditorError as as, Body as b, type BodyInsertParagraphLocation as c, type BodyInsertTextLocation as d, Bookmark as e, BookmarkCollection as f, BreakType as g, ChangeTrackingMode as h, ClientObject as i, ClientResult as j, Comment as k, CommentCollection as l, CommentReply as m, CommentReplyCollection as n, ContentControl as o, ContentControlCollection as p, type ContentControlLockState as q, type ContentControlSubtype as r, ContentControlType as s, type ContentControlValue as t, Document as u, type DocumentCapabilities as v, type DocumentLimits as w, type DocumentXmlLimits as x, type DocumentZipLimits as y, DocxEditorError as z };
2722
+ export { Alignment as A, DocxEditorError as E, Field as J, FieldCollection as K, FieldType as L, Font as N, InlinePicture as P, InlinePictureCollection as Q, InsertLocation as R, List as S, ListBullet as T, ListCollection as U, ListItem as V, ListNumbering as W, NoteItem as Z, NoteItemCollection as _, PageOrientation as a0, PageSetup as a1, Paragraph as a2, ParagraphCollection as a4, Range as a6, RangeCollection as a7, RemoveDocInfoType as a9, RequestContext as aa, Revision as ab, RevisionCollection as ac, Section as ah, SectionCollection as ai, Table as al, TableCell as am, TableCellCollection as an, TableCollection as ao, TableRow as ap, TableRowCollection as aq, TrackedObjects as ar, UnderlineType as as, VerticalAlignment as at, isDocxEditorError as au, Body as b, Bookmark as e, BookmarkCollection as f, BreakType as g, ChangeTrackingMode as h, ClientObject as i, ClientResult as j, Comment as k, CommentCollection as l, CommentReply as m, CommentReplyCollection as n, ContentControl as o, ContentControlCollection as p, ContentControlType as s, Document as u, DocumentProperties as x };
2723
+ export type { NoteItemType as $, BesideLocation as B, CreateServerOptions as C, DocxEditorServerRuntime as D, DocxEditorErrorCode as F, DocxEditorErrorInit as G, DocxEditorRuntime as H, EditorModule as I, FieldTypeLiteral as M, HeaderFooterType as O, LoadOption as X, LoadQueryOptions as Y, CreateCollaborativeOptions as a, ParagraphAlignment as a3, ParagraphInsertTextLocation as a5, RangeInsertTextLocation as a8, RevisionTextView as ad, RevisionType as ae, RunCallback as af, SearchOptions as ag, SelectionMode as aj, ServerPaginationOptions as ak, BodyInsertParagraphLocation as c, BodyInsertTextLocation as d, ContentControlLockState as q, ContentControlSubtype as r, ContentControlValue as t, DocumentCapabilities as v, DocumentLimits as w, DocumentXmlLimits as y, DocumentZipLimits as z };