@docx-editor.dev/editor-api 2.25.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.
@@ -1629,6 +1629,8 @@ declare class Paragraph extends ModelObject implements PromisedItem {
1629
1629
  */
1630
1630
  get style(): string;
1631
1631
  set style(value: string);
1632
+ /** Floating and inline shapes in this paragraph, such as text boxes and pictures. */
1633
+ get shapes(): ShapeCollection;
1632
1634
  /** The character formatting of this paragraph's characters, and of its paragraph mark. */
1633
1635
  get font(): Font;
1634
1636
  /**
@@ -1780,6 +1782,80 @@ declare class RangeCollection extends ItemCollection<Range> {
1780
1782
  protected promised(label: string, nullable: boolean): Range & PromisedItem;
1781
1783
  }
1782
1784
 
1785
+ /** Which kind of note: Word's own two. */
1786
+ type NoteItemType = 'Footnote' | 'Endnote';
1787
+ /**
1788
+ * One footnote or endnote: text that belongs to the document but not to its flow.
1789
+ *
1790
+ * A note IS a story. Its {@link NoteItem.body} is an ordinary {@link Body} — paragraphs,
1791
+ * formatting, styles, the same operations — laid out at the foot of a page or the end of the
1792
+ * document rather than in the column, so everything the object model can do to the main story it
1793
+ * can do to a note without a second vocabulary.
1794
+ *
1795
+ * `delete()` removes the reference too. A note's body and the citation that reached it are one
1796
+ * thing to a reader, and deleting the body alone would leave a mark pointing at nothing. The
1797
+ * engine spells that as a package-level transaction, which is why it travels alone in its batch.
1798
+ *
1799
+ * @public
1800
+ */
1801
+ declare class NoteItem extends ModelObject implements PromisedItem {
1802
+ #private;
1803
+ /** @internal A note a read has already named. */
1804
+ static at(context: RequestContext, label: string, address: ObjectAddress): NoteItem;
1805
+ /** @internal A note a queued read will name, or report as nothing. */
1806
+ static promised(context: RequestContext, label: string, nullable: boolean): NoteItem;
1807
+ private constructor();
1808
+ /** @internal Bind this object to the address the owning read answered. */
1809
+ hydrateAddress(address: ObjectAddress): void;
1810
+ /** @internal Settle as the null object: the read found nothing to name. */
1811
+ hydrateNull(): void;
1812
+ /** Whether this is a footnote or an endnote. */
1813
+ get type(): NoteItemType;
1814
+ /**
1815
+ * The note's plain text.
1816
+ *
1817
+ * This is the same value as loading `text` from {@link NoteItem.body}: every paragraph in the
1818
+ * note story, in reading order, joined by one carriage return per paragraph mark. Load it
1819
+ * directly when structured traversal or editing through {@link NoteItem.body} is not needed.
1820
+ */
1821
+ get text(): string;
1822
+ /** The note's own story. */
1823
+ get body(): Body;
1824
+ /**
1825
+ * Remove the note and every reference to it.
1826
+ *
1827
+ * A package transaction, so it is the ONLY operation its `sync()` may carry — the host refuses it
1828
+ * any company rather than committing half a batch. Two syncs get a delete and anything else.
1829
+ */
1830
+ delete(): void;
1831
+ /** The next note of the same kind. `ItemNotFound` at the sync when this is the last one. */
1832
+ getNext(): NoteItem;
1833
+ /** @internal Plan the read this object's `load(...)` asked for. */
1834
+ protected onLoad(request: ResolvedLoadOptions): void;
1835
+ }
1836
+ /**
1837
+ * The notes of one kind, in the order the notes part writes them.
1838
+ *
1839
+ * DocxEditor's own collection type: the pinned reference fixture does not carry
1840
+ * `Word.NoteItemCollection`, so it is not measured for conformance — recorded as an omission in
1841
+ * `compat/manifest.json` — while `NoteItem` itself is. Without it a note would be unreachable, which
1842
+ * is the one thing worse than an unmeasured collection.
1843
+ */
1844
+ declare class NoteItemCollection extends HandleCollection<NoteItem> {
1845
+ #private;
1846
+ /** @internal A collection a named read will answer. */
1847
+ static of(context: RequestContext, label: string, owner: ObjectPath, plan: () => AutomationOperation): NoteItemCollection;
1848
+ private constructor();
1849
+ /** The first note. `ItemNotFound` at the sync if the document has none of this kind. */
1850
+ getFirst(): NoteItem;
1851
+ /** @internal The read that answers this collection's members. */
1852
+ protected listing(): AutomationOperation;
1853
+ /** @internal Build one member from an address the listing answered. */
1854
+ protected itemAt(label: string, address: ObjectAddress): NoteItem;
1855
+ /** @internal A member an edge accessor named before the sync that finds it. */
1856
+ protected promised(label: string, nullable: boolean): NoteItem & PromisedItem;
1857
+ }
1858
+
1783
1859
  /** Which header or footer of a section: Word's own three variants. */
1784
1860
  type HeaderFooterType = 'Primary' | 'FirstPage' | 'EvenPages';
1785
1861
  /**
@@ -2442,78 +2518,75 @@ declare class DocxEditorError extends Error {
2442
2518
  */
2443
2519
  declare function isDocxEditorError(value: unknown): value is DocxEditorError;
2444
2520
 
2445
- /** Which kind of note: Word's own two. */
2446
- type NoteItemType = 'Footnote' | 'Endnote';
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
+ }
2447
2530
  /**
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.
2531
+ * One floating or inline shape in a body or paragraph.
2454
2532
  *
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.
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.
2458
2535
  *
2459
2536
  * @public
2460
2537
  */
