@extend-ai/react-docx 0.9.2 → 0.11.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.
package/dist/index.d.cts CHANGED
@@ -6,6 +6,9 @@ interface InitOutput {
6
6
  readonly memory: WebAssembly.Memory;
7
7
  readonly build_doc_model_from_bytes: (a: number, b: number, c: number) => void;
8
8
  readonly build_doc_model_from_package: (a: number, b: number) => void;
9
+ readonly extract_document_blocks_wasm: (a: number, b: number, c: number) => void;
10
+ readonly extract_document_blocks_with_options_wasm: (a: number, b: number, c: number, d: number, e: number) => void;
11
+ readonly inspect_document_source_wasm: (a: number, b: number, c: number) => void;
9
12
  readonly model_to_document_xml_from_json_wasm: (a: number, b: number, c: number, d: number) => void;
10
13
  readonly model_to_document_xml_wasm: (a: number, b: number, c: number) => void;
11
14
  readonly package_to_array_buffer_wasm: (a: number, b: number) => void;
@@ -63,15 +66,19 @@ interface TextRunBorderStyle {
63
66
  frame?: boolean;
64
67
  shadow?: boolean;
65
68
  }
69
+ type TextLigatures = "none" | "standard" | "contextual" | "historical" | "discretional" | "standardContextual" | "standardHistorical" | "contextualHistorical" | "standardDiscretional" | "contextualDiscretional" | "historicalDiscretional" | "standardContextualHistorical" | "standardContextualDiscretional" | "standardHistoricalDiscretional" | "contextualHistoricalDiscretional" | "all";
66
70
  interface TextStyle {
67
71
  bold?: boolean;
68
72
  italic?: boolean;
69
73
  underline?: boolean;
70
74
  strike?: boolean;
75
+ allCaps?: boolean;
76
+ smallCaps?: boolean;
71
77
  color?: string;
72
78
  highlight?: string;
73
79
  backgroundColor?: string;
74
80
  fontSizePt?: number;
81
+ fontSizeCsPt?: number;
75
82
  /** Resolved single-family fallback retained for backwards compatibility. */
76
83
  fontFamily?: string;
77
84
  /** @internal Import-time fallback used to detect fontFamily edits. */
@@ -101,6 +108,13 @@ interface TextStyle {
101
108
  rightToLeft?: boolean;
102
109
  complexScript?: boolean;
103
110
  characterSpacingTwips?: number;
111
+ /** Horizontal character width as an integer percentage; 100 is unscaled. */
112
+ characterScalePercent?: number;
113
+ sourceCharacterScale?: string;
114
+ /** Minimum font size in points at which OOXML kerning is enabled. */
115
+ kerningMinFontSizePt?: number;
116
+ ligatures?: TextLigatures;
117
+ contextualAlternates?: boolean;
104
118
  verticalAlign?: "superscript" | "subscript";
105
119
  runBorder?: TextRunBorderStyle;
106
120
  }
@@ -115,6 +129,10 @@ interface TextRunNode {
115
129
  };
116
130
  }
117
131
  interface ImageRunNode {
132
+ mathMl?: string;
133
+ blockId?: string;
134
+ contentNodes?: DocNode[];
135
+ semanticKind?: string;
118
136
  type: "image";
119
137
  src?: string;
120
138
  alt?: string;
@@ -205,6 +223,8 @@ interface ParagraphNumbering {
205
223
  interface ParagraphSpacing {
206
224
  beforeTwips?: number;
207
225
  afterTwips?: number;
226
+ beforeAutoSpacing?: boolean;
227
+ afterAutoSpacing?: boolean;
208
228
  lineTwips?: number;
209
229
  lineRule?: "auto" | "exact" | "atLeast";
210
230
  }
@@ -231,12 +251,35 @@ interface ParagraphBorderSet {
231
251
  bar?: ParagraphBorderStyle;
232
252
  }
233
253
  interface ParagraphTabStop {
234
- alignment?: "left" | "center" | "right" | "decimal" | "bar";
254
+ alignment?: "clear" | "left" | "center" | "right" | "decimal" | "bar";
235
255
  leader?: "none" | "dot" | "hyphen" | "underscore" | "middleDot";
236
256
  positionTwips?: number;
237
257
  }
258
+ type ParagraphTextAlignment = "auto" | "top" | "center" | "baseline" | "bottom";
238
259
  interface ParagraphStyle {
260
+ /** @internal Imported effective automatic before-spacing. */
261
+ sourceBeforeAutoSpacing?: boolean;
262
+ /** @internal Imported effective automatic after-spacing. */
263
+ sourceAfterAutoSpacing?: boolean;
239
264
  align?: ParagraphAlignment;
265
+ snapToGrid?: boolean;
266
+ /** @internal Imported effective document-grid snapping. */
267
+ sourceSnapToGrid?: boolean;
268
+ /** @internal Whether the imported paragraph had a direct grid property. */
269
+ sourceHasSnapToGrid?: boolean;
270
+ /** @internal Inherited grid setting exposed when a direct override is cleared. */
271
+ sourceInheritedSnapToGrid?: boolean;
272
+ /** @internal Table-style grid setting before paragraph-style overrides. */
273
+ sourceTableSnapToGrid?: boolean;
274
+ textAlignment?: ParagraphTextAlignment;
275
+ /** @internal Imported effective vertical character alignment. */
276
+ sourceTextAlignment?: ParagraphTextAlignment;
277
+ /** @internal Whether the imported paragraph had a direct alignment property. */
278
+ sourceHasTextAlignment?: boolean;
279
+ /** @internal Inherited alignment exposed when a direct override is cleared. */
280
+ sourceInheritedTextAlignment?: ParagraphTextAlignment;
281
+ /** @internal Table-style alignment before paragraph-style overrides. */
282
+ sourceTableTextAlignment?: ParagraphTextAlignment;
240
283
  headingLevel?: HeadingLevel;
241
284
  styleId?: string;
242
285
  styleName?: string;
@@ -263,12 +306,26 @@ interface ParagraphStyle {
263
306
  verticalSpaceTwips?: number;
264
307
  };
265
308
  }
309
+ /** @internal Imported mark layers before paragraph-style inheritance. */
310
+ interface ParagraphMarkFormattingSource {
311
+ defaultStyle?: TextStyle;
312
+ characterStyle?: TextStyle;
313
+ directStyle?: TextStyle;
314
+ }
266
315
  interface ParagraphNode {
267
316
  type: "paragraph";
268
317
  /** Stable identity for measurement caches; survives edits via cloneParagraph. */
269
318
  blockId?: string;
270
319
  children: ParagraphChildNode[];
271
320
  style?: ParagraphStyle;
321
+ /** Effective formatting of the paragraph-ending mark. */
322
+ paragraphMarkStyle?: TextStyle;
323
+ /** @internal Imported mark formatting used to detect changes. */
324
+ sourceParagraphMarkStyle?: TextStyle;
325
+ /** @internal Presence distinguishes imported mark layers from fresh marks. */
326
+ sourceParagraphMarkFormatting?: ParagraphMarkFormattingSource;
327
+ /** @internal Original paragraph mark properties retained during regeneration. */
328
+ sourceParagraphMarkPropertiesXml?: string;
272
329
  paragraphMarkDeleted?: boolean;
273
330
  sourceXml?: string;
274
331
  /** @internal Validated provenance for a surgical plain-text sourceXml patch. */
@@ -309,14 +366,43 @@ interface TableBorderSet {
309
366
  tl2br?: TableBorderStyle;
310
367
  tr2bl?: TableBorderStyle;
311
368
  }
369
+ /** dxa values are twips; pct values are ordinary percentages. */
370
+ type TablePreferredWidth = {
371
+ type: "dxa";
372
+ value: number;
373
+ } | {
374
+ type: "pct";
375
+ value: number;
376
+ } | {
377
+ type: "auto";
378
+ } | {
379
+ type: "nil";
380
+ };
381
+ /** @internal Imported baseline for edits through either width API. */
382
+ interface TableWidthSource {
383
+ preferredWidth?: TablePreferredWidth;
384
+ widthTwips?: number;
385
+ inheritedPreferredWidth?: TablePreferredWidth;
386
+ }
387
+ type TableAlignment = "left" | "center" | "right";
312
388
  interface TableCellStyle {
313
389
  backgroundColor?: string;
314
390
  gridSpan?: number;
315
391
  rowSpan?: number;
316
392
  vMergeContinuation?: boolean;
317
393
  widthTwips?: number;
394
+ preferredWidth?: TablePreferredWidth;
395
+ /** @internal */
396
+ sourceWidth?: TableWidthSource;
318
397
  marginTwips?: TableBoxSpacing;
319
398
  verticalAlign?: "top" | "center" | "bottom";
399
+ textDirection?: "lrTb" | "tbRl" | "btLr" | "lrTbV" | "tbRlV" | "tbLrV";
400
+ /** @internal */
401
+ sourceTextDirection?: TableCellStyle["textDirection"];
402
+ /** Protects the preferred cell width during automatic table layout. */
403
+ noWrap?: boolean;
404
+ /** @internal */
405
+ sourceNoWrap?: boolean;
320
406
  borders?: TableBorderSet;
321
407
  }
322
408
  type TableCellContentNode = ParagraphNode | TableNode;
@@ -325,7 +411,20 @@ interface TableCellNode {
325
411
  nodes: TableCellContentNode[];
326
412
  style?: TableCellStyle;
327
413
  }
414
+ /** @internal Imported baseline for row geometry edits and clears. */
415
+ interface TableRowGeometrySource {
416
+ gridBefore?: number;
417
+ gridAfter?: number;
418
+ widthBefore?: TablePreferredWidth;
419
+ widthAfter?: TablePreferredWidth;
420
+ }
328
421
  interface TableRowStyle {
422
+ gridBefore?: number;
423
+ gridAfter?: number;
424
+ widthBefore?: TablePreferredWidth;
425
+ widthAfter?: TablePreferredWidth;
426
+ /** @internal */
427
+ sourceRowGeometry?: TableRowGeometrySource;
329
428
  backgroundColor?: string;
330
429
  heightTwips?: number;
331
430
  heightRule?: "auto" | "atLeast" | "exact";
@@ -338,7 +437,23 @@ interface TableRowNode {
338
437
  style?: TableRowStyle;
339
438
  }
340
439
  interface TableStyle {
440
+ styleId?: string;
441
+ /** @internal Imported table-style identity used to detect edits and clears. */
442
+ sourceStyleId?: string;
341
443
  widthTwips?: number;
444
+ preferredWidth?: TablePreferredWidth;
445
+ /** @internal */
446
+ sourceWidth?: TableWidthSource;
447
+ alignment?: TableAlignment;
448
+ /** @internal Imported effective alignment before editing. */
449
+ sourceAlignment?: TableAlignment;
450
+ /** @internal Inherited alignment exposed when a direct override is cleared. */
451
+ sourceInheritedAlignment?: TableAlignment;
452
+ bidiVisual?: boolean;
453
+ /** @internal Imported effective table direction before editing. */
454
+ sourceBidiVisual?: boolean;
455
+ /** @internal Inherited direction exposed when a direct override is cleared. */
456
+ sourceInheritedBidiVisual?: boolean;
342
457
  indentTwips?: number;
343
458
  layout?: "fixed" | "autofit";
344
459
  cellSpacingTwips?: number;
@@ -394,6 +509,12 @@ interface ParagraphStyleDefinition {
394
509
  basedOnId?: string;
395
510
  nextStyleId?: string;
396
511
  align?: ParagraphAlignment;
512
+ snapToGrid?: boolean;
513
+ /** @internal Whether the style chain owns grid snapping before document defaults. */
514
+ sourceHasSnapToGrid?: boolean;
515
+ textAlignment?: ParagraphTextAlignment;
516
+ /** @internal Whether the style chain owns alignment before document defaults. */
517
+ sourceHasTextAlignment?: boolean;
397
518
  headingLevel?: HeadingLevel;
398
519
  numbering?: ParagraphNumbering;
399
520
  spacing?: ParagraphSpacing;
@@ -463,6 +584,7 @@ interface DocumentNoteDefinition {
463
584
  nodes?: DocNode[];
464
585
  }
465
586
  interface DocumentCommentDefinition {
587
+ nodes?: DocNode[];
466
588
  id: number;
467
589
  author?: string;
468
590
  initials?: string;
@@ -484,6 +606,15 @@ interface DocumentCommentDefinition {
484
606
  isNew?: boolean;
485
607
  }
486
608
  interface DocumentCompatibilitySettings {
609
+ adjustLineHeightInTable?: boolean | null;
610
+ noLeading?: boolean;
611
+ suppressTopSpacingWP?: boolean;
612
+ truncateFontHeightsLikeWP6?: boolean;
613
+ noExtraLineSpacing?: boolean;
614
+ spaceForUL?: boolean;
615
+ suppressBottomSpacing?: boolean;
616
+ compatibilityMode?: number;
617
+ enableOpenTypeFeatures?: boolean;
487
618
  suppressSpacingBeforeAfterPageBreak?: boolean;
488
619
  usePrinterMetrics?: boolean;
489
620
  useFixedHtmlParagraphSpacing?: boolean;
@@ -494,6 +625,8 @@ interface DocumentCompatibilitySettings {
494
625
  interface DocModel {
495
626
  nodes: DocNode[];
496
627
  metadata: {
628
+ documentId?: string;
629
+ sourcePartNames?: Record<string, string>;
497
630
  sourceParts: number;
498
631
  warnings: string[];
499
632
  documentPageCount?: number;
@@ -505,6 +638,11 @@ interface DocModel {
505
638
  footerSections: FooterSection[];
506
639
  paragraphStyles: ParagraphStyleDefinition[];
507
640
  defaultParagraphStyleId?: string;
641
+ defaultTabStopTwips?: number;
642
+ /** @internal Imported settings are authoritative when their values are cleared. */
643
+ documentSettingsImported?: boolean;
644
+ /** @internal Import consumed the line-spacing compatibility fields. */
645
+ lineSpacingCompatibilityImported?: boolean;
508
646
  numberingDefinitions?: NumberingDefinitionSet;
509
647
  compatibility?: DocumentCompatibilitySettings;
510
648
  footnotes?: DocumentNoteDefinition[];
@@ -513,6 +651,94 @@ interface DocModel {
513
651
  };
514
652
  }
515
653
 
654
+ declare const DOCUMENT_BLOCK_TYPES: readonly ["text", "heading", "section_heading", "figure", "table", "table_head", "table_cell", "key_value", "page_number", "barcode", "formula", "header", "footer", "watermark", "legend"];
655
+ type DocumentBlockType = (typeof DOCUMENT_BLOCK_TYPES)[number];
656
+ interface DocxSourceRef {
657
+ documentId: string;
658
+ nodeId: string;
659
+ partName: string;
660
+ story: string;
661
+ start?: number;
662
+ end?: number;
663
+ offsetEncoding: "utf-16";
664
+ }
665
+ interface ExtractDocumentBlocksOptions {
666
+ includeWords?: boolean;
667
+ }
668
+ interface DocumentWord {
669
+ object: "word";
670
+ id: string;
671
+ blockId: string;
672
+ content: string;
673
+ sourceRefs: DocxSourceRef[];
674
+ }
675
+ interface DocumentBlock {
676
+ object: "block";
677
+ id: string;
678
+ type: DocumentBlockType;
679
+ content: string;
680
+ details: Record<string, unknown>;
681
+ sourceRefs: DocxSourceRef[];
682
+ parentBlockId?: string;
683
+ children: DocumentBlock[];
684
+ words?: DocumentWord[];
685
+ }
686
+ interface StructuredDocument {
687
+ schemaVersion: 1;
688
+ parserVersion: string;
689
+ documentId: string;
690
+ blocks: DocumentBlock[];
691
+ warnings: string[];
692
+ geometryStatus: "requires_layout";
693
+ }
694
+ declare function extractDocumentBlocks(model: DocModel, options?: ExtractDocumentBlocksOptions): Promise<StructuredDocument>;
695
+ declare function flattenDocumentBlocks(blocks: readonly DocumentBlock[]): DocumentBlock[];
696
+ interface SourceElement {
697
+ id: string;
698
+ kind: "document" | "element" | "text" | "comment" | "processing_instruction";
699
+ namespace?: string;
700
+ name?: string;
701
+ text?: string;
702
+ byteStart: number;
703
+ byteEnd: number;
704
+ attributes: Array<{
705
+ namespace: string | null;
706
+ name: string;
707
+ value: string;
708
+ }>;
709
+ children: SourceElement[];
710
+ }
711
+ interface DocumentSourceGraph {
712
+ schemaVersion: 1;
713
+ documentId: string;
714
+ parts: Array<{
715
+ name: string;
716
+ byteLength: number;
717
+ root: SourceElement | null;
718
+ error: string | null;
719
+ }>;
720
+ assets: Array<{
721
+ name: string;
722
+ byteLength: number;
723
+ root: null;
724
+ error: null;
725
+ }>;
726
+ warnings: string[];
727
+ preservedFeatures: Array<{
728
+ partName: string;
729
+ feature: string;
730
+ occurrences: number;
731
+ support: "preserved_only" | "approximate_rendering";
732
+ }>;
733
+ }
734
+ declare function inspectDocumentSource(bytes: ArrayBuffer | Uint8Array): Promise<DocumentSourceGraph>;
735
+
736
+ /** The parent grid bounds skipped-column counts without changing their source values. */
737
+ declare function tableGridColumnBound(table: Pick<TableNode, "style" | "rows">): number;
738
+ /** Ignore skipped-grid counts that exceed the parent grid. */
739
+ declare function resolveTableGridSkipCount(count: number | undefined, gridColumnCount: number): number;
740
+ declare function tableRowGridSkipCount(table: Pick<TableNode, "style" | "rows">, row: TableRowNode, edge: "before" | "after"): number;
741
+
516
742
  /** Returns a fresh block id, unique for the lifetime of this module instance. */
517
743
  declare function allocateBlockId(): string;
518
744
  /**
@@ -529,6 +755,7 @@ declare function ensureDocModelBlockIds(model: DocModel): DocModel;
529
755
  */
530
756
  declare function collectDuplicateDocModelBlockIds(model: DocModel): string[];
531
757
 
758
+ declare function cloneParagraphMarkFormatting(formatting?: ParagraphMarkFormattingSource): ParagraphMarkFormattingSource | undefined;
532
759
  declare function cloneParagraphNode(paragraph: ParagraphNode): ParagraphNode;
533
760
  declare function cloneTableNode(table: TableNode): TableNode;
534
761
  declare function cloneDocModel(model: DocModel): DocModel;
@@ -554,6 +781,87 @@ declare function buildDocModelFromBytes(bytes: ArrayBuffer | Uint8Array): Promis
554
781
  };
555
782
  }>;
556
783
 
784
+ interface LineElementMetrics {
785
+ ascent: number;
786
+ descent: number;
787
+ suppressibleBottomSpace?: number;
788
+ }
789
+ interface LineVerticalMetrics {
790
+ ascent: number;
791
+ descent: number;
792
+ height: number;
793
+ suppressibleBottomSpace: number;
794
+ }
795
+ /** Signed 32-bit multiply/divide, including saturation and half-away rounding. */
796
+ declare function multiplyDivideRound(a: number, b: number, denominator: number): number;
797
+ /** All measurements and limits must use the same unit. */
798
+ declare function aggregateLineMetrics(elements: readonly LineElementMetrics[]): LineVerticalMetrics;
799
+ declare function checkLineVerticalFit(metrics: LineVerticalMetrics, available: number, secondaryLimit: number): {
800
+ fits: boolean;
801
+ appliedSuppression: number;
802
+ rejectedSuppression: number;
803
+ };
804
+ declare function constrainParagraphLineSplit(linesRemaining: number, fittingLines: number, minimumBefore: number, minimumAfter: number): number;
805
+
806
+ /** All amounts must use the same layout unit. */
807
+ declare function collapseParagraphMargins(amounts: readonly number[]): number;
808
+ /** The preceding amount has already been included in the flow position. */
809
+ declare function paragraphMarginContribution(previousAmount: number, nextAmount: number): number;
810
+
811
+ type TableRowHeightRule = "auto" | "atLeast" | "exact";
812
+ interface TableRowHeightConstraint {
813
+ /** Intrinsic outer height already includes cell padding. */
814
+ intrinsicHeight: number;
815
+ declaredHeight?: number;
816
+ heightRule?: TableRowHeightRule;
817
+ maximumBottomPadding?: number;
818
+ }
819
+ interface ResolvedTableRowHeight {
820
+ height: number;
821
+ exact: boolean;
822
+ contentHeightLimit?: number;
823
+ }
824
+ declare function normalizeTableRowHeightTwips(height?: number): number | undefined;
825
+ /** Measurements must use the same unit; border geometry is resolved separately. */
826
+ declare function resolveTableRowHeight(constraint: TableRowHeightConstraint): ResolvedTableRowHeight;
827
+ declare function resolveTableCellContentClipHeight(rowHeightLimit: number, cellTopPadding?: number, cellBottomPadding?: number, outerRowHeight?: number): number;
828
+
829
+ type TableWidthDefinition = Pick<TableStyle, "preferredWidth" | "widthTwips" | "sourceWidth">;
830
+ declare function resolveEffectiveTablePreferredWidth(style: TableWidthDefinition | undefined): TablePreferredWidth | undefined;
831
+ /** The reference is page text width for tables and resolved table width for cells. */
832
+ declare function resolveTablePreferredWidthTwips(style: TableWidthDefinition | undefined, percentageReferenceWidthTwips?: number): number | undefined;
833
+ /** Convert table source widths to CSS pixels without a device-pixel rounding step. */
834
+ declare function tableWidthTwipsToPixels(widthTwips?: number): number | undefined;
835
+ /** Reduce fixed-layout grid widths proportionally when they exceed the table width. */
836
+ declare function reduceFixedTableColumnWidths(columnWidths: readonly number[], tableWidth: number): number[];
837
+ interface FixedTableCellWidth {
838
+ gridSpan?: number;
839
+ preferredWidth?: number;
840
+ }
841
+ interface FixedTableRowWidths {
842
+ gridBefore?: number;
843
+ gridAfter?: number;
844
+ beforeWidth?: number;
845
+ afterWidth?: number;
846
+ cells: readonly FixedTableCellWidth[];
847
+ }
848
+ /** Resolve ordered fixed-layout grid requests in a single measurement unit. */
849
+ declare function resolveFixedTableGridWidths(params: {
850
+ initialGridWidths?: readonly number[];
851
+ rows: readonly FixedTableRowWidths[];
852
+ preferredTableWidth?: number;
853
+ }): number[];
854
+ declare function resolveEffectiveTableAlignment(style: Pick<TableStyle, "alignment" | "sourceAlignment" | "sourceInheritedAlignment"> | undefined): TableAlignment | undefined;
855
+ declare function resolveEffectiveTableBidiVisual(style: Pick<TableStyle, "bidiVisual" | "sourceBidiVisual" | "sourceInheritedBidiVisual"> | undefined): boolean | undefined;
856
+ declare function resolveTableLeadingIndent(alignment: TableAlignment | undefined, indent?: number): number;
857
+ declare function resolveTableAlignmentOffset(params: {
858
+ alignment?: TableAlignment;
859
+ bidiVisual?: boolean;
860
+ availableWidth: number;
861
+ tableWidth: number;
862
+ indent?: number;
863
+ }): number;
864
+
557
865
  interface LayoutOptions {
558
866
  pageWidth?: number;
559
867
  pageHeight?: number;
@@ -670,6 +978,71 @@ type ViewerZoomState = {
670
978
  resolvedZoom: number;
671
979
  };
672
980
 
981
+ type TableRow = TableNode["rows"][number];
982
+ interface TableCellPhysicalGridRange {
983
+ cellIndex: number;
984
+ startColumnIndex: number;
985
+ endColumnIndex: number;
986
+ }
987
+ type TableGridColumnInsertionRowPlan = {
988
+ rowIndex: number;
989
+ } & ({
990
+ kind: "unchanged";
991
+ } | {
992
+ kind: "expand-before";
993
+ gridBefore: number;
994
+ } | {
995
+ kind: "expand-after";
996
+ gridAfter: number;
997
+ } | {
998
+ kind: "extend-cell";
999
+ cellIndex: number;
1000
+ gridSpan: number;
1001
+ } | {
1002
+ kind: "insert-cell";
1003
+ cellIndex: number;
1004
+ referenceCellIndex?: number;
1005
+ });
1006
+ type TableGridColumnDeletionRowPlan = {
1007
+ rowIndex: number;
1008
+ } & ({
1009
+ kind: "unchanged";
1010
+ } | {
1011
+ kind: "reduce-before";
1012
+ gridBefore: number;
1013
+ } | {
1014
+ kind: "reduce-after";
1015
+ gridAfter: number;
1016
+ } | {
1017
+ kind: "shrink-cell";
1018
+ cellIndex: number;
1019
+ gridSpan: number;
1020
+ } | {
1021
+ kind: "remove-cell";
1022
+ cellIndex: number;
1023
+ removesOnlyCell: boolean;
1024
+ });
1025
+ interface TableGridColumnInsertionPlan {
1026
+ columnIndex: number;
1027
+ columnCount: number;
1028
+ rows: TableGridColumnInsertionRowPlan[];
1029
+ }
1030
+ interface TableGridColumnDeletionPlan {
1031
+ columnIndex: number;
1032
+ columnCount: number;
1033
+ deletesLastPhysicalColumn: boolean;
1034
+ deletesAllActualCells: boolean;
1035
+ rows: TableGridColumnDeletionRowPlan[];
1036
+ }
1037
+ declare function tableCellPhysicalGridRange(row: TableRow, cellIndex: number, gridColumnBound: number): TableCellPhysicalGridRange | undefined;
1038
+ declare function tablePhysicalGridColumnCount(table: TableNode): number;
1039
+ declare function planTableGridColumnInsertion(table: TableNode, columnIndex: number): TableGridColumnInsertionPlan | undefined;
1040
+ declare function planTableGridColumnDeletion(table: TableNode, columnIndex: number): TableGridColumnDeletionPlan | undefined;
1041
+ declare function tableCellsIntersectingGridRange(table: TableNode, startRowIndex: number, endRowIndex: number, startColumnIndex: number, endColumnIndex: number): Array<{
1042
+ rowIndex: number;
1043
+ cellIndex: number;
1044
+ }>;
1045
+
673
1046
  type AnnotationMutationFailureReason = "stale" | "unsupported" | "unsafe-xml";
674
1047
  type AnnotationMutationResult = {
675
1048
  ok: true;
@@ -760,7 +1133,7 @@ interface DocumentLayoutMetrics {
760
1133
  footerDistancePx: number;
761
1134
  docGridLinePitchPx?: number;
762
1135
  }
763
- declare function parseSectionLayout(sectionPropertiesXml?: string): DocumentLayoutMetrics;
1136
+ declare function parseSectionLayout(sectionPropertiesXml?: string, missingSectionLayout?: DocumentLayoutMetrics): DocumentLayoutMetrics;
764
1137
  declare function resolveDocumentLayout(model: DocModel): DocumentLayoutMetrics;
765
1138
 
766
1139
  type DocxDocumentTheme = "light" | "dark";
@@ -1788,6 +2161,116 @@ declare function useDocxPageLayout(editor: Pick<DocxEditorController, "model">):
1788
2161
  declare function useDocxPagination(editor: Pick<DocxEditorController, "currentPage" | "totalPages">): UseDocxPaginationResult;
1789
2162
  declare function DocxEditorViewer({ editor, className, style, zoom, defaultZoom, onZoomChange, pageBackgroundColor, pageGapBackgroundColor, deferInitialPaginationPaint, loadingState, pageVirtualization, visiblePageRange, pageIndexes, onPageCountChange, onRequestPageReveal, headingStyles, showTrackedChanges, renderTrackedChangeCard, showComments, renderCommentCard, renderTableContextMenu, renderContextMenu, onFormFieldDoubleClick, mode, }: DocxEditorViewerProps): React.JSX.Element;
1790
2163
 
2164
+ declare function invalidateFontMetrics(): void;
2165
+
2166
+ interface BlockBoundingBox {
2167
+ left: number;
2168
+ top: number;
2169
+ right: number;
2170
+ bottom: number;
2171
+ }
2172
+ interface DocxBlockFragment {
2173
+ nodeId: string;
2174
+ pageIndex: number;
2175
+ pageWidth: number;
2176
+ pageHeight: number;
2177
+ boundingBox: BlockBoundingBox;
2178
+ polygon: Array<{
2179
+ x: number;
2180
+ y: number;
2181
+ }>;
2182
+ coordinateSpace: "page-css-px";
2183
+ }
2184
+ interface DocxBlockGeometry {
2185
+ status: "rendered" | "partially_rendered" | "not_mounted" | "not_visible" | "unresolved";
2186
+ scope: "mounted_pages";
2187
+ issues: Array<{
2188
+ nodeId: string;
2189
+ reason: "unsupported_range" | "document_mismatch" | "not_on_page" | "range_text_mismatch";
2190
+ }>;
2191
+ fragments: DocxBlockFragment[];
2192
+ unresolvedSourceIds: string[];
2193
+ }
2194
+ declare function resolveDocxSourceGeometry(root: HTMLElement, refs: readonly DocxSourceRef[]): DocxBlockGeometry;
2195
+ declare function resolveDocxBlockGeometries(root: HTMLElement, blocks: readonly DocumentBlock[]): Map<string, DocxBlockGeometry>;
2196
+ declare function resolveDocxWordGeometries(root: HTMLElement, words: readonly DocumentWord[]): Map<string, DocxBlockGeometry>;
2197
+ declare function DocxWordHighlights({ word, words, ...props }: {
2198
+ rootRef: React.RefObject<HTMLElement | null>;
2199
+ word?: DocumentWord;
2200
+ words?: readonly DocumentWord[];
2201
+ color?: string;
2202
+ onGeometry?: (geometry: DocxBlockGeometry) => void;
2203
+ }): React.JSX.Element;
2204
+ declare function revealDocxSource(root: HTMLElement, source: string | DocxSourceRef): void;
2205
+ interface DocxBlockHighlightsProps {
2206
+ rootRef: React.RefObject<HTMLElement | null>;
2207
+ block?: DocumentBlock;
2208
+ blocks?: readonly DocumentBlock[];
2209
+ color?: string;
2210
+ colorForBlock?: (block: DocumentBlock) => string;
2211
+ onGeometry?: (geometry: DocxBlockGeometry) => void;
2212
+ }
2213
+ declare function DocxBlockHighlights({ rootRef, block, blocks, color, colorForBlock, onGeometry, }: DocxBlockHighlightsProps): React.JSX.Element;
2214
+ declare function normalizedDocxBoundingBox(fragment: DocxBlockFragment): {
2215
+ pageIndex: number;
2216
+ left: number;
2217
+ top: number;
2218
+ width: number;
2219
+ height: number;
2220
+ };
2221
+ interface DocxPageBlock extends Omit<DocumentBlock, "id" | "parentBlockId" | "children"> {
2222
+ id: string;
2223
+ sourceBlockId: string;
2224
+ parentBlockId?: string;
2225
+ metadata: {
2226
+ page: {
2227
+ number: number;
2228
+ width: number;
2229
+ height: number;
2230
+ };
2231
+ };
2232
+ boundingBox: BlockBoundingBox;
2233
+ polygon: Array<{
2234
+ x: number;
2235
+ y: number;
2236
+ }>;
2237
+ fragments: DocxBlockFragment[];
2238
+ }
2239
+ declare function toDocxPageBlocks(block: DocumentBlock, geometry: DocxBlockGeometry): DocxPageBlock[];
2240
+ type ExtendParserBlockDetails = {
2241
+ type: "text_details";
2242
+ } | {
2243
+ type: "table_details";
2244
+ rowCount: number;
2245
+ columnCount: number;
2246
+ } | {
2247
+ type: "table_cell_details";
2248
+ rowIndex: number;
2249
+ columnIndex: number;
2250
+ } | {
2251
+ type: "figure_details";
2252
+ imageUrl?: string;
2253
+ figureType?: string;
2254
+ } | {
2255
+ type: "barcode_details";
2256
+ imageUrl?: string;
2257
+ decodedValue?: string;
2258
+ format?: string;
2259
+ } | {
2260
+ type: "key_value_details";
2261
+ ocrText?: string;
2262
+ } | {
2263
+ type: "formula_details";
2264
+ latex: string;
2265
+ } | Record<string, never>;
2266
+ interface ExtendParserBlock extends Omit<DocxPageBlock, "details" | "fragments"> {
2267
+ details: ExtendParserBlockDetails;
2268
+ sourceDetails: DocumentBlock["details"];
2269
+ coordinateSpace: "page-points";
2270
+ children: ExtendParserBlock[];
2271
+ }
2272
+ declare function toExtendParserBlocks(blocks: readonly DocumentBlock[], geometries: ReadonlyMap<string, DocxBlockGeometry>): ExtendParserBlock[];
2273
+
1791
2274
  interface ResolvedModelSection {
1792
2275
  startNodeIndex: number;
1793
2276
  sectionPropertiesXml?: string;
@@ -1848,7 +2331,10 @@ interface DocumentPageNodeSegment {
1848
2331
  nodeIndex: number;
1849
2332
  tableRowRange?: TableRowRange;
1850
2333
  paragraphLineRange?: ParagraphLineRange;
2334
+ paragraphBeforeSpacingPx?: number;
1851
2335
  }
2336
+ type PaginationPageStartReason = "initial" | "overflow" | "paragraph-break" | "manual-break" | "section";
2337
+ declare function suppressParagraphBeforeSpacingAtPageStart(reason: PaginationPageStartReason, compatibilityMode?: number): boolean;
1852
2338
  interface LetterheadColumnSegmentGroup {
1853
2339
  startOffset: number;
1854
2340
  endOffset: number;
@@ -1887,6 +2373,14 @@ declare function buildDocumentPageNodeSegments(model: DocModel, pageContentHeigh
1887
2373
  declare function resolveDocumentPageSegmentStartNodeIndex(pageSegments: DocumentPageNodeSegment[]): number | undefined;
1888
2374
  declare function scorePaginationAgainstStoredPageBreaks(pages: DocumentPageNodeSegment[][], storedBreakStartNodeIndexes: number[]): number;
1889
2375
 
2376
+ declare function normalizeSectionPageNumber(pageNumber: number, properties?: string): number;
2377
+ declare function createSectionParityBlankPage<T>(): T[];
2378
+ declare function isSectionParityBlankPage(page: readonly unknown[]): boolean;
2379
+ declare function createSectionPageNumberTracker(metadata: DocModel["metadata"]): {
2380
+ advancePage: () => void;
2381
+ startSection: (nodeIndex: number, atPageTop: boolean, hasPreviousPages: boolean) => boolean;
2382
+ };
2383
+
1890
2384
  type LayoutSnapshotOptions = LayoutOptions;
1891
2385
  interface LayoutSnapshotRect {
1892
2386
  x: number;
@@ -2003,6 +2497,10 @@ declare function modelToDocumentXml(model: DocModel, basePackage?: OoxmlPackage)
2003
2497
  declare function serializeDocModel(model: DocModel, basePackage?: OoxmlPackage): Promise<OoxmlPackage>;
2004
2498
  declare function serializeDocx(model: DocModel, basePackage?: OoxmlPackage): Promise<ArrayBuffer>;
2005
2499
 
2500
+ /**
2501
+ * @deprecated Since v0.10.0, use DocxEditorViewerProps with mode="read-only"
2502
+ * and a controller from useDocxEditor.
2503
+ */
2006
2504
  interface ReactDocxViewerProps {
2007
2505
  /**
2008
2506
  * Raw `.docx` file contents to parse and render.
@@ -2077,6 +2575,10 @@ interface UseDocxModelState {
2077
2575
  error?: Error;
2078
2576
  }
2079
2577
  declare function useDocxModel(file?: ArrayBuffer): UseDocxModelState;
2578
+ /**
2579
+ * @deprecated Since v0.10.0, use DocxEditorViewer with mode="read-only"
2580
+ * and a controller from useDocxEditor.
2581
+ */
2080
2582
  declare function ReactDocxViewer({ file, model, document, loadEmbeddedFonts, pageIndexes, className, zoom, defaultZoom, onZoomChange, layoutOptions, emptyState, }: ReactDocxViewerProps): React.JSX.Element;
2081
2583
  type DocxThumbnailOutput = "canvas" | "blob" | "imageBitmap";
2082
2584
  interface CreateDocxThumbnailRendererOptions {
@@ -2125,4 +2627,4 @@ interface DocxThumbnailRenderer {
2125
2627
  }
2126
2628
  declare function createDocxThumbnailRenderer(documentModel: DocxThumbnailDocument, options?: CreateDocxThumbnailRendererOptions): DocxThumbnailRenderer;
2127
2629
 
2128
- export { type AnnotationMutationFailureReason, type AnnotationMutationResult, type CommentCreationResult, type CreateDocxThumbnailRendererOptions, type CreateParagraphCommentInput, DEFAULT_MIN_PARAGRAPH_LINE_HEIGHT_PX, DEFAULT_PAGE_OVERFLOW_TOLERANCE_PX, type DocModel, type DocNode, type DocumentCommentDefinition, type DocumentCompatibilitySettings, type DocumentNoteDefinition, type DocumentPageNodeSegment, type DocumentPageRange, type DocumentPageSegmentationOptions, type DocumentSection, type DocxAnnotationCommandFailureReason, type DocxAnnotationCommandResult, type DocxBorderContext, type DocxBorderPreset, type DocxBorderPresetState, type DocxComment, type DocxCommentCardRenderProps, type DocxCommentCreationCommandResult, type DocxContextMenuAction, type DocxContextMenuActionId, type DocxContextMenuContext, type DocxContextMenuRenderProps, type DocxCreateCommentOptions, type DocxDocumentTheme, type DocxEditorController, type DocxEditorSelection, DocxEditorViewer, type DocxEditorViewerMode, type DocxEditorViewerProps, type DocxFormFieldLocation, type DocxHeadingStyleMap, type DocxImageDropTarget, type DocxImageLocation, type DocxImageWrapMenuOption, type DocxImageWrapMode, type DocxImageWrapState, type DocxLineSpacingInfo, type DocxListType, type DocxPageLayoutInfo, type DocxPageThumbnailBounds, type DocxPageThumbnailItem, type DocxPageThumbnailRenderWindow, type DocxPageThumbnailResolution, type DocxPageThumbnailResolutionOptions, type DocxPageThumbnailStatus, type DocxPageVirtualizationOptions, type DocxPaginationInfo, type DocxRenderToCanvasOptions, type DocxSectionColumnLayout, type DocxSelectedFormField, type DocxTableContextMenuAction, type DocxTableContextMenuActionId, type DocxTableContextMenuContext, type DocxTableContextMenuRenderProps, type DocxTextRange, type DocxTextRangeLocation, type DocxThumbnailDocument, type DocxThumbnailOutput, type DocxThumbnailRenderResult, type DocxThumbnailRenderTimings, type DocxThumbnailRenderer, type DocxThumbnailScheduling, type DocxTrackedChange, type DocxTrackedChangeCardRenderProps, type DocxTrackedChangeKind, type DocxViewerSource, type DocxViewerThumbnails, type DocxVisiblePageRange, type FooterSection, type FormFieldCheckboxWidgetSettings, type FormFieldDropdownWidgetSettings, type FormFieldOption, type FormFieldRunNode, type FormFieldSourceKind, type FormFieldTextWidgetSettings, type FormFieldType, type FormFieldWidgetSettings, type HeaderSection, type HeadingLevel, type ImageRunNode, type InsertParagraphOptions, type LayoutBlock, type LayoutFragmentSource, type LayoutImageRun, type LayoutOptions, type LayoutPage, type LayoutParagraphBlock, type LayoutRun, type LayoutSnapshot, type LayoutSnapshotBlockFragment, type LayoutSnapshotImageRun, type LayoutSnapshotMargins, type LayoutSnapshotOptions, type LayoutSnapshotPage, type LayoutSnapshotPageSize, type LayoutSnapshotParagraphFragment, type LayoutSnapshotRect, type LayoutSnapshotRun, type LayoutSnapshotTableCellFragment, type LayoutSnapshotTableFragment, type LayoutSnapshotTableRowFragment, type LayoutSnapshotTextRun, type LayoutTableBlock, type LayoutTableCell, type LayoutTableRow, type LayoutTextRun, type LegacyWasmOoxmlPackage, type LetterheadColumnSegmentGroup, type NumberingAbstractDefinition, type NumberingDefinitionSet, type NumberingInstanceDefinition, type NumberingLevelDefinition, type NumberingPictureBulletDefinition, type OoxmlPackage, type OoxmlPart, type OverflowBreakCollectionOptions, type PageSegmentationCallbacks, type PaginationSectionMetrics, type ParagraphAlignment, type ParagraphBorderSet, type ParagraphBorderStyle, type ParagraphChildNode, type ParagraphIndent, type ParagraphLineRange, type ParagraphNode, type ParagraphNumbering, type ParagraphRevisionKind, type ParagraphRevisionTarget, type ParagraphSpacing, type ParagraphSplitControlOptions, type ParagraphStyle, type ParagraphStyleDefinition, type ParagraphTabStop, type ParseDocxForViewerOptions, type ParsedDocxDocument, type ParsedDocxPerformanceTimings, ReactDocxViewer, type ReactDocxViewerProps, type RenderDocxThumbnailPageOptions, type ResolvedDocument, type ResolvedDocumentSection, type ResolvedLayoutMetrics, type ResolvedModelSection, type TableBorderSet, type TableBorderStyle, type TableBoxSpacing, type TableCellContentNode, type TableCellNode, type TableCellStyle, type TableExplicitPageBreakInfo, type TableNode, type TableRowNode, type TableRowRange, type TableRowStyle, type TableStyle, type TextRunBorderStyle, type TextRunNode, type TextStyle, type UpdateTextOptions, type UseDocxBordersResult, type UseDocxCommentsResult, type UseDocxDocumentThemeResult, type UseDocxEditorOptions, type UseDocxFormFieldsResult, type UseDocxImageWrapMenuResult, type UseDocxLineSpacingResult, type UseDocxModelState, type UseDocxPageLayoutResult, type UseDocxPageThumbnailsOptions, type UseDocxPageThumbnailsResult, type UseDocxPaginationResult, type UseDocxParagraphStylesResult, type UseDocxTrackChangesResult, type UseDocxViewerThumbnailsOptions, type ViewerZoomLevel, type ViewerZoomMode, type ViewerZoomState, type WasmOoxmlPackage, type WasmSource, acceptParagraphRevision, allocateBlockId, applyRunStyle, buildDocModel, buildDocModelFromBytes, buildDocumentPageNodeSegments, buildDocumentPageRanges, buildLayoutSnapshot, cloneDocModel, cloneParagraphNode, cloneTableNode, collectDocxEstimatedOverflowBreakStartNodeIndexes, collectDocxHardPageBreakStartNodeIndexes, collectDocxLastRenderedPageBreakStartNodeIndexes, collectDuplicateDocModelBlockIds, collectTableExplicitPageBreakInfo, collectTopLevelExplicitPageBreakStartNodeIndexes, copyParagraphs, createDocxThumbnailRenderer, createMinimalDocxPackage, createParagraphComment, deepFreezeDocModel, defaultStarterModel, duplicateParagraph, ensureDocModelBlockIds, getPart, initWasm, insertParagraph, layoutDocument, modelToDocumentXml, normalizeDocModel, packageToArrayBuffer, paragraphAfterSpacingPx, paragraphBeforeSpacingPx, paragraphHasExplicitPageBreak, paragraphHasLastRenderedPageBreak, paragraphHasPageBreakBefore, paragraphLetterheadColumnGroupAtSegmentOffset, paragraphLetterheadFloatSideAtNodeIndex, paragraphStartsWithLastRenderedPageBreak, parseDocx, parseDocxForViewer, parseParagraphsFromClipboard, parseSectionLayout, pasteParagraphs, rejectParagraphRevision, removeParagraph, replaceText, resolveDocumentForLayout, resolveDocumentLayout, resolveDocumentPageSegmentStartNodeIndex, resolveDocumentSectionsFromMetadata, resolveDocxPageThumbnailResolution, resolvePaginationSectionMetricsIndexForNodeIndex, resolveParagraphBeforeSpacingPx, resolveSectionIndexForNodeIndex, resolveSectionPropertiesXmlForNodeIndex, scalePaginationSectionMetricsHeights, scorePaginationAgainstStoredPageBreaks, sectionBreakAfterParagraphStartsNewPage, sectionBreakPropertiesStartNewPage, sectionTitlePageEnabled, selectSectionVariantForPage, serializeDocModel, serializeDocx, serializeParagraphsForClipboard, setCommentResolved, setParagraphAlignment, setParagraphHeading, setRunColor, setRunHighlight, setWasmSource, splitParagraphChildrenAtTextOffsets, toggleRunStyleFlag, updateParagraphText, updateTableCellParagraphText, updateTableCellParagraphTextRecursive, updateTableCellText, useDocxBorders, useDocxComments, useDocxDocumentTheme, useDocxEditor, useDocxFormFields, useDocxImageWrapMenu, useDocxLineSpacing, useDocxModel, useDocxPageLayout, useDocxPageThumbnails, useDocxPagination, useDocxParagraphStyles, useDocxTrackChanges, useDocxViewerThumbnails, withPart };
2630
+ export { type AnnotationMutationFailureReason, type AnnotationMutationResult, type BlockBoundingBox, type CommentCreationResult, type CreateDocxThumbnailRendererOptions, type CreateParagraphCommentInput, DEFAULT_MIN_PARAGRAPH_LINE_HEIGHT_PX, DEFAULT_PAGE_OVERFLOW_TOLERANCE_PX, DOCUMENT_BLOCK_TYPES, type DocModel, type DocNode, type DocumentBlock, type DocumentBlockType, type DocumentCommentDefinition, type DocumentCompatibilitySettings, type DocumentNoteDefinition, type DocumentPageNodeSegment, type DocumentPageRange, type DocumentPageSegmentationOptions, type DocumentSection, type DocumentSourceGraph, type DocumentWord, type DocxAnnotationCommandFailureReason, type DocxAnnotationCommandResult, type DocxBlockFragment, type DocxBlockGeometry, DocxBlockHighlights, type DocxBlockHighlightsProps, type DocxBorderContext, type DocxBorderPreset, type DocxBorderPresetState, type DocxComment, type DocxCommentCardRenderProps, type DocxCommentCreationCommandResult, type DocxContextMenuAction, type DocxContextMenuActionId, type DocxContextMenuContext, type DocxContextMenuRenderProps, type DocxCreateCommentOptions, type DocxDocumentTheme, type DocxEditorController, type DocxEditorSelection, DocxEditorViewer, type DocxEditorViewerMode, type DocxEditorViewerProps, type DocxFormFieldLocation, type DocxHeadingStyleMap, type DocxImageDropTarget, type DocxImageLocation, type DocxImageWrapMenuOption, type DocxImageWrapMode, type DocxImageWrapState, type DocxLineSpacingInfo, type DocxListType, type DocxPageBlock, type DocxPageLayoutInfo, type DocxPageThumbnailBounds, type DocxPageThumbnailItem, type DocxPageThumbnailRenderWindow, type DocxPageThumbnailResolution, type DocxPageThumbnailResolutionOptions, type DocxPageThumbnailStatus, type DocxPageVirtualizationOptions, type DocxPaginationInfo, type DocxRenderToCanvasOptions, type DocxSectionColumnLayout, type DocxSelectedFormField, type DocxSourceRef, type DocxTableContextMenuAction, type DocxTableContextMenuActionId, type DocxTableContextMenuContext, type DocxTableContextMenuRenderProps, type DocxTextRange, type DocxTextRangeLocation, type DocxThumbnailDocument, type DocxThumbnailOutput, type DocxThumbnailRenderResult, type DocxThumbnailRenderTimings, type DocxThumbnailRenderer, type DocxThumbnailScheduling, type DocxTrackedChange, type DocxTrackedChangeCardRenderProps, type DocxTrackedChangeKind, type DocxViewerSource, type DocxViewerThumbnails, type DocxVisiblePageRange, DocxWordHighlights, type ExtendParserBlock, type ExtendParserBlockDetails, type ExtractDocumentBlocksOptions, type FixedTableCellWidth, type FixedTableRowWidths, type FooterSection, type FormFieldCheckboxWidgetSettings, type FormFieldDropdownWidgetSettings, type FormFieldOption, type FormFieldRunNode, type FormFieldSourceKind, type FormFieldTextWidgetSettings, type FormFieldType, type FormFieldWidgetSettings, type HeaderSection, type HeadingLevel, type ImageRunNode, type InsertParagraphOptions, type LayoutBlock, type LayoutFragmentSource, type LayoutImageRun, type LayoutOptions, type LayoutPage, type LayoutParagraphBlock, type LayoutRun, type LayoutSnapshot, type LayoutSnapshotBlockFragment, type LayoutSnapshotImageRun, type LayoutSnapshotMargins, type LayoutSnapshotOptions, type LayoutSnapshotPage, type LayoutSnapshotPageSize, type LayoutSnapshotParagraphFragment, type LayoutSnapshotRect, type LayoutSnapshotRun, type LayoutSnapshotTableCellFragment, type LayoutSnapshotTableFragment, type LayoutSnapshotTableRowFragment, type LayoutSnapshotTextRun, type LayoutTableBlock, type LayoutTableCell, type LayoutTableRow, type LayoutTextRun, type LegacyWasmOoxmlPackage, type LetterheadColumnSegmentGroup, type LineElementMetrics, type LineVerticalMetrics, type NumberingAbstractDefinition, type NumberingDefinitionSet, type NumberingInstanceDefinition, type NumberingLevelDefinition, type NumberingPictureBulletDefinition, type OoxmlPackage, type OoxmlPart, type OverflowBreakCollectionOptions, type PageSegmentationCallbacks, type PaginationPageStartReason, type PaginationSectionMetrics, type ParagraphAlignment, type ParagraphBorderSet, type ParagraphBorderStyle, type ParagraphChildNode, type ParagraphIndent, type ParagraphLineRange, type ParagraphMarkFormattingSource, type ParagraphNode, type ParagraphNumbering, type ParagraphRevisionKind, type ParagraphRevisionTarget, type ParagraphSpacing, type ParagraphSplitControlOptions, type ParagraphStyle, type ParagraphStyleDefinition, type ParagraphTabStop, type ParagraphTextAlignment, type ParseDocxForViewerOptions, type ParsedDocxDocument, type ParsedDocxPerformanceTimings, ReactDocxViewer, type ReactDocxViewerProps, type RenderDocxThumbnailPageOptions, type ResolvedDocument, type ResolvedDocumentSection, type ResolvedLayoutMetrics, type ResolvedModelSection, type ResolvedTableRowHeight, type SourceElement, type StructuredDocument, type TableAlignment, type TableBorderSet, type TableBorderStyle, type TableBoxSpacing, type TableCellContentNode, type TableCellNode, type TableCellPhysicalGridRange, type TableCellStyle, type TableExplicitPageBreakInfo, type TableGridColumnDeletionPlan, type TableGridColumnDeletionRowPlan, type TableGridColumnInsertionPlan, type TableGridColumnInsertionRowPlan, type TableNode, type TablePreferredWidth, type TableRowGeometrySource, type TableRowHeightConstraint, type TableRowHeightRule, type TableRowNode, type TableRowRange, type TableRowStyle, type TableStyle, type TableWidthDefinition, type TableWidthSource, type TextLigatures, type TextRunBorderStyle, type TextRunNode, type TextStyle, type UpdateTextOptions, type UseDocxBordersResult, type UseDocxCommentsResult, type UseDocxDocumentThemeResult, type UseDocxEditorOptions, type UseDocxFormFieldsResult, type UseDocxImageWrapMenuResult, type UseDocxLineSpacingResult, type UseDocxModelState, type UseDocxPageLayoutResult, type UseDocxPageThumbnailsOptions, type UseDocxPageThumbnailsResult, type UseDocxPaginationResult, type UseDocxParagraphStylesResult, type UseDocxTrackChangesResult, type UseDocxViewerThumbnailsOptions, type ViewerZoomLevel, type ViewerZoomMode, type ViewerZoomState, type WasmOoxmlPackage, type WasmSource, acceptParagraphRevision, aggregateLineMetrics, allocateBlockId, applyRunStyle, buildDocModel, buildDocModelFromBytes, buildDocumentPageNodeSegments, buildDocumentPageRanges, buildLayoutSnapshot, checkLineVerticalFit, cloneDocModel, cloneParagraphMarkFormatting, cloneParagraphNode, cloneTableNode, collapseParagraphMargins, collectDocxEstimatedOverflowBreakStartNodeIndexes, collectDocxHardPageBreakStartNodeIndexes, collectDocxLastRenderedPageBreakStartNodeIndexes, collectDuplicateDocModelBlockIds, collectTableExplicitPageBreakInfo, collectTopLevelExplicitPageBreakStartNodeIndexes, constrainParagraphLineSplit, copyParagraphs, createDocxThumbnailRenderer, createMinimalDocxPackage, createParagraphComment, createSectionPageNumberTracker, createSectionParityBlankPage, deepFreezeDocModel, defaultStarterModel, duplicateParagraph, ensureDocModelBlockIds, extractDocumentBlocks, flattenDocumentBlocks, getPart, initWasm, insertParagraph, inspectDocumentSource, isSectionParityBlankPage, layoutDocument, modelToDocumentXml, multiplyDivideRound, normalizeDocModel, normalizeSectionPageNumber, normalizeTableRowHeightTwips, normalizedDocxBoundingBox, packageToArrayBuffer, paragraphAfterSpacingPx, paragraphBeforeSpacingPx, paragraphHasExplicitPageBreak, paragraphHasLastRenderedPageBreak, paragraphHasPageBreakBefore, paragraphLetterheadColumnGroupAtSegmentOffset, paragraphLetterheadFloatSideAtNodeIndex, paragraphMarginContribution, paragraphStartsWithLastRenderedPageBreak, parseDocx, parseDocxForViewer, parseParagraphsFromClipboard, parseSectionLayout, pasteParagraphs, planTableGridColumnDeletion, planTableGridColumnInsertion, reduceFixedTableColumnWidths, invalidateFontMetrics as refreshDocxFontMetrics, rejectParagraphRevision, removeParagraph, replaceText, resolveDocumentForLayout, resolveDocumentLayout, resolveDocumentPageSegmentStartNodeIndex, resolveDocumentSectionsFromMetadata, resolveDocxBlockGeometries, resolveDocxPageThumbnailResolution, resolveDocxSourceGeometry, resolveDocxWordGeometries, resolveEffectiveTableAlignment, resolveEffectiveTableBidiVisual, resolveEffectiveTablePreferredWidth, resolveFixedTableGridWidths, resolvePaginationSectionMetricsIndexForNodeIndex, resolveParagraphBeforeSpacingPx, resolveSectionIndexForNodeIndex, resolveSectionPropertiesXmlForNodeIndex, resolveTableAlignmentOffset, resolveTableCellContentClipHeight, resolveTableGridSkipCount, resolveTableLeadingIndent, resolveTablePreferredWidthTwips, resolveTableRowHeight, revealDocxSource, scalePaginationSectionMetricsHeights, scorePaginationAgainstStoredPageBreaks, sectionBreakAfterParagraphStartsNewPage, sectionBreakPropertiesStartNewPage, sectionTitlePageEnabled, selectSectionVariantForPage, serializeDocModel, serializeDocx, serializeParagraphsForClipboard, setCommentResolved, setParagraphAlignment, setParagraphHeading, setRunColor, setRunHighlight, setWasmSource, splitParagraphChildrenAtTextOffsets, suppressParagraphBeforeSpacingAtPageStart, tableCellPhysicalGridRange, tableCellsIntersectingGridRange, tableGridColumnBound, tablePhysicalGridColumnCount, tableRowGridSkipCount, tableWidthTwipsToPixels, toDocxPageBlocks, toExtendParserBlocks, toggleRunStyleFlag, updateParagraphText, updateTableCellParagraphText, updateTableCellParagraphTextRecursive, updateTableCellText, useDocxBorders, useDocxComments, useDocxDocumentTheme, useDocxEditor, useDocxFormFields, useDocxImageWrapMenu, useDocxLineSpacing, useDocxModel, useDocxPageLayout, useDocxPageThumbnails, useDocxPagination, useDocxParagraphStyles, useDocxTrackChanges, useDocxViewerThumbnails, withPart };