@stll/docx-core 0.30.1 → 0.31.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,9 +1,52 @@
1
- import { A as BlockContent, An as Table, Jt as ParagraphMarkChange, Kt as Paragraph, Wr as TextFormatting, Xt as ParagraphPropertyChange, kr as ParagraphFormatting, n as Document, qt as ParagraphContent, zn as TableRow } from "../document-DrtmJ_hz.js";
1
+ import { $t as ParagraphMarkChange, Br as TableCellFormatting, Dr as NumberingDefinitions, Fn as Table, Kr as TableRowFormatting, M as BlockContent, Or as NumberingInstance, Pn as TabContent, Pr as ParagraphFormatting, Qt as ParagraphContent, R as BreakContent, Vr as TableFormatting, Wn as TableRow, X as DocumentBody, Yr as TextFormatting, Zt as Paragraph, _t as INSERTION_SEAM_POLICIES, bn as SectionProperties, c as ExhaustiveFields, i as DocumentSettings, mn as RunContent, mt as HeaderFooterType, nt as Endnote, o as DocxPackage, pn as Run, pt as HeaderFooter, r as Document, tn as ParagraphPropertyChange, ut as Footnote, vr as AbstractNumbering, yn as Section } from "../document-w6pPLpob.js";
2
2
  import { Result } from "better-result";
3
+ //#region src/ops/noteMarks.d.ts
4
+ declare const noteUsesCustomMark: (document: Document, note: Footnote | Endnote) => boolean;
5
+ //#endregion
3
6
  //#region src/ops/types.d.ts
7
+ /** JSON-safe map presence, including an explicitly undefined section map. */
8
+ type SectionMapState = {
9
+ type: "omitted";
10
+ } | {
11
+ type: "undefined";
12
+ } | {
13
+ type: "entries";
14
+ value: readonly (readonly [HeaderFooterType, HeaderFooter])[];
15
+ };
16
+ /** Section content is derived from the body's canonical blocks. */
17
+ type SectionViewEntry = {
18
+ properties: SectionProperties;
19
+ headers: SectionMapState;
20
+ footers: SectionMapState;
21
+ };
22
+ /** Exact presence and metadata of the derived section view. */
23
+ type SectionViewState = {
24
+ type: "omitted";
25
+ } | {
26
+ type: "undefined";
27
+ } | {
28
+ type: "sections";
29
+ value: readonly SectionViewEntry[];
30
+ };
31
+ type SectionViewChange = {
32
+ expected: readonly SectionViewEntry[];
33
+ restore: readonly SectionViewEntry[];
34
+ };
4
35
  /**
5
36
  * The operation schema this module reads and writes.
6
37
  *
38
+ * Version 8 adds semantic table edits and exact whole-table restoration.
39
+ * Version 7 adds lossless own-undefined operation snapshot presence and
40
+ * explicit revision-boundary provenance. An explicit undefined patch value now
41
+ * sets an own undefined field; null removes it and an absent key is untouched.
42
+ * Older envelopes receive a structured
43
+ * unsupportedSchema refusal; no older deployed journal clients are supported.
44
+ * Version 6 extends PR6 schema 5 with numbering-instance creation, section-endpoint
45
+ * edits and JSON-safe exact section-map/view presence. Older envelopes receive an
46
+ * unsupportedSchema refusal; no older deployed journal clients are supported.
47
+ * Version 5 adds explicit section-boundary removal/restoration and separately
48
+ * rejectable paragraph-property reviews over an existing revision.
49
+ * Version 5 adds header/footer/note story addresses and exact lifecycle operations.
7
50
  * Version 4 adds paragraph deletion through `deleteBlocks`, direct and tracked
8
51
  * whole-table operations with their exact structural inverse, terminal insertion,
9
52
  * and cell-ending paragraph marks on tracked row operations.
@@ -13,16 +56,24 @@ import { Result } from "better-result";
13
56
  * and paragraph operations, and the review operations `setParagraphReview`,
14
57
  * `replaceInline` and `resolveRevision`.
15
58
  */
16
- declare const DOCUMENT_OP_SCHEMA_VERSION = 4;
59
+ declare const DOCUMENT_OP_SCHEMA_VERSION = 8;
17
60
  /**
18
- * The stories an operation can address. Headers, footers, notes and comment
19
- * bodies are stories too; this version addresses the main story only.
61
+ * The main story has a fixed address; other editable parts use their stable
62
+ * relationship id or note id. Comment bodies are not yet editable stories.
20
63
  */
21
64
  declare const OP_STORIES: Readonly<{
22
65
  readonly MAIN: "main";
23
66
  }>;
24
- /** One of {@link OP_STORIES}. */
25
- type OpStory = (typeof OP_STORIES)[keyof typeof OP_STORIES];
67
+ /** The stable identity of an independently editable package story. */
68
+ type HeaderFooterStory = {
69
+ kind: "header" | "footer";
70
+ rId: string;
71
+ };
72
+ type NoteStory = {
73
+ kind: "footnote" | "endnote";
74
+ id: number;
75
+ };
76
+ type OpStory = typeof OP_STORIES.MAIN | HeaderFooterStory | NoteStory;
26
77
  /**
27
78
  * A point in one paragraph's logical offset space.
28
79
  *
@@ -43,10 +94,10 @@ type TextPosition = {
43
94
  zeroWidthBefore?: number;
44
95
  };
45
96
  /**
46
- * Per-key change to a property set: a value sets the key, `null` clears it,
47
- * and a key the patch leaves out is untouched.
97
+ * Per-key change: a value, including explicit undefined, sets an owned key;
98
+ * null removes the key, and an omitted key is untouched.
48
99
  */
49
- type FormattingPatch<Formatting> = { readonly [Key in keyof Formatting]?: Exclude<Formatting[Key], undefined> | null; };
100
+ type FormattingPatch<Formatting> = { readonly [Key in keyof Formatting]?: Formatting[Key] | null | undefined; };
50
101
  /** A change to a run property set (`w:rPr`). */
51
102
  type RunPropsPatch = FormattingPatch<TextFormatting>;
52
103
  /** A change to a paragraph property set (`w:pPr`). */
@@ -115,8 +166,19 @@ type RevisionStamp = {
115
166
  };
116
167
  /** The paragraph fields a split gives the new paragraph, besides its id, content and mark. */
117
168
  type SplitParagraphFields = Omit<Paragraph, "type" | "paraId" | "content" | "sectionProperties" | "pPrMark">;