2461
- declare class NoteItem extends ModelObject implements PromisedItem {
2538
+ declare class Shape extends ModelObject implements PromisedItem {
2462
2539
  #private;
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;
2540
+ /** @internal */
2541
+ static at(context: RequestContext, label: string, address: ObjectAddress): Shape;
2542
+ /** @internal */
2543
+ static promised(context: RequestContext, label: string, nullable: boolean): Shape;
2467
2544
  private constructor();
2468
- /** @internal Bind this object to the address the owning read answered. */
2545
+ /** @internal */
2469
2546
  hydrateAddress(address: ObjectAddress): void;
2470
- /** @internal Settle as the null object: the read found nothing to name. */
2547
+ /** @internal */
2471
2548
  hydrateNull(): void;
2472
- /** Whether this is a footnote or an endnote. */
2473
- get type(): NoteItemType;
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;
2474
2555
  /**
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.
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.
2480
2559
  */
2481
- get text(): string;
2482
- /** The note's own story. */
2483
2560
  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
- */
2490
- delete(): void;
2491
- /** The next note of the same kind. `ItemNotFound` at the sync when this is the last one. */
2492
- getNext(): NoteItem;
2493
2561
  /** @internal Plan the read this object's `load(...)` asked for. */
2494
2562
  protected onLoad(request: ResolvedLoadOptions): void;
2495
2563
  }
2496
2564
  /**
2497
- * The notes of one kind, in the order the notes part writes them.
2565
+ * The floating and inline shapes in a body or paragraph, in reading order.
2498
2566
  *
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.
2567
+ * @public
2503
2568
  */
2504
- declare class NoteItemCollection extends HandleCollection<NoteItem> {
2569
+ declare class ShapeCollection extends ItemCollection<Shape> {
2505
2570
  #private;
2506
- /** @internal A collection a named read will answer. */
2507
- static of(context: RequestContext, label: string, owner: ObjectPath, plan: () => AutomationOperation): NoteItemCollection;
2571
+ /** @internal */
2572
+ static of(context: RequestContext, label: string, owner: ObjectPath, kind: SpanOwner, types?: readonly ShapeType[]): ShapeCollection;
2508
2573
  private constructor();
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. */
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 */
2512
2581
  protected listing(): AutomationOperation;
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;
2582
+ /** @internal */
2583
+ protected size(value: AutomationValue, label: string): number;
2584
+ /** @internal */
2585
+ protected addressAt(value: AutomationValue, label: string, index: number): ObjectAddress | undefined;
2586
+ /** @internal */
2587
+ protected itemAt(label: string, address: ObjectAddress): Shape;
2588
+ /** @internal */
2589
+ protected promised(label: string, nullable: boolean): Shape & PromisedItem;
2517
2590
  }
2518
2591
 
2519
2592
  /**
@@ -2624,6 +2697,8 @@ declare class Body extends ModelObject {
2624
2697
  get fields(): FieldCollection;
2625
2698
  /** Inline pictures within this body. */
2626
2699
  get inlinePictures(): InlinePictureCollection;
2700
+ /** Floating and inline shapes in this body, such as text boxes and pictures. */
2701
+ get shapes(): ShapeCollection;
2627
2702
  /** Top-level tables within this body or table cell. */
2628
2703
  get tables(): TableCollection;
2629
2704
  }
@@ -2719,5 +2794,5 @@ interface CreateServerOptions {
2719
2794
  /** Options for {@link createCollaborative}. @public */
2720
2795
  type CreateCollaborativeOptions = CreateServerOptions;
2721
2796
 
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 };
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 };
2723
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 };
@@ -1629,6 +1629,8 @@ declare class Paragraph extends ModelObject implements PromisedItem {
1629
1629
  */
1630
1630
  get style(): string;
1631
1631
  set style(value: string);
1632
+ /** Floating and inline shapes in this paragraph, such as text boxes and pictures. */
1633
+ get shapes(): ShapeCollection;
1632
1634
  /** The character formatting of this paragraph's characters, and of its paragraph mark. */
1633
1635
  get font(): Font;
1634
1636
  /**
@@ -1780,6 +1782,80 @@ declare class RangeCollection extends ItemCollection<Range> {
1780
1782
  protected promised(label: string, nullable: boolean): Range & PromisedItem;
1781
1783
  }
1782
1784
 
1785
+ /** Which kind of note: Word's own two. */
1786
+ type NoteItemType = 'Footnote' | 'Endnote';
1787
+ /**
1788
+ * One footnote or endnote: text that belongs to the document but not to its flow.
1789
+ *
1790
+ * A note IS a story. Its {@link NoteItem.body} is an ordinary {@link Body} — paragraphs,
1791
+ * formatting, styles, the same operations — laid out at the foot of a page or the end of the
1792
+ * document rather than in the column, so everything the object model can do to the main story it
1793
+ * can do to a note without a second vocabulary.
1794
+ *
1795
+ * `delete()` removes the reference too. A note's body and the citation that reached it are one
1796
+ * thing to a reader, and deleting the body alone would leave a mark pointing at nothing. The
1797
+ * engine spells that as a package-level transaction, which is why it travels alone in its batch.
1798
+ *
1799
+ * @public
1800
+ */
1801
+ declare class NoteItem extends ModelObject implements PromisedItem {
1802
+ #private;
1803
+ /** @internal A note a read has already named. */
1804
+ static at(context: RequestContext, label: string, address: ObjectAddress): NoteItem;
1805
+ /** @internal A note a queued read will name, or report as nothing. */
1806
+ static promised(context: RequestContext, label: string, nullable: boolean): NoteItem;
1807
+ private constructor();
1808
+ /** @internal Bind this object to the address the owning read answered. */
1809
+ hydrateAddress(address: ObjectAddress): void;
1810
+ /** @internal Settle as the null object: the read found nothing to name. */
1811
+ hydrateNull(): void;
1812
+ /** Whether this is a footnote or an endnote. */
1813
+ get type(): NoteItemType;
1814
+ /**
1815
+ * The note's plain text.
1816
+ *
1817
+ * This is the same value as loading `text` from {@link NoteItem.body}: every paragraph in the
1818
+ * note story, in reading order, joined by one carriage return per paragraph mark. Load it
1819
+ * directly when structured traversal or editing through {@link NoteItem.body} is not needed.
1820
+ */
1821
+ get text(): string;
1822
+ /** The note's own story. */
1823
+ get body(): Body;
1824
+ /**
1825
+ * Remove the note and every reference to it.
1826
+ *
1827
+ * A package transaction, so it is the ONLY operation its `sync()` may carry — the host refuses it
1828
+ * any company rather than committing half a batch. Two syncs get a delete and anything else.
1829
+ */
1830
+ delete(): void;
1831
+ /** The next note of the same kind. `ItemNotFound` at the sync when this is the last one. */
1832
+ getNext(): NoteItem;
1833
+ /** @internal Plan the read this object's `load(...)` asked for. */
1834
+ protected onLoad(request: ResolvedLoadOptions): void;
1835
+ }
1836
+ /**
1837
+ * The notes of one kind, in the order the notes part writes them.
1838
+ *
1839
+ * DocxEditor's own collection type: the pinned reference fixture does not carry
1840
+ * `Word.NoteItemCollection`, so it is not measured for conformance — recorded as an omission in
1841
+ * `compat/manifest.json` — while `NoteItem` itself is. Without it a note would be unreachable, which
1842
+ * is the one thing worse than an unmeasured collection.
1843
+ */
1844
+ declare class NoteItemCollection extends HandleCollection<NoteItem> {
1845
+ #private;
1846
+ /** @internal A collection a named read will answer. */
1847
+ static of(context: RequestContext, label: string, owner: ObjectPath, plan: () => AutomationOperation): NoteItemCollection;
1848
+ private constructor();
1849
+ /** The first note. `ItemNotFound` at the sync if the document has none of this kind. */
1850
+ getFirst(): NoteItem;
1851
+ /** @internal The read that answers this collection's members. */
1852
+ protected listing(): AutomationOperation;
1853
+ /** @internal Build one member from an address the listing answered. */
1854
+ protected itemAt(label: string, address: ObjectAddress): NoteItem;
1855
+ /** @internal A member an edge accessor named before the sync that finds it. */
1856
+ protected promised(label: string, nullable: boolean): NoteItem & PromisedItem;
1857
+ }
1858
+
1783
1859
  /** Which header or footer of a section: Word's own three variants. */
1784
1860
  type HeaderFooterType = 'Primary' | 'FirstPage' | 'EvenPages';
1785
1861
  /**
@@ -2442,78 +2518,75 @@ declare class DocxEditorError extends Error {
2442
2518
  */
2443
2519
  declare function isDocxEditorError(value: unknown): value is DocxEditorError;
2444
2520
 
2445
- /** Which kind of note: Word's own two. */
2446
- type NoteItemType = 'Footnote' | 'Endnote';
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
+ }
2447
2530
  /**
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.
2531
+ * One floating or inline shape in a body or paragraph.
2454
2532
  *
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.
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.
2458
2535
  *
2459
2536
  * @public
2460
2537
  */
