@docx-editor.dev/editor-api 2.3.1 → 2.4.1

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.
@@ -345,9 +345,10 @@ declare class BookmarkCollection extends HandleCollection<Bookmark> {
345
345
  *
346
346
  * The WHOLE upstream vocabulary, because a declaration says what a caller may be handed and a caller
347
347
  * switching on it should not have to be told which subset this engine happens to produce. Seven of
348
- * these actually occur — insert, delete, replace, the two property kinds and the two move halves —
349
- * because a change to a row, a cell or a section is structural, and this engine reports only the
350
- * changes it can also accept or reject. See `compat/manifest.json`.
348
+ * these actually occur as published objects — insert, delete, replace, the two property kinds and
349
+ * the two move halves. Structural cards whose exact Word subtype this API cannot name are omitted
350
+ * from `items`; collection-wide decisions still resolve every store-resolvable revision. See
351
+ * `compat/manifest.json`.
351
352
  */
352
353
  type RevisionType = 'None' | 'Insert' | 'Delete' | 'Property' | 'ParagraphNumber' | 'DisplayField' | 'Reconcile' | 'Conflict' | 'Style' | 'Replace' | 'ParagraphProperty' | 'TableProperty' | 'SectionProperty' | 'StyleDefinition' | 'MovedFrom' | 'MovedTo' | 'CellInsertion' | 'CellDeletion' | 'CellMerge' | 'CellSplit' | 'ConflictInsert' | 'ConflictDelete';
353
354
  /** What a comment and a reply both are: an author, a date, an id and a body. */
@@ -483,12 +484,11 @@ declare class CommentCollection extends HandleCollection<Comment> {
483
484
  protected promised(label: string, nullable: boolean): Comment & PromisedItem;
484
485
  }
485
486
  /**
486
- * One tracked change, and a decision the engine can act on.
487
+ * One tracked change, published when this API can name its Word subtype.
487
488
  *
488
- * Only revisions the engine can actually resolve are answered as objects. Structural ones — a
489
- * row, a cell, a section, the table grid — are omitted from the collection entirely rather than
490
- * shipped as objects whose `accept` and `reject` both refuse: code walking the collection would
491
- * stall on such an item with nothing to read that explains why.
489
+ * Structural cards whose exact Word subtype cannot be typed — a row, a cell, a section, the table
490
+ * grid — are omitted from the collection rather than shipped as objects with an unpublishable
491
+ * `type`. That listing is not the collection decision set: see {@link RevisionCollection}.
492
492
  *
493
493
  * @public
494
494
  */
@@ -521,24 +521,24 @@ declare class Revision extends ModelObject implements PromisedItem {
521
521
  /**
522
522
  * The tracked changes on a document, story or range, as of the batch that loaded them.
523
523
  *
524
- * Carries only the revisions the engine can resolve; see {@link Revision} for what is left out
525
- * and why.
524
+ * `items` omits structural cards whose Word subtype this API cannot name; see {@link Revision}.
525
+ * Collection-wide `acceptAll` / `rejectAll` still resolve every store-resolvable revision in this
526
+ * story and refuse atomically if any `readOnly` or otherwise unsupported revision remains.
526
527
  *
527
528
  * @public
528
529
  */
529
530
  declare class RevisionCollection extends HandleCollection<Revision> {
530
531
  #private;
531
532
  /** @internal The pending decisions of one story. */
532
- static of(context: RequestContext, label: string, owner: ObjectPath, body: AutomationHandle, document: AutomationHandle): RevisionCollection;
533
+ static of(context: RequestContext, label: string, owner: ObjectPath, body: AutomationHandle): RevisionCollection;
533
534
  private constructor();
534
535
  /**
535
- * Keep every change, as ONE decision and one undo unit.
536
+ * Keep every change in this story, as ONE decision and one undo unit.
536
537
  *
537
- * The engine's own whole-document operation rather than a loop over `accept`: a reviewer who
538
- * accepted a document's changes made one decision, and one undo should take all of them back. It
539
- * refuses outright where the document holds a change the engine cannot resolve, which is the
540
- * honest answer — accepting the rest would report a document as reviewed while it still carries
541
- * pending changes.
538
+ * Resolves every store-resolvable revision in the story, including complete tracked rows
539
+ * omitted from `items`. Refuses the sync outright where any `readOnly` or otherwise
540
+ * unsupported revision remains, rather than reporting the story as reviewed while pending
541
+ * changes remain.
542
542
  */
543
543
  acceptAll(): void;
544
544
  /** Undo every change, likewise as one decision. */
@@ -1298,12 +1298,12 @@ declare class Document extends ModelObject {
1298
1298
  /** The comments anchored in the main story, in document order. */
1299
1299
  get comments(): CommentCollection;
1300
1300
  /**
1301
- * The tracked changes of the main story that the engine can resolve.
1301
+ * The tracked changes of the main-body story that this API can publish as typed objects.
1302
1302
  *
1303
- * Structural changes — a row, a cell, a section, the table grid — are not in it: they are ones the
1304
- * engine refuses to accept or reject, and an item whose two verbs both refuse would stall code
1305
- * walking the collection. `acceptAll`/`rejectAll` refuse outright where the document holds one,
1306
- * rather than reporting a document as reviewed while pending changes remain.
1303
+ * Structural cards whose exact Word subtype cannot be named are omitted from `items`.
1304
+ * `acceptAll` / `rejectAll` still resolve every store-resolvable revision in the main body
1305
+ * and refuse atomically if any `readOnly` or otherwise unsupported revision remains. Header,
1306
+ * footer, and note revisions live on those stories' own `Body.revisions` collections.
1307
1307
  */
1308
1308
  get revisions(): RevisionCollection;
1309
1309
  /**
@@ -1369,7 +1369,11 @@ interface DocxEditorRuntime {
1369
1369
  * @public
1370
1370
  */
1371
1371
  interface DocxEditorServerRuntime extends DocxEditorRuntime {
1372
- /** The current document as DOCX bytes. */
1372
+ /**
1373
+ * The current document as a fresh, caller-owned DOCX byte array.
1374
+ *
1375
+ * Mutating or transferring the returned array does not change this runtime or a later save.
1376
+ */
1373
1377
  save(): Promise<Uint8Array>;
1374
1378
  }
1375
1379
 
@@ -1965,11 +1969,12 @@ declare class Body extends ModelObject {
1965
1969
  /** The comments anchored in this story, in document order. Replies hang off the comment. */
1966
1970
  getComments(): CommentCollection;
1967
1971
  /**
1968
- * The tracked changes in this story that the engine can resolve, in document order.
1972
+ * The tracked changes in this story that this API can publish as typed objects, in document order.
1969
1973
  *
1970
1974
  * DocxEditor's own accessor: upstream reaches revisions from the document, and this story-scoped
1971
- * one is what makes a header's or a note's changes reachable at all. Recorded in
1972
- * `compat/manifest.json`.
1975
+ * collection is what makes a header's, footer's, or note's changes reachable at all. Recorded in
1976
+ * `compat/manifest.json`. `items` may omit structural cards; collection-wide decisions still
1977
+ * resolve every store-resolvable revision in this story.
1973
1978
  */
1974
1979
  get revisions(): RevisionCollection;
1975
1980
  /** Every occurrence of `searchText` in this story, as ranges, in reading order. */
@@ -2020,6 +2025,9 @@ interface DocumentLimits {
2020
2025
  * they did not author gets "not a document this API can open", so a probe cannot use the error to
2021
2026
  * learn the reader's limits.
2022
2027
  *
2028
+ * The bounded parse is complete when this promise resolves. The runtime does not retain the
2029
+ * caller's `Uint8Array`, so the caller may reuse or transfer that input buffer afterward.
2030
+ *
2023
2031
  * @public
2024
2032
  */
2025
2033
  interface CreateServerOptions {
@@ -345,9 +345,10 @@ declare class BookmarkCollection extends HandleCollection<Bookmark> {
345
345
  *
346
346
  * The WHOLE upstream vocabulary, because a declaration says what a caller may be handed and a caller
347
347
  * switching on it should not have to be told which subset this engine happens to produce. Seven of
348
- * these actually occur — insert, delete, replace, the two property kinds and the two move halves —
349
- * because a change to a row, a cell or a section is structural, and this engine reports only the
350
- * changes it can also accept or reject. See `compat/manifest.json`.
348
+ * these actually occur as published objects — insert, delete, replace, the two property kinds and
349
+ * the two move halves. Structural cards whose exact Word subtype this API cannot name are omitted
350
+ * from `items`; collection-wide decisions still resolve every store-resolvable revision. See
351
+ * `compat/manifest.json`.
351
352
  */
352
353
  type RevisionType = 'None' | 'Insert' | 'Delete' | 'Property' | 'ParagraphNumber' | 'DisplayField' | 'Reconcile' | 'Conflict' | 'Style' | 'Replace' | 'ParagraphProperty' | 'TableProperty' | 'SectionProperty' | 'StyleDefinition' | 'MovedFrom' | 'MovedTo' | 'CellInsertion' | 'CellDeletion' | 'CellMerge' | 'CellSplit' | 'ConflictInsert' | 'ConflictDelete';
353
354
  /** What a comment and a reply both are: an author, a date, an id and a body. */
@@ -483,12 +484,11 @@ declare class CommentCollection extends HandleCollection<Comment> {
483
484
  protected promised(label: string, nullable: boolean): Comment & PromisedItem;
484
485
  }
485
486
  /**
486
- * One tracked change, and a decision the engine can act on.
487
+ * One tracked change, published when this API can name its Word subtype.
487
488
  *
488
- * Only revisions the engine can actually resolve are answered as objects. Structural ones — a
489
- * row, a cell, a section, the table grid — are omitted from the collection entirely rather than
490
- * shipped as objects whose `accept` and `reject` both refuse: code walking the collection would
491
- * stall on such an item with nothing to read that explains why.
489
+ * Structural cards whose exact Word subtype cannot be typed — a row, a cell, a section, the table
490
+ * grid — are omitted from the collection rather than shipped as objects with an unpublishable
491
+ * `type`. That listing is not the collection decision set: see {@link RevisionCollection}.
492
492
  *
493
493
  * @public
494
494
  */
@@ -521,24 +521,24 @@ declare class Revision extends ModelObject implements PromisedItem {
521
521
  /**
522
522
  * The tracked changes on a document, story or range, as of the batch that loaded them.
523
523
  *
524
- * Carries only the revisions the engine can resolve; see {@link Revision} for what is left out
525
- * and why.
524
+ * `items` omits structural cards whose Word subtype this API cannot name; see {@link Revision}.
525
+ * Collection-wide `acceptAll` / `rejectAll` still resolve every store-resolvable revision in this
526
+ * story and refuse atomically if any `readOnly` or otherwise unsupported revision remains.
526
527
  *
527
528
  * @public
528
529
  */
529
530
  declare class RevisionCollection extends HandleCollection<Revision> {
530
531
  #private;
531
532
  /** @internal The pending decisions of one story. */
532
- static of(context: RequestContext, label: string, owner: ObjectPath, body: AutomationHandle, document: AutomationHandle): RevisionCollection;
533
+ static of(context: RequestContext, label: string, owner: ObjectPath, body: AutomationHandle): RevisionCollection;
533
534
  private constructor();
534
535
  /**
535
- * Keep every change, as ONE decision and one undo unit.
536
+ * Keep every change in this story, as ONE decision and one undo unit.
536
537
  *
537
- * The engine's own whole-document operation rather than a loop over `accept`: a reviewer who
538
- * accepted a document's changes made one decision, and one undo should take all of them back. It
539
- * refuses outright where the document holds a change the engine cannot resolve, which is the
540
- * honest answer — accepting the rest would report a document as reviewed while it still carries
541
- * pending changes.
538
+ * Resolves every store-resolvable revision in the story, including complete tracked rows
539
+ * omitted from `items`. Refuses the sync outright where any `readOnly` or otherwise
540
+ * unsupported revision remains, rather than reporting the story as reviewed while pending
541
+ * changes remain.
542
542
  */
543
543
  acceptAll(): void;
544
544
  /** Undo every change, likewise as one decision. */
@@ -1298,12 +1298,12 @@ declare class Document extends ModelObject {
1298
1298
  /** The comments anchored in the main story, in document order. */
1299
1299
  get comments(): CommentCollection;
1300
1300
  /**
1301
- * The tracked changes of the main story that the engine can resolve.
1301
+ * The tracked changes of the main-body story that this API can publish as typed objects.
1302
1302
  *
1303
- * Structural changes — a row, a cell, a section, the table grid — are not in it: they are ones the
1304
- * engine refuses to accept or reject, and an item whose two verbs both refuse would stall code
1305
- * walking the collection. `acceptAll`/`rejectAll` refuse outright where the document holds one,
1306
- * rather than reporting a document as reviewed while pending changes remain.
1303
+ * Structural cards whose exact Word subtype cannot be named are omitted from `items`.
1304
+ * `acceptAll` / `rejectAll` still resolve every store-resolvable revision in the main body
1305
+ * and refuse atomically if any `readOnly` or otherwise unsupported revision remains. Header,
1306
+ * footer, and note revisions live on those stories' own `Body.revisions` collections.
1307
1307
  */
1308
1308
  get revisions(): RevisionCollection;
1309
1309
  /**
@@ -1369,7 +1369,11 @@ interface DocxEditorRuntime {
1369
1369
  * @public
1370
1370
  */
1371
1371
  interface DocxEditorServerRuntime extends DocxEditorRuntime {
1372
- /** The current document as DOCX bytes. */
1372
+ /**
1373
+ * The current document as a fresh, caller-owned DOCX byte array.
1374
+ *
1375
+ * Mutating or transferring the returned array does not change this runtime or a later save.
1376
+ */
1373
1377
  save(): Promise<Uint8Array>;
1374
1378
  }
1375
1379
 
@@ -1965,11 +1969,12 @@ declare class Body extends ModelObject {
1965
1969
  /** The comments anchored in this story, in document order. Replies hang off the comment. */
1966
1970
  getComments(): CommentCollection;
1967
1971
  /**
1968
- * The tracked changes in this story that the engine can resolve, in document order.
1972
+ * The tracked changes in this story that this API can publish as typed objects, in document order.
1969
1973
  *
1970
1974
  * DocxEditor's own accessor: upstream reaches revisions from the document, and this story-scoped
1971
- * one is what makes a header's or a note's changes reachable at all. Recorded in
1972
- * `compat/manifest.json`.
1975
+ * collection is what makes a header's, footer's, or note's changes reachable at all. Recorded in
1976
+ * `compat/manifest.json`. `items` may omit structural cards; collection-wide decisions still
1977
+ * resolve every store-resolvable revision in this story.
1973
1978
  */
1974
1979
  get revisions(): RevisionCollection;
1975
1980
  /** Every occurrence of `searchText` in this story, as ranges, in reading order. */
@@ -2020,6 +2025,9 @@ interface DocumentLimits {
2020
2025
  * they did not author gets "not a document this API can open", so a probe cannot use the error to
2021
2026
  * learn the reader's limits.
2022
2027
  *
2028
+ * The bounded parse is complete when this promise resolves. The runtime does not retain the
2029
+ * caller's `Uint8Array`, so the caller may reuse or transfer that input buffer afterward.
2030
+ *
2023
2031
  * @public
2024
2032
  */
2025
2033
  interface CreateServerOptions {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@docx-editor.dev/editor-api",
3
- "version": "2.3.1",
3
+ "version": "2.4.1",
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
  "main": "./dist/index.js",
@@ -73,6 +73,6 @@
73
73
  "access": "public"
74
74
  },
75
75
  "dependencies": {
76
- "@docx-editor.dev/core": "^2.3.1"
76
+ "@docx-editor.dev/core": "^2.4.1"
77
77
  }
78
78
  }