@docx-editor.dev/editor-api 2.24.0 → 2.26.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;
@@ -1498,6 +1629,8 @@ declare class Paragraph extends ModelObject implements PromisedItem {
1498
1629
  */
1499
1630
  get style(): string;
1500
1631
  set style(value: string);
1632
+ /** Floating and inline shapes in this paragraph, such as text boxes and pictures. */
1633
+ get shapes(): ShapeCollection;
1501
1634
  /** The character formatting of this paragraph's characters, and of its paragraph mark. */
1502
1635
  get font(): Font;
1503
1636
  /**
@@ -1883,6 +2016,15 @@ declare class Document extends ModelObject {
1883
2016
  * back a fresh proxy per access would put the load on one and the read on another.
1884
2017
  */
1885
2018
  get body(): Body;
2019
+ /**
2020
+ * Remove standard core, extended, and custom document-property parts in one sync.
2021
+ * Only DocumentProperties is supported. Tracking and collaboration refuse with NotSupported.
2022
+ * This command must be the only write in its sync. It does not anonymize document content.
2023
+ */
2024
+ removeDocumentInformation(removeDocInfoType: RemoveDocInfoType): void;
2025
+ removeDocumentInformation(removeDocInfoType: 'Comments' | 'Revisions' | 'Versions' | 'RemovePersonalInformation' | 'EmailHeader' | 'RoutingSlip' | 'SendForReview' | 'DocumentProperties' | 'Template' | 'DocumentWorkspace' | 'InkAnnotations' | 'DocumentServerProperties' | 'DocumentManagementPolicy' | 'ContentType' | 'TaskpaneWebExtensions' | 'AtMentions' | 'DocumentTasks' | 'DocumentIntelligence' | 'CommentReactions' | 'All'): void;
2026
+ /** Core document metadata. Reads require load; writes commit at sync. */
2027
+ get properties(): DocumentProperties;
1886
2028
  /** The main story's paragraphs, in reading order. */
1887
2029
  get paragraphs(): ParagraphCollection;
1888
2030
  /** The document's sections, in document order. */
@@ -1903,9 +2045,7 @@ declare class Document extends ModelObject {
1903
2045
  /**
1904
2046
  * The document's footnotes, in the order its notes part writes them.
1905
2047
  *
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.
2048
+ * Legacy document-wide accessor. Prefer the Office.js-shaped `body.footnotes` accessor.
1909
2049
  */
1910
2050
  get footnotes(): NoteItemCollection;
1911
2051
  /** The document's endnotes, in the order its notes part writes them. */
@@ -2378,41 +2518,75 @@ declare class DocxEditorError extends Error {
2378
2518
  */
2379
2519
  declare function isDocxEditorError(value: unknown): value is DocxEditorError;
2380
2520
 
2381
- /** An inert Word field. Code writes and evaluation support PAGE and NUMPAGES. @public */
2382
- declare class Field extends ModelObject implements PromisedItem {
2521
+ /** Word's shape types. Supported text-bearing shapes expose their own body. @public */
2522
+ declare enum ShapeType {
2523
+ unsupported = "Unsupported",
2524
+ textBox = "TextBox",
2525
+ geometricShape = "GeometricShape",
2526
+ group = "Group",
2527
+ picture = "Picture",
2528
+ canvas = "Canvas"
2529
+ }
2530
+ /**
2531
+ * One floating or inline shape in a body or paragraph.
2532
+ *
2533
+ * `id`, `name` and `type` are read-only. {@link Shape.body} exposes a supported shape's
2534
+ * own text story, including text-bearing geometric shapes. Other shapes refuse body access.
2535
+ *
2536
+ * @public
2537
+ */
2538
+ declare class Shape extends ModelObject implements PromisedItem {
2383
2539
  #private;
2384
2540
  /** @internal */
2385
- static at(context: RequestContext, label: string, address: ObjectAddress): Field;
2541
+ static at(context: RequestContext, label: string, address: ObjectAddress): Shape;
2386
2542
  /** @internal */
2387
- static promised(context: RequestContext, label: string, nullable: boolean): Field;
2543
+ static promised(context: RequestContext, label: string, nullable: boolean): Shape;
2388
2544
  private constructor();
2389
2545
  /** @internal */
2390
2546
  hydrateAddress(address: ObjectAddress): void;
2391
2547
  /** @internal */
2392
2548
  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. */
2396
- delete(): void;
2397
- /** Compute a cached result using actual host pagination. Missing pagination refuses explicitly. */
2398
- updateResult(): void;
2549
+ /** The shape's id in the document. */
2550
+ get id(): number;
2551
+ /** The shape's name in the document. */
2552
+ get name(): string;
2553
+ /** The shape's type. */
2554
+ get type(): ShapeType;
2555
+ /**
2556
+ * The shape's own text story in the main body, a header, or a footer.
2557
+ * Shapes in notes or nested text boxes refuse body access with `InvalidArgument` at the sync.
2558
+ * Shapes without their own supported text story also refuse access.
2559
+ */
2560
+ get body(): Body;
2561
+ /** @internal Plan the read this object's `load(...)` asked for. */
2399
2562
  protected onLoad(request: ResolvedLoadOptions): void;
2400
2563
  }
2401
- /** Fields contained within a body or range. @public */
2402
- declare class FieldCollection extends ItemCollection<Field> {
2564
+ /**
2565
+ * The floating and inline shapes in a body or paragraph, in reading order.
2566
+ *
2567
+ * @public
2568
+ */
2569
+ declare class ShapeCollection extends ItemCollection<Shape> {
2403
2570
  #private;
2404
2571
  /** @internal */
2405
- static of(context: RequestContext, label: string, owner: ObjectPath, kind: SpanOwner): FieldCollection;
2572
+ static of(context: RequestContext, label: string, owner: ObjectPath, kind: SpanOwner, types?: readonly ShapeType[]): ShapeCollection;
2406
2573
  private constructor();
2407
- getFirst(): Field;
2408
- getLast(): Field;
2409
- getFirstOrNullObject(): Field;
2410
- getLastOrNullObject(): Field;
2574
+ /** The first shape. `ItemNotFound` at the sync when there is none. */
2575
+ getFirst(): Shape;
2576
+ /** The first shape, or a null object when there is none. */
2577
+ getFirstOrNullObject(): Shape;
2578
+ /** The shapes of the given types, in the same order. */
2579
+ getByTypes(types: ShapeType[]): ShapeCollection;
2580
+ /** @internal */
2411
2581
  protected listing(): AutomationOperation;
2582
+ /** @internal */
2412
2583
  protected size(value: AutomationValue, label: string): number;
2584
+ /** @internal */
2413
2585
  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;
2586
+ /** @internal */
2587
+ protected itemAt(label: string, address: ObjectAddress): Shape;
2588
+ /** @internal */
2589
+ protected promised(label: string, nullable: boolean): Shape & PromisedItem;
2416
2590
  }
2417
2591
 
2418
2592
  /**
@@ -2433,6 +2607,10 @@ declare class FieldCollection extends ItemCollection<Field> {
2433
2607
  */
2434
2608
  declare class Body extends ModelObject {
2435
2609
  #private;
2610
+ /** Footnotes referenced within this body, in reference order. */
2611
+ get footnotes(): NoteItemCollection;
2612
+ /** Endnotes referenced within this body, in reference order. */
2613
+ get endnotes(): NoteItemCollection;
2436
2614
  /** @internal The main story of the document this context is running against. */
2437
2615
  static main(context: RequestContext, label: string): Body;
2438
2616
  /**
@@ -2519,6 +2697,8 @@ declare class Body extends ModelObject {
2519
2697
  get fields(): FieldCollection;
2520
2698
  /** Inline pictures within this body. */
2521
2699
  get inlinePictures(): InlinePictureCollection;
2700
+ /** Floating and inline shapes in this body, such as text boxes and pictures. */
2701
+ get shapes(): ShapeCollection;
2522
2702
  /** Top-level tables within this body or table cell. */
2523
2703
  get tables(): TableCollection;
2524
2704
  }
@@ -2614,4 +2794,5 @@ interface CreateServerOptions {
2614
2794
  /** Options for {@link createCollaborative}. @public */
2615
2795
  type CreateCollaborativeOptions = CreateServerOptions;
2616
2796
 
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 };
2797
+ 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, Shape as al, ShapeCollection as am, ShapeType as an, Table as ao, TableCell as ap, TableCellCollection as aq, TableCollection as ar, TableRow as as, TableRowCollection as at, TrackedObjects as au, UnderlineType as av, VerticalAlignment as aw, isDocxEditorError as ax, 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 };
2798
+ 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 };