@extend-ai/react-docx 0.9.0 → 0.9.2

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
@@ -547,6 +547,11 @@ declare function buildDocModel(pkg: OoxmlPackage): Promise<DocModel>;
547
547
  declare function buildDocModelFromBytes(bytes: ArrayBuffer | Uint8Array): Promise<{
548
548
  package: OoxmlPackage;
549
549
  model: DocModel;
550
+ timings: {
551
+ parseMs: number;
552
+ buildModelMs: number;
553
+ totalMs: number;
554
+ };
550
555
  }>;
551
556
 
552
557
  interface LayoutOptions {
@@ -626,7 +631,7 @@ interface DocxImportResult {
626
631
  interface DocxImportOptions {
627
632
  signal?: AbortSignal;
628
633
  transferBuffer?: boolean;
629
- useWorker?: boolean;
634
+ useWorker?: boolean | "required";
630
635
  }
631
636
  interface DocxImportWorkerTimings {
632
637
  totalMs: number;
@@ -658,6 +663,13 @@ interface ParsedDocxDocument {
658
663
  }
659
664
  declare function parseDocxForViewer(source: DocxViewerSource, options?: ParseDocxForViewerOptions): Promise<ParsedDocxDocument>;
660
665
 
666
+ type ViewerZoomMode = "automatic" | "fit-page" | "fit-width";
667
+ type ViewerZoomLevel = number | ViewerZoomMode;
668
+ type ViewerZoomState = {
669
+ level: ViewerZoomLevel;
670
+ resolvedZoom: number;
671
+ };
672
+
661
673
  type AnnotationMutationFailureReason = "stale" | "unsupported" | "unsafe-xml";
662
674
  type AnnotationMutationResult = {
663
675
  ok: true;
@@ -811,6 +823,7 @@ interface DocxHistoryRestoreRequest {
811
823
  nonce: number;
812
824
  selection: DocxEditorSelection;
813
825
  activeTextRange?: DocxTextRange;
826
+ textInput?: boolean;
814
827
  }
815
828
  type ParagraphLocation = DocxTextRangeLocation;
816
829
  type DocxImageLocation = ParagraphLocation & {
@@ -837,6 +850,8 @@ interface DocxSelectedFormField {
837
850
  }
838
851
  type DocxImageDropTarget = ParagraphLocation & {
839
852
  childIndex: number;
853
+ /** UTF-16 offset inside the target text run. */
854
+ textOffset?: number;
840
855
  };
841
856
  type DocxTrackedChangeKind = "insertion" | "deletion" | "move-from" | "move-to" | "format-change" | "paragraph-format-change";
842
857
  interface DocxTrackedChange {
@@ -1034,6 +1049,12 @@ interface DocxEditorController {
1034
1049
  setShowTrackedChanges: (showTrackedChanges: boolean) => void;
1035
1050
  setShowComments: (showComments: boolean) => void;
1036
1051
  syncPaginationInfo: (pagination: DocxPaginationInfo) => void;
1052
+ /** Selects a numeric or responsive viewer zoom level. */
1053
+ setZoom: (level: ViewerZoomLevel) => void;
1054
+ /** Returns the selected zoom level, including an active responsive mode. */
1055
+ getZoom: () => ViewerZoomLevel;
1056
+ /** Returns the currently resolved zoom percentage. */
1057
+ getResolvedZoom: () => number;
1037
1058
  toggleShowTrackedChanges: () => void;
1038
1059
  toggleShowComments: () => void;
1039
1060
  acceptTrackedChange: (change: DocxTrackedChange) => DocxAnnotationCommandResult;
@@ -1083,6 +1104,7 @@ interface DocxEditorController {
1083
1104
  setImageWrapMode: (location: DocxImageLocation, mode: DocxImageWrapMode, seedFloating?: Partial<NonNullable<ImageRunNode["floating"]>>) => void;
1084
1105
  moveFloatingImage: (location: DocxImageLocation, patch: Partial<NonNullable<ImageRunNode["floating"]>>, options?: {
1085
1106
  reparentToParagraphNodeIndex?: number;
1107
+ anchorTextOffset?: number;
1086
1108
  }) => void;
1087
1109
  moveSectionFloatingImage: (location: DocxSectionImageLocation, patch: Partial<NonNullable<ImageRunNode["floating"]>>) => void;
1088
1110
  moveParagraphDropCap: (nodeIndex: number, patch: Partial<NonNullable<NonNullable<ParagraphNode["style"]>["dropCap"]>>) => void;
@@ -1104,6 +1126,7 @@ interface DocxEditorController {
1104
1126
  moveTable: (tableIndex: number, targetNodeIndex: number) => void;
1105
1127
  setTableFloating: (tableIndex: number, patch: Partial<NonNullable<NonNullable<TableNode["style"]>["floating"]>>, options?: {
1106
1128
  moveToNodeIndex?: number;
1129
+ anchorTextOffset?: number;
1107
1130
  }) => void;
1108
1131
  moveEmbeddedTableToBody: (tableRuntimeKey: string, targetNodeIndex: number) => void;
1109
1132
  replaceExpandedSelection: (text: string, range?: DocxTextRange) => DocxTextRange | undefined;
@@ -1322,6 +1345,12 @@ interface DocxEditorViewerProps {
1322
1345
  * Inline styles applied to the outer viewer root.
1323
1346
  */
1324
1347
  style?: React.CSSProperties;
1348
+ /** Controlled numeric percentage or responsive zoom mode. */
1349
+ zoom?: ViewerZoomLevel;
1350
+ /** Initial zoom level when `zoom` is uncontrolled. */
1351
+ defaultZoom?: ViewerZoomLevel;
1352
+ /** Called when the selected level or its resolved percentage changes. */
1353
+ onZoomChange?: (state: ViewerZoomState) => void;
1325
1354
  /**
1326
1355
  * Background color of each rendered page surface.
1327
1356
  *
@@ -1757,7 +1786,7 @@ declare function useDocxTrackChanges(editor: Pick<DocxEditorController, "tracked
1757
1786
  declare function useDocxComments(editor: Pick<DocxEditorController, "comments" | "showComments" | "setShowComments" | "toggleShowComments" | "createComment" | "setCommentResolved">): UseDocxCommentsResult;
1758
1787
  declare function useDocxPageLayout(editor: Pick<DocxEditorController, "model">): UseDocxPageLayoutResult;
1759
1788
  declare function useDocxPagination(editor: Pick<DocxEditorController, "currentPage" | "totalPages">): UseDocxPaginationResult;
1760
- declare function DocxEditorViewer({ editor, className, style, pageBackgroundColor, pageGapBackgroundColor, deferInitialPaginationPaint, loadingState, pageVirtualization, visiblePageRange, pageIndexes, onPageCountChange, onRequestPageReveal, headingStyles, showTrackedChanges, renderTrackedChangeCard, showComments, renderCommentCard, renderTableContextMenu, renderContextMenu, onFormFieldDoubleClick, mode, }: DocxEditorViewerProps): React.JSX.Element;
1789
+ 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;
1761
1790
 
1762
1791
  interface ResolvedModelSection {
1763
1792
  startNodeIndex: number;
@@ -2011,6 +2040,12 @@ interface ReactDocxViewerProps {
2011
2040
  * ```
2012
2041
  */
2013
2042
  className?: string;
2043
+ /** Controlled numeric percentage or responsive zoom mode. */
2044
+ zoom?: ViewerZoomLevel;
2045
+ /** Initial zoom level when `zoom` is uncontrolled. */
2046
+ defaultZoom?: ViewerZoomLevel;
2047
+ /** Called when the selected level or its resolved percentage changes. */
2048
+ onZoomChange?: (state: ViewerZoomState) => void;
2014
2049
  /**
2015
2050
  * Layout overrides for the simple read-only renderer.
2016
2051
  *
@@ -2042,7 +2077,7 @@ interface UseDocxModelState {
2042
2077
  error?: Error;
2043
2078
  }
2044
2079
  declare function useDocxModel(file?: ArrayBuffer): UseDocxModelState;
2045
- declare function ReactDocxViewer({ file, model, document, loadEmbeddedFonts, pageIndexes, className, layoutOptions, emptyState, }: ReactDocxViewerProps): React.JSX.Element;
2080
+ declare function ReactDocxViewer({ file, model, document, loadEmbeddedFonts, pageIndexes, className, zoom, defaultZoom, onZoomChange, layoutOptions, emptyState, }: ReactDocxViewerProps): React.JSX.Element;
2046
2081
  type DocxThumbnailOutput = "canvas" | "blob" | "imageBitmap";
2047
2082
  interface CreateDocxThumbnailRendererOptions {
2048
2083
  scheduling?: DocxThumbnailScheduling;
@@ -2090,4 +2125,4 @@ interface DocxThumbnailRenderer {
2090
2125
  }
2091
2126
  declare function createDocxThumbnailRenderer(documentModel: DocxThumbnailDocument, options?: CreateDocxThumbnailRendererOptions): DocxThumbnailRenderer;
2092
2127
 
2093
- 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 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -547,6 +547,11 @@ declare function buildDocModel(pkg: OoxmlPackage): Promise<DocModel>;
547
547
  declare function buildDocModelFromBytes(bytes: ArrayBuffer | Uint8Array): Promise<{
548
548
  package: OoxmlPackage;
549
549
  model: DocModel;
550
+ timings: {
551
+ parseMs: number;
552
+ buildModelMs: number;
553
+ totalMs: number;
554
+ };
550
555
  }>;
551
556
 
552
557
  interface LayoutOptions {
@@ -626,7 +631,7 @@ interface DocxImportResult {
626
631
  interface DocxImportOptions {
627
632
  signal?: AbortSignal;
628
633
  transferBuffer?: boolean;
629
- useWorker?: boolean;
634
+ useWorker?: boolean | "required";
630
635
  }
631
636
  interface DocxImportWorkerTimings {
632
637
  totalMs: number;
@@ -658,6 +663,13 @@ interface ParsedDocxDocument {
658
663
  }
659
664
  declare function parseDocxForViewer(source: DocxViewerSource, options?: ParseDocxForViewerOptions): Promise<ParsedDocxDocument>;
660
665
 
666
+ type ViewerZoomMode = "automatic" | "fit-page" | "fit-width";
667
+ type ViewerZoomLevel = number | ViewerZoomMode;
668
+ type ViewerZoomState = {
669
+ level: ViewerZoomLevel;
670
+ resolvedZoom: number;
671
+ };
672
+
661
673
  type AnnotationMutationFailureReason = "stale" | "unsupported" | "unsafe-xml";
662
674
  type AnnotationMutationResult = {
663
675
  ok: true;
@@ -811,6 +823,7 @@ interface DocxHistoryRestoreRequest {
811
823
  nonce: number;
812
824
  selection: DocxEditorSelection;
813
825
  activeTextRange?: DocxTextRange;
826
+ textInput?: boolean;
814
827
  }
815
828
  type ParagraphLocation = DocxTextRangeLocation;
816
829
  type DocxImageLocation = ParagraphLocation & {
@@ -837,6 +850,8 @@ interface DocxSelectedFormField {
837
850
  }
838
851
  type DocxImageDropTarget = ParagraphLocation & {
839
852
  childIndex: number;
853
+ /** UTF-16 offset inside the target text run. */
854
+ textOffset?: number;
840
855
  };
841
856
  type DocxTrackedChangeKind = "insertion" | "deletion" | "move-from" | "move-to" | "format-change" | "paragraph-format-change";
842
857
  interface DocxTrackedChange {
@@ -1034,6 +1049,12 @@ interface DocxEditorController {
1034
1049
  setShowTrackedChanges: (showTrackedChanges: boolean) => void;
1035
1050
  setShowComments: (showComments: boolean) => void;
1036
1051
  syncPaginationInfo: (pagination: DocxPaginationInfo) => void;
1052
+ /** Selects a numeric or responsive viewer zoom level. */
1053
+ setZoom: (level: ViewerZoomLevel) => void;
1054
+ /** Returns the selected zoom level, including an active responsive mode. */
1055
+ getZoom: () => ViewerZoomLevel;
1056
+ /** Returns the currently resolved zoom percentage. */
1057
+ getResolvedZoom: () => number;
1037
1058
  toggleShowTrackedChanges: () => void;
1038
1059
  toggleShowComments: () => void;
1039
1060
  acceptTrackedChange: (change: DocxTrackedChange) => DocxAnnotationCommandResult;
@@ -1083,6 +1104,7 @@ interface DocxEditorController {
1083
1104
  setImageWrapMode: (location: DocxImageLocation, mode: DocxImageWrapMode, seedFloating?: Partial<NonNullable<ImageRunNode["floating"]>>) => void;
1084
1105
  moveFloatingImage: (location: DocxImageLocation, patch: Partial<NonNullable<ImageRunNode["floating"]>>, options?: {
1085
1106
  reparentToParagraphNodeIndex?: number;
1107
+ anchorTextOffset?: number;
1086
1108
  }) => void;
1087
1109
  moveSectionFloatingImage: (location: DocxSectionImageLocation, patch: Partial<NonNullable<ImageRunNode["floating"]>>) => void;
1088
1110
  moveParagraphDropCap: (nodeIndex: number, patch: Partial<NonNullable<NonNullable<ParagraphNode["style"]>["dropCap"]>>) => void;
@@ -1104,6 +1126,7 @@ interface DocxEditorController {
1104
1126
  moveTable: (tableIndex: number, targetNodeIndex: number) => void;
1105
1127
  setTableFloating: (tableIndex: number, patch: Partial<NonNullable<NonNullable<TableNode["style"]>["floating"]>>, options?: {
1106
1128
  moveToNodeIndex?: number;
1129
+ anchorTextOffset?: number;
1107
1130
  }) => void;
1108
1131
  moveEmbeddedTableToBody: (tableRuntimeKey: string, targetNodeIndex: number) => void;
1109
1132
  replaceExpandedSelection: (text: string, range?: DocxTextRange) => DocxTextRange | undefined;
@@ -1322,6 +1345,12 @@ interface DocxEditorViewerProps {
1322
1345
  * Inline styles applied to the outer viewer root.
1323
1346
  */
1324
1347
  style?: React.CSSProperties;
1348
+ /** Controlled numeric percentage or responsive zoom mode. */
1349
+ zoom?: ViewerZoomLevel;
1350
+ /** Initial zoom level when `zoom` is uncontrolled. */
1351
+ defaultZoom?: ViewerZoomLevel;
1352
+ /** Called when the selected level or its resolved percentage changes. */
1353
+ onZoomChange?: (state: ViewerZoomState) => void;
1325
1354
  /**
1326
1355
  * Background color of each rendered page surface.
1327
1356
  *
@@ -1757,7 +1786,7 @@ declare function useDocxTrackChanges(editor: Pick<DocxEditorController, "tracked
1757
1786
  declare function useDocxComments(editor: Pick<DocxEditorController, "comments" | "showComments" | "setShowComments" | "toggleShowComments" | "createComment" | "setCommentResolved">): UseDocxCommentsResult;
1758
1787
  declare function useDocxPageLayout(editor: Pick<DocxEditorController, "model">): UseDocxPageLayoutResult;
1759
1788
  declare function useDocxPagination(editor: Pick<DocxEditorController, "currentPage" | "totalPages">): UseDocxPaginationResult;
1760
- declare function DocxEditorViewer({ editor, className, style, pageBackgroundColor, pageGapBackgroundColor, deferInitialPaginationPaint, loadingState, pageVirtualization, visiblePageRange, pageIndexes, onPageCountChange, onRequestPageReveal, headingStyles, showTrackedChanges, renderTrackedChangeCard, showComments, renderCommentCard, renderTableContextMenu, renderContextMenu, onFormFieldDoubleClick, mode, }: DocxEditorViewerProps): React.JSX.Element;
1789
+ 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;
1761
1790
 
1762
1791
  interface ResolvedModelSection {
1763
1792
  startNodeIndex: number;
@@ -2011,6 +2040,12 @@ interface ReactDocxViewerProps {
2011
2040
  * ```
2012
2041
  */
2013
2042
  className?: string;
2043
+ /** Controlled numeric percentage or responsive zoom mode. */
2044
+ zoom?: ViewerZoomLevel;
2045
+ /** Initial zoom level when `zoom` is uncontrolled. */
2046
+ defaultZoom?: ViewerZoomLevel;
2047
+ /** Called when the selected level or its resolved percentage changes. */
2048
+ onZoomChange?: (state: ViewerZoomState) => void;
2014
2049
  /**
2015
2050
  * Layout overrides for the simple read-only renderer.
2016
2051
  *
@@ -2042,7 +2077,7 @@ interface UseDocxModelState {
2042
2077
  error?: Error;
2043
2078
  }
2044
2079
  declare function useDocxModel(file?: ArrayBuffer): UseDocxModelState;
2045
- declare function ReactDocxViewer({ file, model, document, loadEmbeddedFonts, pageIndexes, className, layoutOptions, emptyState, }: ReactDocxViewerProps): React.JSX.Element;
2080
+ declare function ReactDocxViewer({ file, model, document, loadEmbeddedFonts, pageIndexes, className, zoom, defaultZoom, onZoomChange, layoutOptions, emptyState, }: ReactDocxViewerProps): React.JSX.Element;
2046
2081
  type DocxThumbnailOutput = "canvas" | "blob" | "imageBitmap";
2047
2082
  interface CreateDocxThumbnailRendererOptions {
2048
2083
  scheduling?: DocxThumbnailScheduling;
@@ -2090,4 +2125,4 @@ interface DocxThumbnailRenderer {
2090
2125
  }
2091
2126
  declare function createDocxThumbnailRenderer(documentModel: DocxThumbnailDocument, options?: CreateDocxThumbnailRendererOptions): DocxThumbnailRenderer;
2092
2127
 
2093
- 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 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 };
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 };