2461
- declare class NoteItem extends ModelObject implements PromisedItem {
2538
+ declare class Shape extends ModelObject implements PromisedItem {
2462
2539
  #private;
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;
2540
+ /** @internal */
2541
+ static at(context: RequestContext, label: string, address: ObjectAddress): Shape;
2542
+ /** @internal */
2543
+ static promised(context: RequestContext, label: string, nullable: boolean): Shape;
2467
2544
  private constructor();
2468
- /** @internal Bind this object to the address the owning read answered. */
2545
+ /** @internal */
2469
2546
  hydrateAddress(address: ObjectAddress): void;
2470
- /** @internal Settle as the null object: the read found nothing to name. */
2547
+ /** @internal */
2471
2548
  hydrateNull(): void;
2472
- /** Whether this is a footnote or an endnote. */
2473
- get type(): NoteItemType;
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;
2474
2555
  /**
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.
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.
2480
2559
  */
2481
- get text(): string;
2482
- /** The note's own story. */
2483
2560
  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
- */
2490
- delete(): void;
2491
- /** The next note of the same kind. `ItemNotFound` at the sync when this is the last one. */
2492
- getNext(): NoteItem;
2493
2561
  /** @internal Plan the read this object's `load(...)` asked for. */
2494
2562
  protected onLoad(request: ResolvedLoadOptions): void;
2495
2563
  }
2496
2564
  /**
2497
- * The notes of one kind, in the order the notes part writes them.
2565
+ * The floating and inline shapes in a body or paragraph, in reading order.
2498
2566
  *
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.
2567
+ * @public
2503
2568
  */
2504
- declare class NoteItemCollection extends HandleCollection<NoteItem> {
2569
+ declare class ShapeCollection extends ItemCollection<Shape> {
2505
2570
  #private;
2506
- /** @internal A collection a named read will answer. */
2507
- static of(context: RequestContext, label: string, owner: ObjectPath, plan: () => AutomationOperation): NoteItemCollection;
2571
+ /** @internal */
2572
+ static of(context: RequestContext, label: string, owner: ObjectPath, kind: SpanOwner, types?: readonly ShapeType[]): ShapeCollection;
2508
2573
  private constructor();
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. */
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 */
2512
2581
  protected listing(): AutomationOperation;
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;
2582
+ /** @internal */
2583
+ protected size(value: AutomationValue, label: string): number;
2584
+ /** @internal */
2585
+ protected addressAt(value: AutomationValue, label: string, index: number): ObjectAddress | undefined;
2586
+ /** @internal */
2587
+ protected itemAt(label: string, address: ObjectAddress): Shape;
2588
+ /** @internal */
2589
+ protected promised(label: string, nullable: boolean): Shape & PromisedItem;
2517
2590
  }
2518
2591
 
2519
2592
  /**
@@ -2624,6 +2697,8 @@ declare class Body extends ModelObject {
2624
2697
  get fields(): FieldCollection;
2625
2698
  /** Inline pictures within this body. */
2626
2699
  get inlinePictures(): InlinePictureCollection;
2700
+ /** Floating and inline shapes in this body, such as text boxes and pictures. */
2701
+ get shapes(): ShapeCollection;
2627
2702
  /** Top-level tables within this body or table cell. */
2628
2703
  get tables(): TableCollection;
2629
2704
  }
@@ -2719,5 +2794,5 @@ interface CreateServerOptions {
2719
2794
  /** Options for {@link createCollaborative}. @public */
2720
2795
  type CreateCollaborativeOptions = CreateServerOptions;
2721
2796
 
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 };
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 };
2723
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 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docx-editor.dev/editor-api",
3
- "version": "2.25.0",
3
+ "version": "2.26.0",
4
4
  "description": "Document automation for DOCX: a batching object model that drives a document from a server or from an editor already open in a page",
5
5
  "sideEffects": false,
6
6
  "engines": {
@@ -83,6 +83,6 @@
83
83
  "access": "public"
84
84
  },
85
85
  "peerDependencies": {
86
- "@docx-editor.dev/core": "~2.25.0"
86
+ "@docx-editor.dev/core": "~2.26.0"
87
87
  }
88
88
  }