118
- /** The operation kinds of schema version 4. */
169
+ /** Explicit structural and review policies for editor intent compilation. */
170
+ declare const SECTION_BOUNDARY_POLICIES: Readonly<{
171
+ readonly REMOVE: "remove";
172
+ readonly REPLACE: "replace";
173
+ }>;
174
+ /** The operation kinds of schema version 8. */
119
175
  declare const DOCUMENT_OP_TYPES: Readonly<{
176
+ readonly CREATE_HEADER_FOOTER: "createHeaderFooter";
177
+ readonly REMOVE_HEADER_FOOTER: "removeHeaderFooter";
178
+ readonly ADD_NOTE: "addNote";
179
+ readonly REMOVE_NOTE: "removeNote";
180
+ readonly SET_SECTION_PROPS: "setSectionProps";
181
+ readonly RESTORE_STORY_PARTS: "restoreStoryParts";
120
182
  readonly DELETE_BLOCKS: "deleteBlocks";
121
183
  readonly INSERT_BLOCKS: "insertBlocks";
122
184
  readonly INSERT_TEXT: "insertText";
@@ -138,6 +200,18 @@ declare const DOCUMENT_OP_TYPES: Readonly<{
138
200
  readonly INSERT_ROW: "insertRow";
139
201
  readonly DELETE_ROW: "deleteRow";
140
202
  readonly SET_TABLE_ROWS: "setTableRows";
203
+ readonly INSERT_COLUMN: "insertColumn";
204
+ readonly DELETE_COLUMN: "deleteColumn";
205
+ readonly MERGE_CELLS: "mergeCells";
206
+ readonly SPLIT_CELL: "splitCell";
207
+ readonly SET_TABLE_GRID: "setTableGrid";
208
+ readonly SET_CELL_PROPS: "setCellProps";
209
+ readonly SET_ROW_PROPS: "setRowProps";
210
+ readonly SET_TABLE_PROPS: "setTableProps";
211
+ readonly SET_TABLE: "setTable";
212
+ readonly CREATE_NUMBERING_INSTANCE: "createNumberingInstance";
213
+ readonly DELETE_NUMBERING_INSTANCE: "deleteNumberingInstance";
214
+ readonly SET_SECTION_ENDPOINT: "setSectionEndpoint";
141
215
  }>;
142
216
  /** One of {@link DOCUMENT_OP_TYPES}. */
143
217
  type DocumentOpType = (typeof DOCUMENT_OP_TYPES)[keyof typeof DOCUMENT_OP_TYPES];
@@ -183,6 +257,7 @@ type InsertContentOp = {
183
257
  type: typeof DOCUMENT_OP_TYPES.INSERT_CONTENT;
184
258
  at: TextPosition;
185
259
  slice: InlineSlice;
260
+ seamPolicy?: typeof INSERTION_SEAM_POLICIES.MERGE_PLAIN_RUNS;
186
261
  newIds?: NewIds;
187
262
  revision?: RevisionStamp;
188
263
  };
@@ -239,6 +314,10 @@ type JoinInlineOp = {
239
314
  at: TextPosition;
240
315
  depth: number;
241
316
  };
317
+ /** Whether a tracked run patch appends an independently rejectable review. */
318
+ declare const PROPERTY_REVIEW_POLICIES: Readonly<{
319
+ readonly APPEND: "append";
320
+ }>;
242
321
  /**
243
322
  * Patch the run properties of every run between two positions of one
244
323
  * paragraph, splitting runs at the range ends. A run the patch does not change
@@ -256,6 +335,8 @@ type JoinInlineOp = {
256
335
  * set before the patch. A run already carrying one keeps it, and with it the
257
336
  * formatting it started from. A tracked patch joins nothing, so `joinStart`
258
337
  * and `joinEnd` must be absent.
338
+ * `propertyReview: "append"` records a separately rejectable action over
339
+ * existing review, preserving the current formatting as that action's baseline.
259
340
  */
260
341
  type SetRunPropsOp = {
261
342
  type: typeof DOCUMENT_OP_TYPES.SET_RUN_PROPS;
@@ -268,6 +349,7 @@ type SetRunPropsOp = {
268
349
  joinEnd?: number;
269
350
  newIds?: NewIds;
270
351
  revision?: RevisionStamp;
352
+ propertyReview?: typeof PROPERTY_REVIEW_POLICIES.APPEND;
271
353
  };
272
354
  /**
273
355
  * Patch a paragraph's own property set. `expected` states the values the
@@ -276,7 +358,8 @@ type SetRunPropsOp = {
276
358
  *
277
359
  * With `revision`, the paragraph records a tracked property change
278
360
  * (`w:pPrChange`) whose previous formatting is its own property set before
279
- * the patch, or keeps the one it already carries. A property change holds
361
+ * the patch, or folds into the one it already carries: its original baseline and
362
+ * id stay, and its author/date become the latest stamp. A property change holds
280
363
  * paragraph properties only, not the paragraph mark's run properties, so a
281
364
  * tracked patch of {@link PARAGRAPH_MARK_FORMATTING_KEYS} is refused.
282
365
  */
@@ -339,6 +422,9 @@ type SplitBlockOp = {
339
422
  newHalf?: SplitHalf;
340
423
  newParagraph?: SplitParagraphFields;
341
424
  firstMark?: ParagraphMarkChange;
425
+ /** Exact inverse restoration of a removed section boundary on the first half. */
426
+ firstSectionProperties?: SectionProperties;
427
+ sectionView?: SectionViewChange;
342
428
  newIds?: NewIds;
343
429
  revision?: RevisionStamp;
344
430
  };
@@ -349,8 +435,9 @@ type SplitBlockOp = {
349
435
  * run properties, section break, tracked change and the pending property
350
436
  * changes. It keeps the identity and own fields of the
351
437
  * `survivor` half, by default the second, and the other's id is retired.
352
- * `depth` merges that many levels of the records meeting at the join, as
353
- * {@link JoinInlineOp} does.
438
+ * An absent or zero `depth` merges the two plain runs at the seam when the
439
+ * parser would merge them. A positive `depth` merges that many levels of the
440
+ * records meeting at the join, as {@link JoinInlineOp} does.
354
441
  *
355
442
  * `expectedRetired` states the own fields of the paragraph the join retires,
356
443
  * and `expectedSurvivor` the review fields of the one it keeps, which the
@@ -363,7 +450,8 @@ type SplitBlockOp = {
363
450
  * the direct join would give it as a tracked property change. Accepting removes the mark, which
364
451
  * leaves the second paragraph with the first's content before its own: what
365
452
  * the direct join leaves. A tracked join always leaves the second, so
366
- * `survivor` must then be absent or `second`.
453
+ * `survivor` must then be absent or `second`, and `depth` absent or zero: the
454
+ * paragraph mark cannot record an inline merge depth.
367
455
  */
368
456
  type JoinBlocksOp = {
369
457
  type: typeof DOCUMENT_OP_TYPES.JOIN_BLOCKS;
@@ -374,6 +462,9 @@ type JoinBlocksOp = {
374
462
  survivor?: SplitHalf;
375
463
  expectedRetired?: SplitParagraphFields;
376
464
  expectedSurvivor?: ParagraphReviewFields;
465
+ /** Explicitly remove the first paragraph's section boundary with its mark. */
466
+ sectionBoundary?: typeof SECTION_BOUNDARY_POLICIES.REMOVE;
467
+ sectionView?: SectionViewChange;
377
468
  newIds?: NewIds;
378
469
  revision?: RevisionStamp;
379
470
  };
@@ -436,6 +527,9 @@ type ReplaceBlocksOp = {
436
527
  story: OpStory;
437
528
  expected: readonly Paragraph[];
438
529
  blocks: readonly Paragraph[];
530
+ /** Exact structural replacement may intentionally change section boundaries. */
531
+ sectionBoundaries?: typeof SECTION_BOUNDARY_POLICIES.REPLACE;
532
+ sectionView?: SectionViewChange;
439
533
  };
440
534
  /**
441
535
  * A paragraph's review fields: its paragraph properties, their tracked change
@@ -557,6 +651,54 @@ type SetTableRowsOp = {
557
651
  expected: readonly TableRow[];
558
652
  rows: readonly TableRow[];
559
653
  };
654
+ /** Whether the package numbering part was omitted, explicitly undefined, or present. */
655
+ type NumberingPartState = {
656
+ type: "omitted";
657
+ } | {
658
+ type: "undefined";
659
+ } | {
660
+ type: "definitions";
661
+ value: NumberingDefinitions;
662
+ };
663
+ /** Add a pre-allocated numbering instance and optional abstract definition. */
664
+ type CreateNumberingInstanceOp = {
665
+ type: typeof DOCUMENT_OP_TYPES.CREATE_NUMBERING_INSTANCE;
666
+ num: NumberingInstance;
667
+ abstractNum?: AbstractNumbering;
668
+ expected?: NumberingPartState;
669
+ restore?: NumberingPartState;
670
+ };
671
+ /** Remove the exact instance created by the paired operation. */
672
+ type DeleteNumberingInstanceOp = {
673
+ type: typeof DOCUMENT_OP_TYPES.DELETE_NUMBERING_INSTANCE;
674
+ num: NumberingInstance;
675
+ abstractNum?: AbstractNumbering;
676
+ expected?: NumberingPartState;
677
+ restore?: NumberingPartState;
678
+ };
679
+ /** A section endpoint is either a paragraph's sectPr or the body's final sectPr. */
680
+ type SectionEndpoint = {
681
+ type: "paragraph";
682
+ blockId: string;
683
+ } | {
684
+ type: "final";
685
+ };
686
+ type SectionPropertiesState = {
687
+ type: "omitted";
688
+ } | {
689
+ type: "undefined";
690
+ } | {
691
+ type: "present";
692
+ value: SectionProperties;
693
+ };
694
+ type SetSectionEndpointOp = {
695
+ type: typeof DOCUMENT_OP_TYPES.SET_SECTION_ENDPOINT;
696
+ endpoint: SectionEndpoint;
697
+ expected?: SectionPropertiesState;
698
+ properties: SectionPropertiesState;
699
+ expectedSectionMetadata?: SectionViewState;
700
+ sectionMetadata?: SectionViewState;
701
+ };
560
702
  /**
561
703
  * Insert a table before or after a paragraph. Tracking records each row,
562
704
  * cell content and cell-ending paragraph mark. At a container's end,
@@ -600,8 +742,124 @@ type SetContainerBlocksOp = {
600
742
  expected: readonly BlockContent[];
601
743
  blocks: readonly BlockContent[];
602
744
  };
603
- /** A schema-version-4 document operation. */
604
- type DocumentOp = DeleteBlocksOp | InsertTableOp | DeleteTableOp | SetContainerBlocksOp | InsertBlocksOp | InsertTextOp | InsertContentOp | DeleteRangeOp | SplitInlineOp | JoinInlineOp | SetRunPropsOp | SetParagraphPropsOp | SplitBlockOp | JoinBlocksOp | ReplaceBlocksOp | SetParagraphReviewOp | ReplaceInlineOp | ResolveRevisionOp | InsertRowOp | DeleteRowOp | SetTableRowsOp;
745
+ /** Create a deterministically identified part and bind it to one section variant. */
746
+ type CreateHeaderFooterOp = {
747
+ type: typeof DOCUMENT_OP_TYPES.CREATE_HEADER_FOOTER;
748
+ sectionIndex: number;
749
+ story: HeaderFooterStory;
750
+ referenceType: HeaderFooterType;
751
+ content: BlockContent[];
752
+ };
753
+ type RemoveHeaderFooterOp = {
754
+ type: typeof DOCUMENT_OP_TYPES.REMOVE_HEADER_FOOTER;
755
+ sectionIndex: number;
756
+ story: HeaderFooterStory;
757
+ referenceType: HeaderFooterType;
758
+ };
759
+ type AddNoteOp = {
760
+ type: typeof DOCUMENT_OP_TYPES.ADD_NOTE;
761
+ at: TextPosition;
762
+ note: Footnote | Endnote;
763
+ };
764
+ type RemoveNoteOp = {
765
+ type: typeof DOCUMENT_OP_TYPES.REMOVE_NOTE;
766
+ at: TextPosition;
767
+ story: NoteStory;
768
+ };
769
+ type SetSectionPropsOp = {
770
+ type: typeof DOCUMENT_OP_TYPES.SET_SECTION_PROPS;
771
+ sectionIndex: number;
772
+ patch: FormattingPatch<SectionProperties>;
773
+ };
774
+ /** JSON-safe lifecycle deltas: omitted fields are unowned, null restores absence. */
775
+ type StoryParts = {
776
+ body?: { [Key in keyof Omit<DocumentBody, "sections">]?: Key extends "content" ? DocumentBody[Key] : Exclude<DocumentBody[Key], undefined> | null; };
777
+ /** Section contents remain derived from the body's content and are never duplicated. */
778
+ sections?: readonly {
779
+ index: number;
780
+ properties?: Section["properties"];
781
+ headers?: readonly (readonly [HeaderFooterType, HeaderFooter])[] | null;
782
+ footers?: readonly (readonly [HeaderFooterType, HeaderFooter])[] | null;
783
+ }[];
784
+ headers?: readonly (readonly [string, HeaderFooter])[] | null;
785
+ footers?: readonly (readonly [string, HeaderFooter])[] | null;
786
+ footnotes?: readonly Footnote[] | null;
787
+ endnotes?: readonly Endnote[] | null;
788
+ settings?: DocumentSettings | null;
789
+ };
790
+ /** Exact stale-checked lifecycle inverse; unrelated package parts stay untouched. */
791
+ type RestoreStoryPartsOp = {
792
+ type: typeof DOCUMENT_OP_TYPES.RESTORE_STORY_PARTS;
793
+ expected: StoryParts;
794
+ parts: StoryParts;
795
+ };
796
+ /** A paragraph selects its innermost table; columns are logical grid slots. */
797
+ type TableEditTarget = {
798
+ story: OpStory;
799
+ blockId: string;
800
+ revision?: RevisionStamp;
801
+ newIds?: NewIds;
802
+ };
803
+ /** Insert before column (including the final boundary); fresh ids are in row order. */
804
+ type InsertColumnOp = TableEditTarget & {
805
+ type: typeof DOCUMENT_OP_TYPES.INSERT_COLUMN;
806
+ column: number;
807
+ width: number;
808
+ newBlockIds: readonly string[];
809
+ };
810
+ type DeleteColumnOp = TableEditTarget & {
811
+ type: typeof DOCUMENT_OP_TYPES.DELETE_COLUMN;
812
+ column: number;
813
+ };
814
+ /** Half-open logical rectangle; every touched span must be wholly contained. */
815
+ type MergeCellsOp = TableEditTarget & {
816
+ type: typeof DOCUMENT_OP_TYPES.MERGE_CELLS;
817
+ top: number;
818
+ bottom: number;
819
+ left: number;
820
+ right: number;
821
+ newBlockIds: readonly string[];
822
+ };
823
+ /** Split the addressed span into unit cells; the top-left cell keeps its content and identity. */
824
+ type SplitCellOp = TableEditTarget & {
825
+ type: typeof DOCUMENT_OP_TYPES.SPLIT_CELL;
826
+ newBlockIds: readonly string[];
827
+ };
828
+ /** Resize the existing logical grid without changing its topology. */
829
+ type SetTableGridOp = TableEditTarget & {
830
+ type: typeof DOCUMENT_OP_TYPES.SET_TABLE_GRID;
831
+ columnWidths: readonly number[];
832
+ };
833
+ type SetCellPropsOp = TableEditTarget & {
834
+ type: typeof DOCUMENT_OP_TYPES.SET_CELL_PROPS;
835
+ patch: FormattingPatch<TableCellFormatting>;
836
+ };
837
+ type SetRowPropsOp = TableEditTarget & {
838
+ type: typeof DOCUMENT_OP_TYPES.SET_ROW_PROPS;
839
+ patch: FormattingPatch<TableRowFormatting>;
840
+ };
841
+ type SetTablePropsOp = TableEditTarget & {
842
+ type: typeof DOCUMENT_OP_TYPES.SET_TABLE_PROPS;
843
+ patch: FormattingPatch<TableFormatting>;
844
+ };
845
+ /** Exact inverse/resolution primitive, including grid and captured markup. */
846
+ type SetTableOp = {
847
+ type: typeof DOCUMENT_OP_TYPES.SET_TABLE;
848
+ story: OpStory;
849
+ blockId: string;
850
+ expected: Table;
851
+ table: Table;
852
+ };
853
+ type TableEditOp = InsertColumnOp | DeleteColumnOp | MergeCellsOp | SplitCellOp | SetTableGridOp | SetCellPropsOp | SetRowPropsOp | SetTablePropsOp;
854
+ /** Table intent ids are derived from topology by the shared compiler. */
855
+ type TableIntentOperation = { [Kind in TableEditOp["type"]]: Omit<Extract<TableEditOp, {
856
+ type: Kind;
857
+ }>, "revision" | "newIds" | "newBlockIds">; }[TableEditOp["type"]];
858
+ /** A schema-version-8 document operation. */
859
+ type DocumentOp = (CreateHeaderFooterOp | RemoveHeaderFooterOp | AddNoteOp | RemoveNoteOp | SetSectionPropsOp | RestoreStoryPartsOp | DeleteBlocksOp | InsertTableOp | DeleteTableOp | SetContainerBlocksOp | InsertBlocksOp | InsertTextOp | InsertContentOp | DeleteRangeOp | SplitInlineOp | JoinInlineOp | SetRunPropsOp | SetParagraphPropsOp | SplitBlockOp | JoinBlocksOp | ReplaceBlocksOp | SetParagraphReviewOp | ReplaceInlineOp | ResolveRevisionOp | InsertRowOp | DeleteRowOp | SetTableRowsOp | TableEditOp | SetTableOp | CreateNumberingInstanceOp | DeleteNumberingInstanceOp | SetSectionEndpointOp) & {
860
+ /** Own undefined fields recorded by the operation capture boundary. */
861
+ undefinedFields?: readonly (readonly string[])[];
862
+ };
605
863
  /**
606
864
  * An operation as it is journaled and sent: the schema that reads it, and the
607
865
  * operation. A reader refuses an envelope of a schema it does not know rather
@@ -620,14 +878,35 @@ type TouchedBlocks = {
620
878
  removed: readonly string[];
621
879
  };
622
880
  //#endregion
881
+ //#region src/ops/edits.d.ts
882
+ /** What applying operations produced: the document, its inverse, and the blocks it changed. */
883
+ type DocumentEdit = {
884
+ document: Document;
885
+ /** Apply in order to restore the input document. */
886
+ inverse: readonly DocumentOp[];
887
+ touched: TouchedBlocks;
888
+ };
889
+ /** Edits made in turn, starting from `document`, as one edit. */
890
+ declare const combineEdits: (document: Document, edits: readonly DocumentEdit[]) => DocumentEdit;
891
+ //#endregion
623
892
  //#region src/ops/refusal.d.ts
624
893
  /**
625
894
  * Why an operation was not applied. A refused operation changes nothing: the
626
895
  * document it was applied to is returned as it was.
627
896
  */
628
897
  declare const DOCUMENT_OP_REFUSAL_REASONS: Readonly<{
898
+ /** The journal envelope uses a schema this reader does not implement. */
899
+ readonly UNSUPPORTED_SCHEMA: "unsupportedSchema";
629
900
  /** No paragraph in the story carries the id. */
630
901
  readonly BLOCK_NOT_FOUND: "blockNotFound";
902
+ /** A raw operation is missing required fields or supplies their wrong shape. */
903
+ readonly INVALID_OPERATION: "invalidOperation";
904
+ /** Removing a column would leave a row with no active cells. */
905
+ readonly TABLE_ROW_EMPTY: "tableRowEmpty";
906
+ /** The requested topology edit changes nothing. */
907
+ readonly NO_CHANGE: "noChange";
908
+ /** Removed content carries anchors or review records that require coordinated resolution. */
909
+ readonly DEPENDENT_RECORDS: "dependentRecords";
631
910
  /** An offset is not an integer from `0` to the paragraph's length, or a range runs backwards. */
632
911
  readonly INVALID_OFFSET: "invalidOffset";
633
912
  /** A range starts and ends in different paragraphs or stories. */
@@ -716,9 +995,22 @@ declare const DocumentOpRefusal_base: import("better-result").TaggedErrorClass<"
716
995
  declare class DocumentOpRefusal extends DocumentOpRefusal_base<{
717
996
  message: string;
718
997
  reason: DocumentOpRefusalReason;
719
- opType: DocumentOpType;
998
+ opType: DocumentOpType | undefined;
720
999
  }> {}
721
1000
  //#endregion
1001
+ //#region src/ops/storyLifecycle.d.ts
1002
+ declare const sectionPropertiesAt: (document: Document, sectionIndex: number) => SectionProperties | undefined;
1003
+ //#endregion
1004
+ //#region src/ops/stories.d.ts
1005
+ declare const sameStory: (left: OpStory, right: OpStory) => boolean;
1006
+ declare const findStoryBody: (document: Document, story: OpStory) => DocumentBody | undefined;
1007
+ declare const storyBody: (document: Document, story: OpStory) => DocumentBody;
1008
+ declare const documentStories: (document: Document) => OpStory[];
1009
+ //#endregion
1010
+ //#region src/ops/wire.d.ts
1011
+ /** Capture own undefined fields before an operation enters its JSON journal. */
1012
+ declare const captureDocumentOp: (op: DocumentOp) => DocumentOp;
1013
+ //#endregion
722
1014
  //#region src/ops/apply.d.ts
723
1015
  /** A document an operation produced, the operations that undo it, and what it changed. */
724
1016
  type AppliedDocumentOp = {
@@ -727,15 +1019,19 @@ type AppliedDocumentOp = {
727
1019
  inverse: readonly DocumentOp[];
728
1020
  touched: TouchedBlocks;
729
1021
  /**
730
- * The revision ids of the tracked changes the operation recorded, in
731
- * document order: its stamp's id and the new ids its other records took.
732
- * Empty for a direct operation, and for a tracked one that merged into a
733
- * change carrying the same stamp.
1022
+ * Newly allocated tracked revision ids, in document order: its stamp's
1023
+ * id and the new ids its other records took. Existing ids retained by a
1024
+ * folded or continued review are excluded; a direct operation reports none.
734
1025
  */
735
1026
  revisions: readonly number[];
736
1027
  };
737
1028
  /** Apply one operation to a document that meets the seed contract. */
738
- declare const applyDocumentOp: (document: Document, op: DocumentOp) => Result<AppliedDocumentOp, DocumentOpRefusal>;
1029
+ declare const applyDocumentOp: (document: Document, input: DocumentOp) => Result<AppliedDocumentOp, DocumentOpRefusal>;
1030
+ /** Apply a journal envelope only when its schema matches this reader. */
1031
+ declare const applyDocumentOpEnvelope: (document: Document, envelope: {
1032
+ schema: number;
1033
+ op: DocumentOp;
1034
+ }) => Result<AppliedDocumentOp, DocumentOpRefusal>;
739
1035
  /**
740
1036
  * Apply operations in order, atomically: the first refusal is returned and
741
1037
  * the document is unchanged. The inverse undoes the whole list, and
@@ -743,6 +1039,164 @@ declare const applyDocumentOp: (document: Document, op: DocumentOp) => Result<Ap
743
1039
  */
744
1040
  declare const applyDocumentOps: (document: Document, ops: readonly DocumentOp[]) => Result<AppliedDocumentOp, DocumentOpRefusal>;
745
1041
  //#endregion
1042
+ //#region src/ops/runMerge.d.ts
1043
+ /**
1044
+ * Every `TextFormatting` field, named so the comparison below is total.
1045
+ *
1046
+ * A field this comparison forgets is a field one of two merged runs loses,
1047
+ * silently and at parse time. Naming them turns a field added to the model
1048
+ * without a comparison into a compile error rather than a fidelity defect.
1049
+ */
1050
+ type ComparedTextFormattingField = "bold" | "boldCs" | "italic" | "italicCs" | "underline" | "strike" | "doubleStrike" | "vertAlign" | "smallCaps" | "allCaps" | "hidden" | "noProof" | "color" | "highlight" | "shading" | "fontSize" | "fontSizeCs" | "fontFamily" | "language" | "spacing" | "position" | "scale" | "kerning" | "effect" | "emphasisMark" | "emboss" | "imprint" | "outline" | "shadow" | "rtl" | "cs" | "styleId" | "preserved";
1051
+ type ComparedTextFormatting = ExhaustiveFields<TextFormatting, ComparedTextFormattingField>;
1052
+ /**
1053
+ * Check if two TextFormatting objects are equivalent
1054
+ *
1055
+ * Uses deep comparison of all properties to determine if runs
1056
+ * can be merged without losing formatting information.
1057
+ */
1058
+ declare function formattingEquals(a: ComparedTextFormatting | undefined, b: ComparedTextFormatting | undefined): boolean;
1059
+ /**
1060
+ * Check if a run contains only text content
1061
+ * (runs with special content like images, fields, etc. should not be merged)
1062
+ */
1063
+ declare function isTextOnlyRun(run: Run): boolean;
1064
+ /**
1065
+ * Every `Run` field, named by what a merge does with it.
1066
+ *
1067
+ * The merged run is the survivor spread whole, so a field added to the model
1068
+ * is carried over from one side by default. Naming each one here forces the
1069
+ * next field to state whether that default is right before it can compile.
1070
+ */
1071
+ type MergeDecidedRunField =
1072
+ /** Identical for every run. */
1073
+ "type" |
1074
+ /** Concatenated; see {@link mergeRunContent}. */
1075
+ "content" |
1076
+ /** Must be equal, and the survivor keeps it. */
1077
+ "formatting" |
1078
+ /** Must be equal, and the survivor keeps it. */
1079
+ "preservedAttributes" |
1080
+ /** Refuses the merge outright; see {@link canMergeRun}. */
1081
+ "propertyChanges";
1082
+ type MergeDecidedRun = ExhaustiveFields<Run, MergeDecidedRunField>;
1083
+ /**
1084
+ * May two adjacent runs become one?
1085
+ *
1086
+ * Every consolidation site asks this one question, because a merge that any
1087
+ * one site decides differently is a merge the next parse undoes. A run holds
1088
+ * three records a merged run can hold only one of: its typed formatting, the
1089
+ * attributes `w:r` carried that the model has no field for, and the `w:rPr`
1090
+ * children no reader took a value from. Merging two runs that disagree on any
1091
+ * of them discards the loser's copy, which is how both runs' `w:rsid*` used to
1092
+ * vanish at parse time — before the editor, before any gate could see it.
1093
+ */
1094
+ declare function runsMergeable(a: MergeDecidedRun, b: MergeDecidedRun): boolean;
1095
+ /**
1096
+ * Merge the content of two runs into a single content array
1097
+ */
1098
+ declare function mergeRunContent(content1: RunContent[], content2: RunContent[]): RunContent[];
1099
+ //#endregion
1100
+ //#region src/ops/editorIntent.d.ts
1101
+ type SplitParagraphIntent = {
1102
+ type: "splitParagraph";
1103
+ at: TextPosition;
1104
+ to?: TextPosition;
1105
+ };
1106
+ /** Positions use canonical physical offsets, including retained deleted content. */
1107
+ type EditorIntent = {
1108
+ type: "table";
1109
+ operation: TableIntentOperation;
1110
+ } | {
1111
+ type: "replaceText";
1112
+ from: TextPosition;
1113
+ to: TextPosition;
1114
+ text: string;
1115
+ runProps?: TextFormatting;
1116
+ runPropsPatch?: RunPropsPatch;
1117
+ } | {
1118
+ type: "formatRun";
1119
+ from: TextPosition;
1120
+ to: TextPosition;
1121
+ patch: RunPropsPatch;
1122
+ } | {
1123
+ type: "formatParagraph";
1124
+ at: TextPosition;
1125
+ patch: ParagraphPropsPatch;
1126
+ } | {
1127
+ type: "setList";
1128
+ items: readonly {
1129
+ at: TextPosition;
1130
+ ilvl: number;
1131
+ }[];
1132
+ target: {
1133
+ type: "existing";
1134
+ numId: number;
1135
+ } | {
1136
+ type: "new";
1137
+ num: NumberingInstance;
1138
+ abstractNum?: AbstractNumbering;
1139
+ };
1140
+ } | {
1141
+ type: "insertAtom";
1142
+ from: TextPosition;
1143
+ to: TextPosition;
1144
+ atom: TabContent | BreakContent;
1145
+ runProps?: TextFormatting;
1146
+ runPropsPatch?: RunPropsPatch;
1147
+ } | (SplitParagraphIntent & {
1148
+ newBlockId: string;
1149
+ }) | {
1150
+ type: "joinParagraphs";
1151
+ story: OpStory;
1152
+ blockId: string;
1153
+ nextBlockId: string;
1154
+ };
1155
+ /** Revision metadata and every fresh identity are supplied before compilation. */
1156
+ type EditorIntentMode = {
1157
+ type: "editing";
1158
+ newIds?: NewIds;
1159
+ } | {
1160
+ type: "suggesting";
1161
+ revision: RevisionStamp;
1162
+ newIds: NewIds;
1163
+ };
1164
+ type CompileEditorIntentOptions = {
1165
+ intent: EditorIntent;
1166
+ mode: EditorIntentMode;
1167
+ };
1168
+ type CompiledEditorIntent = {
1169
+ ops: DocumentOp[];
1170
+ selection: TextPosition;
1171
+ };
1172
+ /** A split's paragraph identity is allocated with its other fresh identities. */
1173
+ type EditorIntentAllocation = EditorIntent | SplitParagraphIntent;
1174
+ /** Cache only immutable document versions; never retain a retired version strongly. */
1175
+ declare const createEditorIntentIdAllocator: () => (document: Document, intent: EditorIntentAllocation) => {
1176
+ revisionId: number;
1177
+ newBlockId: string;
1178
+ newIds: {
1179
+ revision: number[];
1180
+ control: number[];
1181
+ };
1182
+ };
1183
+ /** Accepted-view text without changing the canonical paragraph or its offset space. */
1184
+ declare const paragraphVisibleText: (paragraph: Paragraph) => string;
1185
+ /**
1186
+ * Right-affine translation: a visible gap follows retained deleted content at
1187
+ * that gap, so a new insertion never lands inside a deletion wrapper.
1188
+ * Invalid offsets remain invalid for the operation boundary to diagnose.
1189
+ */
1190
+ declare const physicalOffsetAtVisibleOffset: (paragraph: Paragraph, offset: number) => number;
1191
+ /** Deleted paragraph marks concatenate physical paragraphs in the editing view. */
1192
+ declare const editorParagraphGroups: (document: Document, story: OpStory) => {
1193
+ blockId: string;
1194
+ paragraphs: Paragraph[];
1195
+ text: string;
1196
+ }[];
1197
+ /** Compile one batch; the caller applies it atomically and journals its exact inverse. */
1198
+ declare const compileEditorIntent: (document: Document, { intent, mode }: CompileEditorIntentOptions) => Result<CompiledEditorIntent, DocumentOpRefusal>;
1199
+ //#endregion
746
1200
  //#region src/ops/contract.d.ts
747
1201
  declare const DocumentOpsContractError_base: import("better-result").TaggedErrorClass<"DocumentOpsContractError">;
748
1202
  /** A document that does not meet the seed contract. */
@@ -753,7 +1207,7 @@ declare class DocumentOpsContractError extends DocumentOpsContractError_base<{
753
1207
  /** Check a document against the seed contract. */
754
1208
  declare const validateOpsDocument: (document: Document) => Result<Document, DocumentOpsContractError>;
755
1209
  /**
756
- * The document with every empty run and empty text node of the main story
1210
+ * The document with every empty run and empty text node of each editable story
757
1211
  * removed, and its section view derived again. Nothing else changes.
758
1212
  */
759
1213
  declare const normalizeForOps: (document: Document) => Document;
@@ -770,6 +1224,10 @@ declare const OBJECT_REPLACEMENT_CHARACTER = "";
770
1224
  */
771
1225
  declare const paragraphLogicalText: (paragraph: Paragraph) => string;
772
1226
  //#endregion
1227
+ //#region src/ops/ids.d.ts
1228
+ /** Every paragraph id of a package, each story walked once. */
1229
+ declare const packageParagraphIds: (pkg: DocxPackage) => string[];
1230
+ //#endregion
773
1231
  //#region src/ops/plan.d.ts
774
1232
  /**
775
1233
  * How many `newIds.revision` entries an operation takes on a document,
@@ -804,6 +1262,9 @@ declare const planTrackedDeletion: (document: Document, options: PlanTrackedDele
804
1262
  * fragment, and section-bearing paragraphs, are unsupported.
805
1263
  */
806
1264
  type PlanTrackedReplaceOptions = PlanTrackedDeletionOptions & {
1265
+ seamPolicy?: Extract<DocumentOp, {
1266
+ type: "insertContent";
1267
+ }>["seamPolicy"];
807
1268
  replacement: {
808
1269
  paragraphs: readonly Paragraph[];
809
1270
  tail: InlineSlice;
@@ -816,4 +1277,109 @@ type PlanTrackedReplaceOptions = PlanTrackedDeletionOptions & {
816
1277
  */
817
1278
  declare const planTrackedReplace: (document: Document, options: PlanTrackedReplaceOptions) => Result<DocumentOp[], DocumentOpRefusal>;
818
1279
  //#endregion
819
- export { type AppliedDocumentOp, type BlockInsertionPoint, DOCUMENT_OP_REFUSAL_REASONS, DOCUMENT_OP_SCHEMA_VERSION, DOCUMENT_OP_TYPES, type DeleteBlocksOp, type DeleteRangeOp, type DeleteRowOp, type DeleteTableOp, type DocumentOp, type DocumentOpEnvelope, DocumentOpRefusal, type DocumentOpRefusalReason, type DocumentOpType, DocumentOpsContractError, EMPTY_PROPERTY_SETS, type EmptyPropertySet, type FormattingPatch, INHERIT_RUN_PROPS, type InlineSlice, type InsertBlocksOp, type InsertContentOp, type InsertRowOp, type InsertTableOp, type InsertTextOp, type InsertedRunProps, type JoinBlocksOp, type JoinInlineOp, type NewIds, OBJECT_REPLACEMENT_CHARACTER, OP_STORIES, type OpStory, PARAGRAPH_MARK_FORMATTING_KEYS, type ParagraphPropsPatch, type ParagraphReviewFields, type PlanTrackedDeletionOptions, type PlanTrackedReplaceOptions, REVISION_DECISIONS, type ReplaceBlocksOp, type ReplaceInlineOp, type ResolveRevisionOp, type RevisionDecision, type RevisionStamp, type RunPropsPatch, SPLIT_HALVES, type SetContainerBlocksOp, type SetParagraphPropsOp, type SetParagraphReviewOp, type SetRunPropsOp, type SetTableRowsOp, type SplitBlockOp, type SplitHalf, type SplitInlineOp, type SplitParagraphFields, type TextPosition, type TouchedBlocks, applyDocumentOp, applyDocumentOps, normalizeForOps, paragraphLength, paragraphLogicalText, planTrackedDeletion, planTrackedReplace, revisionIdDemand, toOpEnvelope, validateOpsDocument };
1280
+ //#region src/ops/sequencing/envelope.d.ts
1281
+ /** A batch applies atomically, in array order, against its stated revision. */
1282
+ type DocumentBatch = {
1283
+ schema: typeof DOCUMENT_OP_SCHEMA_VERSION;
1284
+ opId: string;
1285
+ /** Opaque actor identity; authentication belongs to the caller. */
1286
+ actor: string;
1287
+ baseRev: number;
1288
+ ops: readonly DocumentOp[];
1289
+ revision?: number;
1290
+ };
1291
+ /** An operation with no position or structural effect. */
1292
+ declare const NO_SEQUENCED_EFFECT = "none";
1293
+ /** Document-dependent facts captured when an operation is sequenced. */
1294
+ type SequencedOpEffect = {
1295
+ type: "splitBlock";
1296
+ newHalf: SplitHalf;
1297
+ } | {
1298
+ type: "joinBlocks";
1299
+ firstLength: number;
1300
+ } | {
1301
+ type: "touchedBlocks";
1302
+ blockIds: readonly string[];
1303
+ } | {
1304
+ type: typeof NO_SEQUENCED_EFFECT;
1305
+ };
1306
+ type SequencedBatch = DocumentBatch & {
1307
+ revision: number;
1308
+ effects?: readonly SequencedOpEffect[];
1309
+ };
1310
+ declare const BATCH_REJECTION_REASONS: {
1311
+ readonly INVALID_BATCH: "invalidBatch";
1312
+ readonly UNSUPPORTED_SCHEMA: "unsupportedSchema";
1313
+ readonly UNSUPPORTED_PAIR: "unsupportedPair";
1314
+ readonly CONFLICT: "conflict";
1315
+ readonly STALE_BASE: "staleBase";
1316
+ readonly INVALID_OPERATION: "invalidOperation";
1317
+ readonly TABLE_REQUIRES_EXCLUSIVE_EDIT: "tableRequiresExclusiveEdit";
1318
+ };
1319
+ type BatchRejectionReason = (typeof BATCH_REJECTION_REASONS)[keyof typeof BATCH_REJECTION_REASONS];
1320
+ declare const BatchRejection_base: import("better-result").TaggedErrorClass<"BatchRejection">;
1321
+ declare class BatchRejection extends BatchRejection_base<{
1322
+ message: string;
1323
+ reason: BatchRejectionReason;
1324
+ opId?: string;
1325
+ opType?: DocumentOpType;
1326
+ overType?: DocumentOpType;
1327
+ }> {}
1328
+ declare const BATCH_WIRE_OP_TYPES: readonly string[];
1329
+ /** Bound recursion and refuse values except JSON data and absent object fields. */
1330
+ declare const MAX_BATCH_WIRE_BYTES: number;
1331
+ /** Decode a JSON-shaped batch, refusing unsupported payloads before apply. */
1332
+ declare const validateDocumentBatch: (value: unknown) => Result<DocumentBatch, BatchRejection>;
1333
+ /** Validate an assigned revision and any document-dependent effect metadata. */
1334
+ declare const validateSequencedBatch: (value: unknown) => Result<SequencedBatch, BatchRejection>;
1335
+ /** Parse the wire representation without propagating parser exceptions. */
1336
+ declare const parseDocumentBatch: (json: string) => Result<DocumentBatch, BatchRejection>;
1337
+ //#endregion
1338
+ //#region src/ops/sequencing/transform.d.ts
1339
+ type TransformOptions = {
1340
+ order?: "before" | "after";
1341
+ };
1342
+ /** Rebase an atomic batch over an ordered journal tail. */
1343
+ declare const transformBatch: (batch: DocumentBatch, over: readonly SequencedBatch[], options?: TransformOptions) => Result<DocumentBatch, BatchRejection>;
1344
+ //#endregion
1345
+ //#region src/ops/sequencing/sequencer.d.ts
1346
+ type BatchAck = {
1347
+ type: "ack";
1348
+ opId: string;
1349
+ rev: number;
1350
+ };
1351
+ type BatchReject = {
1352
+ type: "reject";
1353
+ opId: string;
1354
+ reason: BatchRejection;
1355
+ headRev: number;
1356
+ };
1357
+ type BatchSubmission = BatchAck | BatchReject;
1358
+ /** Deterministic append-only authority; the caller supplies delivery and storage. */
1359
+ declare const createSequencer: (document: Document) => {
1360
+ submit: (batch: DocumentBatch) => BatchSubmission;
1361
+ readonly document: Document;
1362
+ readonly headRev: number;
1363
+ readonly broadcasts: readonly SequencedBatch[];
1364
+ };
1365
+ //#endregion
1366
+ //#region src/ops/sequencing/client.d.ts
1367
+ type ClientNotice = {
1368
+ opId: string;
1369
+ reason: BatchRejection;
1370
+ ops: readonly DocumentOp[];
1371
+ };
1372
+ /** Optimistic state with ordered authoritative replay and one causal submission in flight. */
1373
+ declare const createClient: (document: Document) => {
1374
+ enqueue: (batch: DocumentBatch) => Result<DocumentBatch, BatchRejection>;
1375
+ nextSubmission: () => DocumentBatch | undefined;
1376
+ receiveAck: (ack: BatchAck) => void;
1377
+ receiveReject: (rejection: BatchReject) => void;
1378
+ receiveBroadcast: (batch: SequencedBatch) => Result<void, BatchRejection>;
1379
+ readonly document: Document;
1380
+ readonly headRev: number;
1381
+ readonly pending: readonly DocumentBatch[];
1382
+ readonly notices: readonly ClientNotice[];
1383
+ };
1384
+ //#endregion
1385
+ export { type AddNoteOp, type AppliedDocumentOp, BATCH_REJECTION_REASONS, BATCH_WIRE_OP_TYPES, BatchRejection, type BatchRejectionReason, type BlockInsertionPoint, type CreateHeaderFooterOp, type CreateNumberingInstanceOp, DOCUMENT_OP_REFUSAL_REASONS, DOCUMENT_OP_SCHEMA_VERSION, DOCUMENT_OP_TYPES, type DeleteBlocksOp, type DeleteColumnOp, type DeleteNumberingInstanceOp, type DeleteRangeOp, type DeleteRowOp, type DeleteTableOp, type DocumentBatch, type DocumentOp, type DocumentOpEnvelope, DocumentOpRefusal, type DocumentOpRefusalReason, type DocumentOpType, DocumentOpsContractError, EMPTY_PROPERTY_SETS, type EditorIntent, type EditorIntentMode, type EmptyPropertySet, type FormattingPatch, type HeaderFooterStory, INHERIT_RUN_PROPS, type InlineSlice, type InsertBlocksOp, type InsertColumnOp, type InsertContentOp, type InsertRowOp, type InsertTableOp, type InsertTextOp, type InsertedRunProps, type JoinBlocksOp, type JoinInlineOp, MAX_BATCH_WIRE_BYTES, type MergeCellsOp, type NewIds, type NoteStory, type NumberingPartState, OBJECT_REPLACEMENT_CHARACTER, OP_STORIES, type OpStory, PARAGRAPH_MARK_FORMATTING_KEYS, PROPERTY_REVIEW_POLICIES, type ParagraphPropsPatch, type ParagraphReviewFields, type PlanTrackedDeletionOptions, type PlanTrackedReplaceOptions, REVISION_DECISIONS, type RemoveHeaderFooterOp, type RemoveNoteOp, type ReplaceBlocksOp, type ReplaceInlineOp, type ResolveRevisionOp, type RestoreStoryPartsOp, type RevisionDecision, type RevisionStamp, type RunPropsPatch, SPLIT_HALVES, type SectionEndpoint, type SectionMapState, type SectionPropertiesState, type SectionViewEntry, type SectionViewState, type SequencedBatch, type SetCellPropsOp, type SetContainerBlocksOp, type SetParagraphPropsOp, type SetParagraphReviewOp, type SetRowPropsOp, type SetRunPropsOp, type SetSectionEndpointOp, type SetSectionPropsOp, type SetTableGridOp, type SetTableOp, type SetTablePropsOp, type SetTableRowsOp, type SplitBlockOp, type SplitCellOp, type SplitHalf, type SplitInlineOp, type SplitParagraphFields, type TableEditOp, type TableIntentOperation, type TextPosition, type TouchedBlocks, applyDocumentOp, applyDocumentOpEnvelope, applyDocumentOps, captureDocumentOp, combineEdits, compileEditorIntent, createClient, createEditorIntentIdAllocator, createSequencer, documentStories, editorParagraphGroups, findStoryBody, formattingEquals, isTextOnlyRun, mergeRunContent, normalizeForOps, noteUsesCustomMark, packageParagraphIds, paragraphLength, paragraphLogicalText, paragraphVisibleText, parseDocumentBatch, physicalOffsetAtVisibleOffset, planTrackedDeletion, planTrackedReplace, revisionIdDemand, runsMergeable, sameStory, sectionPropertiesAt, storyBody, toOpEnvelope, transformBatch, validateDocumentBatch, validateOpsDocument, validateSequencedBatch };