@docx-editor.dev/core 2.20.0 → 2.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/README.md +38 -59
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.d.ts +11 -10
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.ts +9 -9
  7. package/dist/binding.js +1 -1
  8. package/dist/chunk-25OQBAKA.js +2 -0
  9. package/dist/chunk-3B3DQMSL.js +11 -0
  10. package/dist/chunk-3P3DNJYM.js +5 -0
  11. package/dist/chunk-3PA64KPK.js +5 -0
  12. package/dist/chunk-4TYA4RLP.cjs +1 -0
  13. package/dist/chunk-7N77EN2Z.cjs +2 -0
  14. package/dist/{chunk-GSEUM6AI.cjs → chunk-AGWWNVIJ.cjs} +1 -1
  15. package/dist/chunk-AJCCS53D.js +1 -0
  16. package/dist/chunk-BF2TOG2V.js +1 -0
  17. package/dist/chunk-DFTVN25X.cjs +5 -0
  18. package/dist/chunk-DGONGMAV.js +2 -0
  19. package/dist/chunk-DZYKU2HG.js +1 -0
  20. package/dist/chunk-E5OUYRNM.cjs +5 -0
  21. package/dist/chunk-F4H3LC6M.cjs +2 -0
  22. package/dist/{chunk-CAIWEQLC.js → chunk-FPDIJ4RF.js} +1 -1
  23. package/dist/chunk-IUTTOBQW.cjs +20 -0
  24. package/dist/{chunk-OA6LFCTG.cjs → chunk-IYCXQAFT.cjs} +3 -3
  25. package/dist/chunk-JL3SI5SZ.js +18 -0
  26. package/dist/chunk-OFWUHH52.js +20 -0
  27. package/dist/chunk-OKY6JRJL.js +4 -0
  28. package/dist/{chunk-PIBYJZIH.cjs → chunk-P24FHMQW.cjs} +1 -1
  29. package/dist/chunk-QBKAOSVF.cjs +18 -0
  30. package/dist/{chunk-2HQXLL5L.cjs → chunk-RA2TDTEQ.cjs} +1 -1
  31. package/dist/chunk-S6J4O5XP.js +1 -0
  32. package/dist/{chunk-WTILOUPG.cjs → chunk-T5B4NMKF.cjs} +1 -1
  33. package/dist/chunk-TKQH7BNE.cjs +1 -0
  34. package/dist/{chunk-OHVJYJOA.js → chunk-U5GUJKTS.js} +1 -1
  35. package/dist/chunk-UKVVUHZL.cjs +1 -0
  36. package/dist/chunk-XRYSPKKC.js +1 -0
  37. package/dist/chunk-ZZRCVDQU.cjs +11 -0
  38. package/dist/collaboration/replication.cjs +1 -1
  39. package/dist/collaboration/replication.d.ts +13 -4
  40. package/dist/collaboration/replication.js +1 -1
  41. package/dist/collaboration.d.ts +4 -3
  42. package/dist/contracts/document.d.ts +3 -2
  43. package/dist/contracts/editor.cjs +1 -1
  44. package/dist/contracts/editor.d.ts +9 -9
  45. package/dist/contracts/editor.js +1 -1
  46. package/dist/contracts/interaction.d.ts +2 -2
  47. package/dist/contracts/modules.cjs +1 -1
  48. package/dist/contracts/modules.d.ts +9 -7
  49. package/dist/contracts/modules.js +1 -1
  50. package/dist/contracts/types.d.ts +2 -1
  51. package/dist/{custom-node-writes-piokwVR5.d.ts → custom-node-writes-CncR6KfC.d.ts} +2 -2
  52. package/dist/{document-protection-C6RvCHx-.d.ts → document-protection-DM6mA8Rf.d.ts} +1 -1
  53. package/dist/{editor-BgtcHulQ.d.ts → editor-BRh7GuZF.d.ts} +33 -30
  54. package/dist/editor-scope-OHPwVQ5l.d.ts +84 -0
  55. package/dist/editor.cjs +1 -1
  56. package/dist/editor.css +1 -1
  57. package/dist/editor.d.ts +130 -27
  58. package/dist/editor.js +1 -1
  59. package/dist/export.cjs +2 -2
  60. package/dist/export.d.ts +13 -13
  61. package/dist/export.js +1 -1
  62. package/dist/{font-resolver-Bv2Z25-J.d.ts → font-resolver-DwuQYj3P.d.ts} +1 -1
  63. package/dist/{headless-document-view-DHKMN_3Y.d.ts → headless-document-view-C3fc_jV0.d.ts} +2 -2
  64. package/dist/{image-resources-C51LuAAu.d.ts → image-resources-DxF-SN_8.d.ts} +1 -1
  65. package/dist/{index-3lr8xXF8.d.ts → index-3pNnG4z4.d.ts} +122 -30
  66. package/dist/index.cjs +1 -1
  67. package/dist/index.d.ts +18 -18
  68. package/dist/index.js +1 -1
  69. package/dist/{layout-shaping-CKBUSaS7.d.ts → layout-shaping-_GGjhhVc.d.ts} +1 -1
  70. package/dist/layout.cjs +1 -1
  71. package/dist/layout.d.ts +43 -18
  72. package/dist/layout.js +1 -1
  73. package/dist/{note-properties-CcXUgqr8.d.ts → note-properties-CjT31AuP.d.ts} +1 -1
  74. package/dist/{omml-equation-C5P6Ym3v.d.ts → omml-equation-Bk3OP1fv.d.ts} +1 -1
  75. package/dist/output.cjs +1 -1
  76. package/dist/output.d.ts +8 -7
  77. package/dist/output.js +1 -1
  78. package/dist/{protocol-CsawNZkt.d.ts → protocol-CrbTIW2Z.d.ts} +2 -2
  79. package/dist/{review-paragraph-order-BCIqjopY.d.ts → review-paragraph-order-D3KZohIL.d.ts} +1 -1
  80. package/dist/{revision-projection-BcRnC4Yj.d.ts → revision-projection-kVd7p6Wd.d.ts} +16 -2
  81. package/dist/{semantic-cell-selection-R9wrenwR.d.ts → semantic-cell-selection-CkSsZHDL.d.ts} +11 -4
  82. package/dist/{semantic-interaction-B7beVwH7.d.ts → semantic-interaction-Z2Xa68U5.d.ts} +1 -1
  83. package/dist/{semantic-paint-CLvHwf8y.d.ts → semantic-paint-BHKprI9P.d.ts} +18 -2
  84. package/dist/{semantic-records-CbXwnS80.d.ts → semantic-records-StH-AnHK.d.ts} +153 -10
  85. package/dist/store.cjs +1 -1
  86. package/dist/store.d.ts +468 -439
  87. package/dist/store.js +1 -1
  88. package/dist/{note-lifecycle-D4AOFCAt.d.ts → tree-package-fragment-CpEV1gl3.d.ts} +183 -143
  89. package/dist/{tree-session-contract-DTQxw2zL.d.ts → tree-session-contract-CTT9nM7Z.d.ts} +13 -8
  90. package/dist/{types-barrel-CEOy-Jv0.d.ts → types-barrel-PwcfEkaX.d.ts} +1481 -1433
  91. package/package.json +2 -2
  92. package/dist/chunk-2H4ABRMB.cjs +0 -20
  93. package/dist/chunk-3EZO3O6I.js +0 -4
  94. package/dist/chunk-44SIVFJT.cjs +0 -5
  95. package/dist/chunk-6UCDHGXI.js +0 -1
  96. package/dist/chunk-7VMVDRRU.js +0 -2
  97. package/dist/chunk-CEXC2VHI.cjs +0 -1
  98. package/dist/chunk-CF3JR35B.js +0 -11
  99. package/dist/chunk-D2V4YBWJ.cjs +0 -2
  100. package/dist/chunk-D5EHDHYV.js +0 -1
  101. package/dist/chunk-DGSJZMAE.cjs +0 -11
  102. package/dist/chunk-EHBPYFRE.js +0 -20
  103. package/dist/chunk-GOEBQ26R.js +0 -1
  104. package/dist/chunk-H6WDEAOJ.js +0 -18
  105. package/dist/chunk-I6LSEDUL.cjs +0 -18
  106. package/dist/chunk-IW35GWJN.js +0 -1
  107. package/dist/chunk-JRBGCIR2.js +0 -5
  108. package/dist/chunk-K5HIOS6J.cjs +0 -3
  109. package/dist/chunk-KLQXP27K.js +0 -3
  110. package/dist/chunk-MZFFU66H.cjs +0 -2
  111. package/dist/chunk-MZPNLIP3.js +0 -2
  112. package/dist/chunk-OHJQ7GPZ.cjs +0 -1
  113. package/dist/chunk-P4TGGDK3.js +0 -1
  114. package/dist/chunk-ZKWRCLT2.cjs +0 -1
  115. package/dist/editor-scope-DZJT4ukT.d.ts +0 -53
package/dist/store.d.ts CHANGED
@@ -1,16 +1,358 @@
1
- import { e as ResourceLimits } from './image-resources-C51LuAAu.js';
2
- export { C as CreateImageResourceCacheOptions, D as DEFAULT_IMAGE_RESOURCE_LIMITS, f as DEFAULT_LIMITS, H as HARD_CEILINGS, g as IMAGE_RESOURCE_HARD_CEILINGS, b as ImageDecodePort, c as ImageResourceLimits, h as ImageResourceLookup, I as ImageResourceState, M as MAX_SVG_SNIFF_BYTES, P as PreservedImageMime, R as RenderableImageMime, S as SupportedImageMime, V as ValidatedImageBytesHandle, i as ValidatedRasterHeader, j as createImageResourceCache, k as hasBoundedSvgRoot, l as imageResourceLookupFor, m as liveDrawingReferenceCount, r as resolveImageResourceLimits, n as resolveLimits, s as sniffImageMime, o as validateGifHeader, p as validateJpegHeader, q as validatePngHeader, v as validateRasterHeader } from './image-resources-C51LuAAu.js';
3
- import { O as OoxmlPart, i as OoxmlNode, aM as OoxmlInvariantResult, j as OoxmlPackage, aN as RelationshipRecord, a1 as OoxmlElement, aO as OoxmlInvariantIssue, aP as OoxmlHardBreakNode, at as OoxmlParagraphNode, aQ as OoxmlFldCharNode, aR as OoxmlFldSimpleNode, aS as OoxmlInstrTextNode, aT as OoxmlAttribute, W as TreeDocOp, a5 as TreeOpRejection, aU as TreeOpResult, a0 as OoxmlProperty, f as ReviewRange, R as ReviewModelInput, a as ReviewItem, C as CommentRecord, e as ReviewPosition, aV as CommentThreadState, c as ReviewCommentItem, b as ReviewRevisionItem, aB as DrawingTreeDocOp, aC as ImpactClass, a9 as ImageWrapTarget } from './types-barrel-CEOy-Jv0.js';
4
- export { aW as ACCEPTED_PARAGRAPH_PROPERTIES, aX as ACCEPTED_RUN_PROPERTIES, aY as CONTENT_CONTROL_ID_MAX, aZ as CONTENT_CONTROL_PROPERTY_ORDER, a_ as CommentAnchor, a$ as CommentPosition, b0 as CommitTextFormFieldOp, b1 as ContentControlCheckbox, b2 as ContentControlCheckboxState, b3 as ContentControlDataBinding, b4 as ContentControlDateFormat, b5 as ContentControlEntry, b6 as ContentControlKind, b7 as ContentControlLevel, b8 as ContentControlListItem, b9 as ContentControlLock, ba as ContentControlProperties, bb as ContentTypeError, bc as ContentTypeIndex, bd as ContentTypeRecords, be as DEFAULT_OOXML_PACKAGE_LIMITS, bf as DEFAULT_ZIP_LIMITS, bg as DefaultRecord, bh as DeleteTextOp, aI as DrawingImageEffects, a8 as DrawingKind, ab as DrawingLocks, aa as DrawingPositionInput, bi as HYPERLINK_RELATIONSHIP_TYPE, bj as HyperlinkKind, bk as HyperlinkTarget, bl as IMAGE_RELATIONSHIP_TYPE, aE as IMAGE_WRAP_TARGETS, bm as ImageRelationshipResolution, bn as IndexResult, bo as InsertTextOp, bp as MAX_CONTENT_CONTROLS_PER_PART, bq as MAX_CONTENT_CONTROL_NESTING, br as NameRejection, bs as NameResult, bt as OFFICE_RELATIONSHIP_NAMESPACE_URI, bu as OOXML_NODE_IDENTITY_RULES, bv as OoxmlBodyNode, bw as OoxmlBookmarkEndNode, bx as OoxmlBookmarkStartNode, by as OoxmlContentControlCalendarNode, bz as OoxmlContentControlCheckboxNode, bA as OoxmlContentControlCheckedNode, bB as OoxmlContentControlCheckedStateNode, bC as OoxmlContentControlComboBoxNode, a3 as OoxmlContentControlContentNode, bD as OoxmlContentControlDataBindingNode, bE as OoxmlContentControlDateFormatNode, bF as OoxmlContentControlDateNode, bG as OoxmlContentControlDropDownListNode, bH as OoxmlContentControlEndPropertiesNode, bI as OoxmlContentControlLidNode, bJ as OoxmlContentControlListItemNode, a2 as OoxmlContentControlNode, bK as OoxmlContentControlPropertiesNode, bL as OoxmlContentControlStoreMappedDataAsNode, bM as OoxmlContentControlTextNode, bN as OoxmlContentControlUncheckedStateNode, av as OoxmlContinuationSeparatorNode, bO as OoxmlDocumentNode, aw as OoxmlEndnotesNode, bP as OoxmlExternalTarget, ax as OoxmlFootnotesNode, V as OoxmlGenericElementNode, bQ as OoxmlGenericExtensionAttribute, bR as OoxmlHyperlinkNode, bS as OoxmlInvariantIssueCode, bT as OoxmlKnownNodeAttribute, bU as OoxmlNamespaceBinding, U as OoxmlNodeId, bV as OoxmlNodeIdentityRules, au as OoxmlNoteNode, ay as OoxmlNoteRefNode, az as OoxmlNoteReferenceNode, X as OoxmlPackageLimits, Y as OoxmlPackageRejection, bW as OoxmlPackageResult, bX as OoxmlParagraphPropertiesNode, bY as OoxmlPartMetadata, bZ as OoxmlReadRejection, b_ as OoxmlReadResult, b$ as OoxmlRunNode, c0 as OoxmlRunPropertiesNode, aA as OoxmlSeparatorNode, c1 as OoxmlTabNode, c2 as OoxmlTextElementNode, c3 as OoxmlTextNode, c4 as OoxmlWmlValAttribute, c5 as OoxmlXmlSpaceAttribute, c6 as OverrideRecord, c7 as RelationshipError, c8 as RelationshipSetResult, c9 as RelationshipTargetResolver, ca as ResolveResult, cb as ResolvedRelationship, d as ReviewCustomItem, g as ReviewRevisionKind, h as RevisionAddress, Z as RevisionBatchEntry, _ as RevisionBatchResult, $ as RevisionBatchSkipReason, cc as SetTextFormFieldDefaultOp, a7 as SourceCrop, cd as TABLE_BORDER_STYLES, ce as TabStopWrite, aG as TableBorderStyle, cf as TargetMode, cg as TextFormFieldOptions, ch as TextFormFieldRange, ci as TextFormFieldType, cj as TreeDocOpKind, ck as TreeOpEffect, cl as W15_NAMESPACE_URI, cm as WML_NAMESPACE_URI, cn as XMLNS_NAMESPACE_URI, co as XML_NAMESPACE_URI, cp as XmlLimits, cq as XmlNode, cr as XmlRejection, cs as XmlResult, ct as ZipLimits, cu as ZipReadResult, cv as ZipRejection, cw as allocateContentControlId, cx as asciiFold, cy as buildContentTypeIndex, cz as buildRelationshipSet, cA as childElements, cB as commentAnchorsOfStory, cC as commentsOfPart, cD as contentControlContentChildren, cE as contentControlContentNodeOf, cF as contentControlEndPropertiesNodeOf, cG as contentControlLevelOf, cH as contentControlPropertiesNodeOf, cI as contentControlPropertiesOf, cJ as contentControlTextOf, cK as contentControlsIn, cL as detectDuplicateNames, cM as extensionKey, cN as findContentControl, cO as findElement, cP as firstReviewRange, cQ as flattenContentControls, cR as hasAnyComment, cS as hyperlinkAnchorOf, cT as hyperlinkRelationshipIdOf, cU as hyperlinkTargetOf, cV as isContentControlContentNode, cW as isContentControlNode, cX as isContentControlWrapper, cY as isContentRevisionKind, cZ as isHyperlinkNode, c_ as isRangeMarkerKind, c$ as isValidMime, d0 as lockForbidsEdit, d1 as lockForbidsRemoval, d2 as normalizePartName, d3 as orderedContentControlProperties, d4 as parseContentControlId, d5 as partNameKey, d6 as planRevisionBatch, d7 as projectDrawing, d8 as readOnOffChild, d9 as readOoxmlPackage, da as readOoxmlPart, db as readXml, dc as readZip, dd as resolveContentControlLock, de as resolveContentType, df as resolveImageRelationship, dg as resolveInternalTarget, dh as resolveRelationship, di as reviewItemKey, dj as reviewItemRanges, dk as textContent, dl as textFormFieldsOf, dm as threadStateOfPart, dn as validateExternalTarget, dp as withPart, dq as writeOoxmlPackage, dr as writeZip } from './types-barrel-CEOy-Jv0.js';
5
- import { b as TreeModelChange, e as TreeDocumentStore, T as TreePackageStore, S as StoryScope } from './note-lifecycle-D4AOFCAt.js';
6
- export { j as AtomicNoteSpan, C as CascadeDeletedNoteReferencesOptions, D as DEFAULT_MAX_EDITABLE_STORY_PARTS, k as DrawingPropertyIdResult, F as FragmentPasteInput, i as FragmentPasteResult, l as HeaderFooterKind, m as HeaderFooterLifecycleImpact, n as HeaderFooterLifecycleOp, o as HeaderFooterLifecycleRejection, p as HeaderFooterLifecycleResult, c as HeaderFooterParts, d as HeaderFooterSectionResolution, q as HeaderFooterSlotMeta, H as HeaderFooterVariant, M as MAX_FRAGMENT_DECODED_BYTES, r as MAX_NOTES_PER_PART, s as MAX_NOTE_REFERENCE_PARTS, t as MAX_NOTE_REFERENCE_SCAN, u as NOTE_ATOM_CHAR, v as NOTE_CONTINUATION_SEPARATOR_ID, w as NOTE_ID_MAX, x as NOTE_ID_MIN, y as NOTE_SEPARATOR_ID, z as NoteDiagnostic, B as NoteDiagnosticCode, N as NoteKind, E as NoteLifecycleImpact, G as NoteLifecycleOp, J as NoteLifecycleOptions, K as NoteLifecycleRejection, L as NoteLifecycleResult, O as NoteReferenceHit, P as NoteReferenceScanBudget, Q as NoteType, U as PackageTransactResult, V as RemotePackageAttribution, f as SelectionMark, W as StoryResolveResult, a as StoryTargetRejection, X as TreeDocumentStoreOptions, Y as TreePackageStoreOptions, Z as TreeStoryRef, g as TreeTransactOptions, _ as TreeTransactResult, $ as TreeTransactionContext, a0 as allocateDrawingPropertyId, a1 as allocateNoteId, a2 as applyFragmentPaste, a3 as applyHeaderFooterLifecycleOp, a4 as applyNoteLifecycleOp, a5 as atomicNoteSpansOf, a6 as cascadeDeletedNoteReferences, a7 as collectNoteReferences, a8 as collectPackageNoteReferences, a9 as collectSectionPropertyNodes, aa as createNoteReferenceScanBudget, ab as customMarkFollows, ac as diagnoseNoteReferences, ad as findNoteById, ae as formatNoteScopeId, af as isContinuationSeparatorNode, ag as isEndnotesNode, ah as isFootnotesNode, ai as isHeaderFooterLifecycleOp, aj as isNormalNote, ak as isNoteAtomNode, al as isNoteLifecycleOp, am as isNoteNode, an as isNoteRefNode, ao as isNoteReferenceNode, ap as isSeparatorNode, aq as normalNoteIds, ar as noteAtomText, as as noteIdOf, at as noteKindOf, au as noteRefKindOf, av as noteReferenceKindOf, aw as noteTypeOf, ax as notesOf, ay as notesPartHasId, az as parseNoteId, aA as parseNoteScopeId, aB as resolveHeaderFooterParts, aC as resolveHeaderFooterPartsBySection, aD as resolveHeaderFooterResolutionBySection, aE as resolveNotesPart, aF as withBinaryPart, aG as withEmbeddedImage, aH as withoutUnreferencedImagePart } from './note-lifecycle-D4AOFCAt.js';
7
- export { D as DEFAULT_OMML_LIMITS, E as EquationExpression, L as LinearMathOmmlResult, a as LinearMathParseResult, b as LinearMathRejection, c as OFFICE_MATH_NAMESPACE_URI, O as OmmlEquationProjection, d as OmmlLimits, e as equationExpressionToLinearMath, l as linearMathToOmml, p as parseLinearMath, f as projectOmmlEquation } from './omml-equation-C5P6Ym3v.js';
8
- import { I as InsertCustomNodeWrite, C as CustomNodeWriteResult } from './custom-node-writes-piokwVR5.js';
9
- export { b as BookmarkAnchor, B as BookmarkIndex, c as CustomNodePayloadRead, d as CustomNodePayloadWrite, a as CustomNodeSweepOutcome, e as CustomNodeSweepResult, f as CustomNodeWriteRejection, D as DocumentTrackingSettings, E as EmbeddedFont, F as FontStyleKey, L as ListKind, M as MAX_CUSTOM_NODE_LABEL_LENGTH, g as MAX_CUSTOM_NODE_PAYLOAD_LENGTH, N as NO_TRACKING_SETTINGS, R as ReadEmbeddedFontsOptions, h as buildBookmarkIndex, i as customNodePayloadsByControl, j as customNodePayloadsOf, k as deobfuscateFont, l as ensureListDefinition, m as ensureNumberingLevel, n as insertCustomNodeWrite, r as readEmbeddedFonts, o as readTrackingSettings, p as removeCustomNodeWrite, s as sweepCustomNodePayloads } from './custom-node-writes-piokwVR5.js';
10
- export { c as collectFlowBlocks, a as commentBodyText, b as commentInitials, d as contentControlContentOf, e as deepParagraphOrderOfPart, i as isContentControl, f as isContentControlContent, p as paragraphOrderOfPart, w as walkAllStoryParagraphs, g as walkParagraphInline, h as walkStoryBlocks } from './review-paragraph-order-BCIqjopY.js';
11
- export { D as DocumentProperties, E as EnsuredHyperlinkRelationship, a as HeadlessDocumentRejection, H as HeadlessDocumentView, b as HeadlessThemeFonts, O as OpenHeadlessDocumentResult, c as authorableHyperlinkTarget, e as ensureHyperlinkRelationship, h as headlessViewOfStore, o as openHeadlessDocument, r as relationshipTargetIn } from './headless-document-view-DHKMN_3Y.js';
12
- export { A as AuthoredNoteProperties, D as DEFAULT_ENDNOTE_PROPERTIES, a as DEFAULT_FOOTNOTE_PROPERTIES, E as EndnotePosition, F as FootnotePosition, N as NoteNumRestart, R as ResolvedEndnoteProperties, b as ResolvedFootnoteProperties, c as authoredDocumentEndnoteProperties, d as authoredDocumentFootnoteProperties, e as authoredEndnotePropertiesFromSectPr, f as authoredFootnotePropertiesFromSectPr, i as isLegalEndnotePosition, g as isLegalFootnotePosition, h as isLegalNumRestart, p as parseAuthoredNoteProperties, r as resolveEndnoteProperties, j as resolveFootnoteProperties, s as settingsPartOf } from './note-properties-CcXUgqr8.js';
13
- export { a as DocumentProtectionEdit, D as DocumentProtectionState, N as NO_DOCUMENT_PROTECTION, r as readDocumentProtection } from './document-protection-C6RvCHx-.js';
1
+ import { e as ResourceLimits } from './image-resources-DxF-SN_8.js';
2
+ export { C as CreateImageResourceCacheOptions, D as DEFAULT_IMAGE_RESOURCE_LIMITS, f as DEFAULT_LIMITS, H as HARD_CEILINGS, g as IMAGE_RESOURCE_HARD_CEILINGS, b as ImageDecodePort, c as ImageResourceLimits, h as ImageResourceLookup, I as ImageResourceState, M as MAX_SVG_SNIFF_BYTES, P as PreservedImageMime, R as RenderableImageMime, S as SupportedImageMime, V as ValidatedImageBytesHandle, i as ValidatedRasterHeader, j as createImageResourceCache, k as hasBoundedSvgRoot, l as imageResourceLookupFor, m as liveDrawingReferenceCount, r as resolveImageResourceLimits, n as resolveLimits, s as sniffImageMime, o as validateGifHeader, p as validateJpegHeader, q as validatePngHeader, v as validateRasterHeader } from './image-resources-DxF-SN_8.js';
3
+ import { O as OoxmlPart, i as OoxmlNode, aM as OoxmlInvariantResult, at as OoxmlParagraphNode, aN as OoxmlFldCharNode, aO as OoxmlFldSimpleNode, aP as OoxmlInstrTextNode, aQ as OoxmlInvariantIssue, a1 as OoxmlElement, W as TreeDocOp, a5 as TreeOpRejection, aR as TreeOpResult, j as OoxmlPackage, aS as RelationshipRecord, aT as OoxmlHardBreakNode, aU as OoxmlAttribute, a0 as OoxmlProperty, f as ReviewRange, R as ReviewModelInput, a as ReviewItem, C as CommentRecord, e as ReviewPosition, aV as CommentThreadState, c as ReviewCommentItem, b as ReviewRevisionItem, aB as DrawingTreeDocOp, aC as ImpactClass, a9 as ImageWrapTarget } from './types-barrel-PwcfEkaX.js';
4
+ export { aW as ACCEPTED_PARAGRAPH_PROPERTIES, aX as ACCEPTED_RUN_PROPERTIES, aY as CONTENT_CONTROL_ID_MAX, aZ as CONTENT_CONTROL_PROPERTY_ORDER, a_ as CommentAnchor, a$ as CommentPosition, b0 as CommitTextFormFieldOp, b1 as ContentControlCheckbox, b2 as ContentControlCheckboxState, b3 as ContentControlDataBinding, b4 as ContentControlDateFormat, b5 as ContentControlEntry, b6 as ContentControlKind, b7 as ContentControlLevel, b8 as ContentControlListItem, b9 as ContentControlLock, ba as ContentControlProperties, bb as ContentTypeError, bc as ContentTypeIndex, bd as ContentTypeRecords, be as DEFAULT_OOXML_PACKAGE_LIMITS, bf as DEFAULT_ZIP_LIMITS, bg as DefaultRecord, bh as DeleteTextOp, aI as DrawingImageEffects, a8 as DrawingKind, ab as DrawingLocks, aa as DrawingPositionInput, bi as HYPERLINK_RELATIONSHIP_TYPE, bj as HyperlinkKind, bk as HyperlinkTarget, bl as IMAGE_RELATIONSHIP_TYPE, aE as IMAGE_WRAP_TARGETS, bm as ImageRelationshipResolution, bn as IndexResult, bo as InsertBuildingBlockOp, bp as InsertTextOp, bq as LegacyCheckboxFieldRange, br as MAX_CONTENT_CONTROLS_PER_PART, bs as MAX_CONTENT_CONTROL_NESTING, bt as NameRejection, bu as NameResult, bv as OFFICE_RELATIONSHIP_NAMESPACE_URI, bw as OOXML_NODE_IDENTITY_RULES, bx as OoxmlBodyNode, by as OoxmlBookmarkEndNode, bz as OoxmlBookmarkStartNode, bA as OoxmlContentControlCalendarNode, bB as OoxmlContentControlCheckboxNode, bC as OoxmlContentControlCheckedNode, bD as OoxmlContentControlCheckedStateNode, bE as OoxmlContentControlComboBoxNode, a3 as OoxmlContentControlContentNode, bF as OoxmlContentControlDataBindingNode, bG as OoxmlContentControlDateFormatNode, bH as OoxmlContentControlDateNode, bI as OoxmlContentControlDropDownListNode, bJ as OoxmlContentControlEndPropertiesNode, bK as OoxmlContentControlLidNode, bL as OoxmlContentControlListItemNode, a2 as OoxmlContentControlNode, bM as OoxmlContentControlPropertiesNode, bN as OoxmlContentControlStoreMappedDataAsNode, bO as OoxmlContentControlTextNode, bP as OoxmlContentControlUncheckedStateNode, av as OoxmlContinuationSeparatorNode, bQ as OoxmlDocumentNode, aw as OoxmlEndnotesNode, bR as OoxmlExternalTarget, ax as OoxmlFootnotesNode, V as OoxmlGenericElementNode, bS as OoxmlGenericExtensionAttribute, bT as OoxmlHyperlinkNode, bU as OoxmlInvariantIssueCode, bV as OoxmlKnownNodeAttribute, bW as OoxmlNamespaceBinding, U as OoxmlNodeId, bX as OoxmlNodeIdentityRules, au as OoxmlNoteNode, ay as OoxmlNoteRefNode, az as OoxmlNoteReferenceNode, X as OoxmlPackageLimits, Y as OoxmlPackageRejection, bY as OoxmlPackageResult, bZ as OoxmlParagraphPropertiesNode, b_ as OoxmlPartMetadata, b$ as OoxmlReadRejection, c0 as OoxmlReadResult, c1 as OoxmlRunNode, c2 as OoxmlRunPropertiesNode, aA as OoxmlSeparatorNode, c3 as OoxmlTabNode, c4 as OoxmlTextElementNode, c5 as OoxmlTextNode, c6 as OoxmlWmlValAttribute, c7 as OoxmlXmlSpaceAttribute, c8 as OverrideRecord, c9 as RelationshipError, ca as RelationshipSetResult, cb as RelationshipTargetResolver, cc as ResolveResult, cd as ResolvedRelationship, d as ReviewCustomItem, g as ReviewRevisionKind, h as RevisionAddress, Z as RevisionBatchEntry, _ as RevisionBatchResult, $ as RevisionBatchSkipReason, ce as SetLegacyCheckboxOp, cf as SetLegacyDropdownOp, cg as SetTextFormFieldDefaultOp, a7 as SourceCrop, ch as TABLE_BORDER_STYLES, ci as TabStopWrite, aG as TableBorderStyle, cj as TargetMode, ck as TextFormFieldOptions, cl as TextFormFieldRange, cm as TextFormFieldType, cn as TreeDocOpKind, co as TreeOpEffect, cp as W15_NAMESPACE_URI, cq as WML_NAMESPACE_URI, cr as XMLNS_NAMESPACE_URI, cs as XML_NAMESPACE_URI, ct as XmlLimits, cu as XmlNode, cv as XmlRejection, cw as XmlResult, cx as ZipLimits, cy as ZipReadResult, cz as ZipRejection, cA as allocateContentControlId, cB as asciiFold, cC as buildContentTypeIndex, cD as buildRelationshipSet, cE as childElements, cF as commentAnchorsOfStory, cG as commentsOfPart, cH as contentControlContentChildren, cI as contentControlContentNodeOf, cJ as contentControlEndPropertiesNodeOf, cK as contentControlLevelOf, cL as contentControlPropertiesNodeOf, cM as contentControlPropertiesOf, cN as contentControlTextOf, cO as contentControlsIn, cP as detectDuplicateNames, cQ as extensionKey, cR as findContentControl, cS as findElement, cT as firstReviewRange, cU as flattenContentControls, cV as hasAnyComment, cW as hyperlinkAnchorOf, cX as hyperlinkRelationshipIdOf, cY as hyperlinkTargetOf, cZ as isContentControlContentNode, c_ as isContentControlNode, c$ as isContentControlWrapper, d0 as isContentRevisionKind, d1 as isHyperlinkNode, d2 as isRangeMarkerKind, d3 as isValidMime, d4 as legacyCheckboxFieldsOf, d5 as lockForbidsEdit, d6 as lockForbidsRemoval, d7 as normalizePartName, d8 as orderedContentControlProperties, d9 as parseContentControlId, da as partNameKey, db as planRevisionBatch, dc as projectDrawing, dd as readOnOffChild, de as readOoxmlPackage, df as readOoxmlPart, dg as readXml, dh as readZip, di as resolveContentControlLock, dj as resolveContentType, dk as resolveImageRelationship, dl as resolveInternalTarget, dm as resolveRelationship, dn as reviewItemKey, dp as reviewItemRanges, dq as textContent, dr as textFormFieldsOf, ds as threadStateOfPart, dt as validateExternalTarget, du as withPart, dv as writeOoxmlPackage, dw as writeZip } from './types-barrel-PwcfEkaX.js';
5
+ import { c as TreeModelChange, f as TreeDocumentStore, T as TreePackageStore, S as StoryScope } from './tree-package-fragment-CpEV1gl3.js';
6
+ export { k as AtomicNoteSpan, C as CascadeDeletedNoteReferencesOptions, D as DEFAULT_MAX_EDITABLE_STORY_PARTS, l as DrawingPropertyIdResult, F as FragmentPasteInput, j as FragmentPasteResult, m as HeaderFooterKind, n as HeaderFooterLifecycleImpact, o as HeaderFooterLifecycleOp, p as HeaderFooterLifecycleRejection, q as HeaderFooterLifecycleResult, d as HeaderFooterParts, e as HeaderFooterSectionResolution, s as HeaderFooterSlotMeta, H as HeaderFooterVariant, t as HistoryCaptureKind, b as HistoryGroup, M as MAX_FRAGMENT_DECODED_BYTES, u as MAX_NOTES_PER_PART, v as MAX_NOTE_REFERENCE_PARTS, w as MAX_NOTE_REFERENCE_SCAN, x as NOTE_ATOM_CHAR, y as NOTE_CONTINUATION_SEPARATOR_ID, z as NOTE_ID_MAX, B as NOTE_ID_MIN, E as NOTE_SEPARATOR_ID, G as NoteDiagnostic, J as NoteDiagnosticCode, N as NoteKind, K as NoteLifecycleImpact, L as NoteLifecycleOp, O as NoteLifecycleOptions, P as NoteLifecycleRejection, Q as NoteLifecycleResult, U as NoteReferenceHit, V as NoteReferenceScanBudget, W as NoteType, X as PackageTransactResult, Y as RemotePackageAttribution, g as SelectionMark, Z as StoryResolveResult, a as StoryTargetRejection, _ as TreeDocumentStoreOptions, $ as TreePackageStoreOptions, a0 as TreeStoryRef, h as TreeTransactOptions, a1 as TreeTransactResult, a2 as TreeTransactionContext, a3 as allocateDrawingPropertyId, a4 as allocateNoteId, a5 as applyFragmentPaste, a6 as applyHeaderFooterLifecycleOp, a7 as applyNoteLifecycleOp, a8 as atomicNoteSpansOf, a9 as cascadeDeletedNoteReferences, aa as collectNoteReferences, ab as collectPackageNoteReferences, ac as collectSectionPropertyNodes, ad as createNoteReferenceScanBudget, ae as customMarkFollows, af as diagnoseNoteReferences, ag as findNoteById, ah as formatNoteScopeId, ai as isContinuationSeparatorNode, aj as isEndnotesNode, ak as isFootnotesNode, al as isHeaderFooterLifecycleOp, am as isNormalNote, an as isNoteAtomNode, ao as isNoteLifecycleOp, ap as isNoteNode, aq as isNoteRefNode, ar as isNoteReferenceNode, as as isSeparatorNode, at as normalNoteIds, au as noteAtomText, av as noteIdOf, aw as noteKindOf, ax as noteRefKindOf, ay as noteReferenceKindOf, az as noteTypeOf, aA as notesOf, aB as notesPartHasId, aC as observeHistoryGroup, aD as parseNoteId, aE as parseNoteScopeId, r as reportHistoryGroup, aF as resolveHeaderFooterParts, aG as resolveHeaderFooterPartsBySection, aH as resolveHeaderFooterResolutionBySection, aI as resolveNotesPart, aJ as withBinaryPart, aK as withEmbeddedImage, aL as withoutUnreferencedImagePart } from './tree-package-fragment-CpEV1gl3.js';
7
+ export { D as DEFAULT_OMML_LIMITS, E as EquationExpression, L as LinearMathOmmlResult, a as LinearMathParseResult, b as LinearMathRejection, c as OFFICE_MATH_NAMESPACE_URI, O as OmmlEquationProjection, d as OmmlLimits, e as equationExpressionToLinearMath, l as linearMathToOmml, p as parseLinearMath, f as projectOmmlEquation } from './omml-equation-Bk3OP1fv.js';
8
+ import { I as InsertCustomNodeWrite, C as CustomNodeWriteResult } from './custom-node-writes-CncR6KfC.js';
9
+ export { b as BookmarkAnchor, B as BookmarkIndex, c as CustomNodePayloadRead, d as CustomNodePayloadWrite, a as CustomNodeSweepOutcome, e as CustomNodeSweepResult, f as CustomNodeWriteRejection, D as DocumentTrackingSettings, E as EmbeddedFont, F as FontStyleKey, L as ListKind, M as MAX_CUSTOM_NODE_LABEL_LENGTH, g as MAX_CUSTOM_NODE_PAYLOAD_LENGTH, N as NO_TRACKING_SETTINGS, R as ReadEmbeddedFontsOptions, h as buildBookmarkIndex, i as customNodePayloadsByControl, j as customNodePayloadsOf, k as deobfuscateFont, l as ensureListDefinition, m as ensureNumberingLevel, n as insertCustomNodeWrite, r as readEmbeddedFonts, o as readTrackingSettings, p as removeCustomNodeWrite, s as sweepCustomNodePayloads } from './custom-node-writes-CncR6KfC.js';
10
+ export { c as collectFlowBlocks, a as commentBodyText, b as commentInitials, d as contentControlContentOf, e as deepParagraphOrderOfPart, i as isContentControl, f as isContentControlContent, p as paragraphOrderOfPart, w as walkAllStoryParagraphs, g as walkParagraphInline, h as walkStoryBlocks } from './review-paragraph-order-D3KZohIL.js';
11
+ export { D as DocumentProperties, E as EnsuredHyperlinkRelationship, a as HeadlessDocumentRejection, H as HeadlessDocumentView, b as HeadlessThemeFonts, O as OpenHeadlessDocumentResult, c as authorableHyperlinkTarget, e as ensureHyperlinkRelationship, h as headlessViewOfStore, o as openHeadlessDocument, r as relationshipTargetIn } from './headless-document-view-C3fc_jV0.js';
12
+ export { A as AuthoredNoteProperties, D as DEFAULT_ENDNOTE_PROPERTIES, a as DEFAULT_FOOTNOTE_PROPERTIES, E as EndnotePosition, F as FootnotePosition, N as NoteNumRestart, R as ResolvedEndnoteProperties, b as ResolvedFootnoteProperties, c as authoredDocumentEndnoteProperties, d as authoredDocumentFootnoteProperties, e as authoredEndnotePropertiesFromSectPr, f as authoredFootnotePropertiesFromSectPr, i as isLegalEndnotePosition, g as isLegalFootnotePosition, h as isLegalNumRestart, p as parseAuthoredNoteProperties, r as resolveEndnoteProperties, j as resolveFootnoteProperties, s as settingsPartOf } from './note-properties-CjT31AuP.js';
13
+ export { a as DocumentProtectionEdit, D as DocumentProtectionState, N as NO_DOCUMENT_PROTECTION, r as readDocumentProtection } from './document-protection-DM6mA8Rf.js';
14
+ import './editor-scope-OHPwVQ5l.js';
15
+
16
+ /**
17
+ * Serialize normalized XML from a canonical part using repository-controlled
18
+ * prefixes and validated, escaped names and values. This does not yet replace
19
+ * writeDocx; package integration belongs to the subsequent migration pass.
20
+ */
21
+ declare function serializeOoxmlPart(part: OoxmlPart): string;
22
+ /** Repository-owned namespace-aware semantic XML oracle. */
23
+ declare function canonicalOoxmlFingerprint(value: OoxmlPart | OoxmlNode): string;
24
+ /**
25
+ * Structural equality of two canonical trees, ignoring node ids.
26
+ *
27
+ * Ids differ between two parses of the same bytes, so comparing them would report every reopen as
28
+ * a change. This compares what the document SAYS.
29
+ */
30
+ declare function ooxmlTreesEqual(left: OoxmlPart | OoxmlNode, right: OoxmlPart | OoxmlNode): boolean;
31
+
32
+ /**
33
+ * Validate a parser-created or copy-modified immutable part before publication.
34
+ * Future tree-edit primitives can retain shared nodes and their IDs, while any
35
+ * replacement chooses explicitly whether to retain or allocate identity.
36
+ */
37
+ declare function validateOoxmlPart(part: OoxmlPart): OoxmlInvariantResult;
38
+
39
+ /** UTF-16 placeholder for one atomic field unit in `paragraphTextOf` / segments. */
40
+ declare const FIELD_ATOM_CHAR = "\uFFFC";
41
+ /**
42
+ * Which part of a complex field a `w:fldChar` marks.
43
+ *
44
+ * A complex field spans many runs: `begin`, the instruction, `separate`, the cached result, then
45
+ * `end` — which is why a field is one logical unit across several nodes.
46
+ */
47
+ type FldCharType = 'begin' | 'separate' | 'end';
48
+ /** Read `@w:fldCharType` when present and schema-legal. */
49
+ declare function fldCharType(node: OoxmlNode): FldCharType | null;
50
+ /** Whether a node is a `w:fldChar` field boundary marker. */
51
+ declare function isFldCharNode(node: OoxmlNode): node is OoxmlFldCharNode;
52
+ /**
53
+ * Whether a node is `w:instrText` — a field's instruction.
54
+ *
55
+ * Instructions are never EXECUTED or auto-resolved: `DDE` and `INCLUDE*` render inert.
56
+ */
57
+ declare function isInstrTextNode(node: OoxmlNode): node is OoxmlInstrTextNode;
58
+ /** Whether a node is `w:fldSimple` — a field whose instruction and result are one element. */
59
+ declare function isFldSimpleNode(node: OoxmlNode): node is OoxmlFldSimpleNode;
60
+ /** Typed or generic `w:fldChar` with the given type. */
61
+ declare function isFldChar(node: OoxmlNode, type: FldCharType): boolean;
62
+ /**
63
+ * Typed or generic `w:instrText`, and `w:delInstrText` — the form a tracked deletion gives
64
+ * the instruction (§17.16.13), always generic in the canonical tree.
65
+ *
66
+ * One predicate for both on purpose: everything that consumes instruction text (the offset
67
+ * authority, the layout field machine, span collection) must treat a deleted field's
68
+ * instruction exactly like a live one — ingested per phase, never painted. Excluding the
69
+ * deleted form let its `w:delInstrText` fall through those walks as ordinary run content.
70
+ */
71
+ declare function isInstrText(node: OoxmlNode): boolean;
72
+ /** Typed or generic `w:fldSimple`. */
73
+ declare function isFldSimple(node: OoxmlNode): boolean;
74
+ /** Concatenated text descendants of `w:instrText` (instruction only — never executed). */
75
+ declare function instrTextValue(node: OoxmlNode): string;
76
+ /** `@w:instr` on `w:fldSimple`, or undefined when absent. */
77
+ declare function fldSimpleInstr(node: OoxmlNode): string | undefined;
78
+ /**
79
+ * Read an on/off WML attribute (`dirty` / `fldLock`).
80
+ *
81
+ * Returns `undefined` when absent, otherwise the OOXML on/off interpretation
82
+ * (present without val, or val not explicitly off → true).
83
+ */
84
+ declare function fieldOnOffAttribute(node: OoxmlNode, localName: 'dirty' | 'fldLock'): boolean | undefined;
85
+ /** Model text contributed by one atomic field unit. */
86
+ declare function fieldAtomText(): typeof FIELD_ATOM_CHAR;
87
+ /**
88
+ * True when a node is field chrome that never contributes its own model text outside
89
+ * an atomic span (markers + instruction). Cached result `w:t` is separate.
90
+ */
91
+ declare function isFieldChrome(node: OoxmlNode): boolean;
92
+ /**
93
+ * True when a `w:fldChar` carries `w:ffData` — a LEGACY FORM FIELD (§17.16.17).
94
+ *
95
+ * FORMTEXT, FORMCHECKBOX and FORMDROPDOWN are what a fillable Word form is made of, and Word
96
+ * shades them on sight so a reader can find the blanks. That is a presentation question,
97
+ * answered by the element's presence alone — this predicate never looks inside.
98
+ *
99
+ * Rendering STATE (a checkbox's checked bit, a dropdown's entries and selection) is different:
100
+ * {@link legacyFormFieldDataOf} reads exactly that, bounded, and nothing else. The contract
101
+ * stands: `w:ffData` macro references (`w:entryMacro` / `w:exitMacro`), `w:name`, help/status
102
+ * text and behavior flags are attacker-supplied script references and are NEVER read, returned
103
+ * or resolved by anything in this module.
104
+ */
105
+ declare function hasLegacyFormFieldData(node: OoxmlNode): boolean;
106
+ /**
107
+ * One atomic field span inside a paragraph for caret / delete / selection.
108
+ *
109
+ * `removeNodeIds` lists every node that must leave with the unit (begin…end chrome and
110
+ * cached-result content for complex fields; the `fldSimple` element for simple fields).
111
+ *
112
+ * `formatRunIds` lists the runs whose `w:rPr` owns displayed result formatting — result-phase
113
+ * runs with measurable cache text for complex fields, child `w:r`s for `fldSimple`, or the
114
+ * separate/begin run when the result is empty. Delete / caret addressing still uses `runId`
115
+ * (the begin / simple node); formatting must not rewrite chrome-only begin runs when the
116
+ * painted glyphs come from a different result run.
117
+ */
118
+ interface AtomicFieldSpan {
119
+ readonly kind: 'complex' | 'simple';
120
+ /** Addressable segment node (begin `fldChar` or `fldSimple`). */
121
+ readonly node: OoxmlNode;
122
+ /** Run that owns the begin marker; empty string for paragraph-level `fldSimple`. */
123
+ readonly runId: string;
124
+ readonly removeNodeIds: readonly string[];
125
+ /** Runs that own displayed result formatting (may differ from `runId`). */
126
+ readonly formatRunIds: readonly string[];
127
+ }
128
+ /** Collect only fields whose cached result is one atomic model unit. */
129
+ declare function atomicFieldSpansOf(paragraph: OoxmlParagraphNode, options?: {
130
+ readonly maxNesting?: number;
131
+ readonly maxInstructionChars?: number;
132
+ }): readonly AtomicFieldSpan[];
133
+ /** Whether `fldCharType` is a legal ST_FldCharType value (used by tests / guards). */
134
+ declare function isLegalFldCharType(value: string): boolean;
135
+
136
+ /** One addressable unit of paragraph text: text, tab, hard break, or atomic field. */
137
+ interface Segment {
138
+ readonly runId: string;
139
+ readonly node: OoxmlNode;
140
+ readonly start: number;
141
+ readonly end: number;
142
+ /**
143
+ * When set, deleting this segment removes every listed node id in one step (atomic
144
+ * field begin→end or `fldSimple`). Absent for ordinary text/tab/break segments.
145
+ */
146
+ readonly removeNodeIds?: readonly string[];
147
+ /**
148
+ * When set, run formatting for this atom targets these runs (field result ownership),
149
+ * not necessarily `runId`. Absent for ordinary text/tab/break segments.
150
+ */
151
+ readonly formatRunIds?: readonly string[];
152
+ }
153
+ /**
154
+ * Flatten a paragraph into UTF-16 addressable segments, in document order.
155
+ *
156
+ * A HYPERLINK's runs are addressed too. `w:hyperlink` is a run container, not a leaf, and
157
+ * the characters inside a link are ordinary paragraph text: the user selects them, types
158
+ * over them and deletes them like any other. Skipping the container — which is what
159
+ * iterating only direct `w:r` children did — left every link's text with no offsets at all,
160
+ * so `paragraphTextOf` read "Visit or ." for a sentence that says "Visit Example.com or
161
+ * Anthropic's website." and layout, selection and the ops all agreed on the wrong string.
162
+ *
163
+ * Inline CONTENT CONTROLS are the same class of wrapper: their `w:sdtContent` runs join the
164
+ * paragraph's offset stream with no break opportunity at the boundary. Nesting is bounded
165
+ * (`MAX_INLINE_CONTAINER_DEPTH`); beyond the bound the wrapper is opaque so recursion
166
+ * cannot exhaust the stack.
167
+ *
168
+ * `runId` stays the id of the run the content actually lives in, at whatever depth: the
169
+ * appliers resolve it with `findNode` and rebuild that run's children, so nesting costs them
170
+ * nothing.
171
+ */
172
+ declare function segmentsOf(paragraph: OoxmlParagraphNode): Segment[];
173
+ /** Half-open `[start, end)` of one node in its paragraph's model offset space. */
174
+ interface OffsetSpan {
175
+ readonly start: number;
176
+ readonly end: number;
177
+ }
178
+ /**
179
+ * Every node's place in the paragraph's model offset space, from the SAME walk `segmentsOf`
180
+ * uses.
181
+ *
182
+ * The offset model has exactly one authority, and this is how a caller borrows it. Three
183
+ * private walkers used to re-derive it — one in the tracked-change writer, one in the comment
184
+ * anchor reader, one in the review queue — and all three disagreed with `segmentsOf` and with
185
+ * each other: none gave a note reference or an atomic field its length of one, one counted a
186
+ * field's instruction text as visible characters, and one never descended into `w:hyperlink`
187
+ * at all. The consequences were an anchor short by a link's length, two unrelated comments
188
+ * threaded onto one zero-width offset, and a tracked insert landing a character out in any
189
+ * paragraph carrying a footnote. Patching each walker only resets the clock on the next drift.
190
+ *
191
+ * A node the walk never reaches — content under a `generic` container, or past the nesting cap
192
+ * — has NO span, and {@link ParagraphOffsetIndex.lengthOf} reports zero for it. That is the
193
+ * same answer `segmentsOf` gives: it contributes no addressable characters.
194
+ */
195
+ interface ParagraphOffsetIndex {
196
+ /** The paragraph's own length, identical to {@link paragraphLength}. */
197
+ readonly length: number;
198
+ readonly segments: readonly Segment[];
199
+ /** Where a node sits, or null when the offset walk never reached it. */
200
+ spanOf(node: OoxmlNode | string): OffsetSpan | null;
201
+ /** A node's model length: `end - start` of its span, and 0 when it has none. */
202
+ lengthOf(node: OoxmlNode | string): number;
203
+ }
204
+ /**
205
+ * THE paragraph offset authority: maps a paragraph's UTF-16 offsets to the nodes holding them.
206
+ *
207
+ * One authority on purpose. An atomic field spans many nodes but is ONE unit to an offset, and a
208
+ * second implementation that disagreed would place edits inside content that cannot be split.
209
+ */
210
+ declare function paragraphOffsetIndex(paragraph: OoxmlParagraphNode): ParagraphOffsetIndex;
211
+ /** One inline content control's identity and the UTF-16 span its content covers. */
212
+ interface InlineControlSpan {
213
+ readonly controlId: string;
214
+ readonly start: number;
215
+ readonly end: number;
216
+ }
217
+ /**
218
+ * The innermost inline content control whose content ends exactly at `offset` — the caret
219
+ * at its right outer edge. What Backspace consults to delete the node as ONE unit
220
+ * (pro-review-and-custom-nodes 4.6): deleting its last character from outside would either
221
+ * strip one letter from a content-locked label (refused, so the key looks dead) or leave a
222
+ * half-deleted chip whose tag still claims the full payload.
223
+ */
224
+ declare function inlineControlEndingAt(paragraph: OoxmlParagraphNode, offset: number): InlineControlSpan | null;
225
+ /** The forward-delete mirror: the control whose content STARTS exactly at `offset`. */
226
+ declare function inlineControlStartingAt(paragraph: OoxmlParagraphNode, offset: number): InlineControlSpan | null;
227
+
228
+ /** An edited part, or the invariant violations that rejected the edit. */
229
+ type OoxmlEditResult = {
230
+ readonly ok: true;
231
+ readonly part: OoxmlPart;
232
+ } | {
233
+ readonly ok: false;
234
+ readonly issues: readonly OoxmlInvariantIssue[];
235
+ };
236
+ /**
237
+ * How an edit primitive validates its result.
238
+ *
239
+ * By default every primitive runs the full-part invariant validation before handing its
240
+ * result back — the safe reading for an isolated call. A TRANSACTION applying many ops pays
241
+ * that full-tree walk once per primitive, which is what made a hundred-paragraph paste
242
+ * quadratic; it defers instead, and runs the same validation ONCE on the final tree before
243
+ * anything is published. Deferring is only sound for a caller that owns a commit boundary:
244
+ * nothing may escape between the unvalidated intermediate and the validated result.
245
+ */
246
+ interface EditOptions {
247
+ readonly deferValidation?: boolean;
248
+ /**
249
+ * A shared minter for `@w:id` on a NEW revision, for the ops of one transaction.
250
+ *
251
+ * `nextRevisionId` walks the whole part to find the highest id in use, and a formatting
252
+ * write emits one op per run — so a Select All + Bold in suggesting mode paid a
253
+ * document-wide walk thousands of times over. The transaction hands its ops one minter
254
+ * instead, and it is DROPPED the moment an op that can import foreign revision ids runs
255
+ * (a paste carries its own), because a stale minter would hand out an id the document had
256
+ * just started using — and two revisions sharing an address are one card in the pane.
257
+ *
258
+ * Absent means "mint your own": every applier falls back to its own walk, which is what a
259
+ * caller outside a transaction gets.
260
+ */
261
+ readonly revisionIds?: () => string;
262
+ /**
263
+ * The transaction's revision-id bookkeeping for the tracked TEXT ops, where `revisionIds`
264
+ * above hands the property ops one shared id for their whole group.
265
+ *
266
+ * Absent means "mint your own and remember nothing", which is what a caller outside a
267
+ * transaction gets: every applier falls back to its own walk of the part.
268
+ */
269
+ readonly trackedRevisionIds?: TransactionRevisionIds;
270
+ }
271
+ /**
272
+ * What one transaction knows about the revision ids its tracked text ops write.
273
+ *
274
+ * TWO questions, and they are the same bookkeeping. `nextRevisionId` walks the whole part, so
275
+ * a replacement — a `deleteText` and an `insertText` in one transaction — walked it twice, and
276
+ * on a five-hundred-page document that doubled the cost of every one. And an insertion aimed
277
+ * at the front edge of a deletion relocates past it only when that deletion is THIS
278
+ * transaction's own: typing over a selection. Backspace, then a keystroke, is two
279
+ * transactions, and there the typed text belongs in FRONT of the struck character, as Word
280
+ * writes it. Adjacency alone cannot tell the two apart; the ids can.
281
+ */
282
+ interface TransactionRevisionIds {
283
+ /** A fresh `@w:id`, from this transaction's one walk of the part. */
284
+ mint(): string;
285
+ /**
286
+ * Record a wrapper this transaction wrote, by its FULL `CT_TrackChange` identity — id,
287
+ * author and date, as `revisionKey` spells it. Not by the id alone: that number comes out
288
+ * of the file, nothing makes it unique, and a strike joining `w:id="3"` in one paragraph
289
+ * would otherwise claim an unrelated `w:id="3"` elsewhere as this edit's own.
290
+ */
291
+ wrote(key: string): void;
292
+ /** Whether this transaction wrote a wrapper with that identity. */
293
+ wroteUnder(key: string): boolean;
294
+ }
295
+ /** Every node id currently present in the part. */
296
+ declare function collectNodeIds(part: OoxmlPart): Set<string>;
297
+ /**
298
+ * Mint ids for nodes an edit introduces.
299
+ *
300
+ * Deterministic and collision-checked against the whole part: a structural-path id from the
301
+ * original parse (`/word/document.xml#0.1.2`) and a minted one (`/word/document.xml#new:3`)
302
+ * can never coincide, and the counter skips anything already taken so repeated edits in one
303
+ * session stay unique.
304
+ *
305
+ * The collision check only sees nodes that are IN the tree. A caller that clones a subtree
306
+ * and attaches it LATER — after other ops have replaced the root and reset the counter —
307
+ * must mint in its own `family`: two `new`-family allocators over different roots can hand
308
+ * out the same id, one to a detached clone and one to the tree, and the clone's insertion
309
+ * then fails the duplicate-id invariant.
310
+ *
311
+ * Checks the part's node index directly rather than copying every id into a fresh set: the
312
+ * copy was O(document) per op, and an allocator is created for every op.
313
+ */
314
+ declare function createNodeIdAllocator(part: OoxmlPart, family?: 'new' | 'paste'): () => string;
315
+ /** Whether a node id exists in the part. */
316
+ declare function hasNode(part: OoxmlPart, nodeId: string): boolean;
317
+ /** Read a node back out of a part by id. */
318
+ declare function findNode(part: OoxmlPart, nodeId: string): OoxmlNode | null;
319
+ /** The element that holds a node, or null for the root and for unknown ids. */
320
+ declare function parentNodeOf(part: OoxmlPart, nodeId: string): OoxmlElement | null;
321
+ /** Replace one node's children wholesale. */
322
+ declare function replaceChildren(part: OoxmlPart, nodeId: string, children: readonly OoxmlNode[], options?: EditOptions): OoxmlEditResult;
323
+ /** Insert children into a node at `index` (clamped to the child list). */
324
+ declare function insertChildren(part: OoxmlPart, nodeId: string, index: number, children: readonly OoxmlNode[], options?: EditOptions): OoxmlEditResult;
325
+ /** Replace one node with another, keeping its position among its siblings. */
326
+ declare function replaceNode(part: OoxmlPart, nodeId: string, replacement: OoxmlNode, options?: EditOptions): OoxmlEditResult;
327
+ /** Remove a node and its subtree. */
328
+ declare function removeNode(part: OoxmlPart, nodeId: string, options?: EditOptions): OoxmlEditResult;
329
+ /**
330
+ * Apply several primitives as ONE atomic step.
331
+ *
332
+ * Each edit runs against the result of the previous one, and the whole sequence is
333
+ * validated once at the end. If any step fails, the ORIGINAL part is what the caller keeps
334
+ * — there is no partially-edited intermediate to publish. This is the shape a multi-`DocOp`
335
+ * store transaction needs.
336
+ */
337
+ declare function applyEdits(part: OoxmlPart, edits: readonly ((current: OoxmlPart) => OoxmlEditResult)[], options?: EditOptions): OoxmlEditResult;
338
+
339
+ /** Structural validation, run before any tree work so a rejection changes nothing. */
340
+ declare function validateTreeOp(part: OoxmlPart, op: TreeDocOp): TreeOpRejection | null;
341
+
342
+ /**
343
+ * Apply one validated op to a part.
344
+ *
345
+ * Validation runs first and returns before any tree work, so a rejected op is a true no-op:
346
+ * the caller keeps the part it passed in, unchanged and still frozen.
347
+ *
348
+ * `options.deferValidation` passes through to the edit primitives: a transaction applying
349
+ * many ops re-validates the whole part once at its commit boundary rather than after every
350
+ * primitive, which is the difference between a paste that is linear and one that is
351
+ * quadratic in document size.
352
+ */
353
+ declare function applyTreeOp(part: OoxmlPart, op: TreeDocOp, options?: EditOptions): TreeOpResult;
354
+ /** Paragraph text as the ops address it, for tests and callers computing offsets. */
355
+ declare function paragraphTextOf(part: OoxmlPart, paragraphId: string): string | null;
14
356
 
15
357
  /**
16
358
  * Every kind of thing the registry gives a stable identity to.
@@ -777,29 +1119,6 @@ declare function nullRecord<T = unknown>(): Record<string, T>;
777
1119
  */
778
1120
  declare function toSafeRecord(value: unknown, path?: string): unknown;
779
1121
 
780
- /**
781
- * Serialize normalized XML from a canonical part using repository-controlled
782
- * prefixes and validated, escaped names and values. This does not yet replace
783
- * writeDocx; package integration belongs to the subsequent migration pass.
784
- */
785
- declare function serializeOoxmlPart(part: OoxmlPart): string;
786
- /** Repository-owned namespace-aware semantic XML oracle. */
787
- declare function canonicalOoxmlFingerprint(value: OoxmlPart | OoxmlNode): string;
788
- /**
789
- * Structural equality of two canonical trees, ignoring node ids.
790
- *
791
- * Ids differ between two parses of the same bytes, so comparing them would report every reopen as
792
- * a change. This compares what the document SAYS.
793
- */
794
- declare function ooxmlTreesEqual(left: OoxmlPart | OoxmlNode, right: OoxmlPart | OoxmlNode): boolean;
795
-
796
- /**
797
- * Validate a parser-created or copy-modified immutable part before publication.
798
- * Future tree-edit primitives can retain shared nodes and their IDs, while any
799
- * replacement chooses explicitly whether to retain or allocate identity.
800
- */
801
- declare function validateOoxmlPart(part: OoxmlPart): OoxmlInvariantResult;
802
-
803
1122
  /** Locate `[Content_Types].xml` bytes regardless of zip key spelling. */
804
1123
  declare function contentTypesPartBytes(pkg: OoxmlPackage): {
805
1124
  readonly storageKey: string;
@@ -952,250 +1271,42 @@ declare const INERT_EXECUTABLE_KINDS: readonly ["field-dde", "field-include", "m
952
1271
  /** One of {@link INERT_EXECUTABLE_KINDS}. */
953
1272
  /** One of {@link INERT_EXECUTABLE_KINDS} — content carried but never executed. */
954
1273
  type InertExecutableKind = (typeof INERT_EXECUTABLE_KINDS)[number];
955
- /** Whether a content kind is one this engine refuses to execute or auto-resolve. */
956
- declare function isInertExecutable(kind: string): boolean;
957
- /** Whether a field instruction's leading keyword is safe to evaluate. */
958
- declare function isEvaluableField(instruction: string): boolean;
959
- /** One item a scrub pass considers: its kind, and where in the package it sits. */
960
- interface ContentItem {
961
- readonly id: string;
962
- readonly kind: string;
963
- }
964
- /**
965
- * What an explicit scrub removed.
966
- *
967
- * A scrub DECLARES ITSELF non-lossless: removing executable content changes the file, which is a
968
- * choice a caller makes deliberately rather than a default the engine applies.
969
- */
970
- interface ScrubResult {
971
- readonly kept: readonly ContentItem[];
972
- readonly removed: readonly ContentItem[];
973
- /** A scrub that removes anything is non-lossless by definition. */
974
- readonly nonLossless: boolean;
975
- }
976
- /** Explicit scrub export: remove inert executable classes, report removals. */
977
- declare function scrubExport(items: readonly ContentItem[]): ScrubResult;
978
-
979
- /** An edited part, or the invariant violations that rejected the edit. */
980
- type OoxmlEditResult = {
981
- readonly ok: true;
982
- readonly part: OoxmlPart;
983
- } | {
984
- readonly ok: false;
985
- readonly issues: readonly OoxmlInvariantIssue[];
986
- };
987
- /**
988
- * How an edit primitive validates its result.
989
- *
990
- * By default every primitive runs the full-part invariant validation before handing its
991
- * result back — the safe reading for an isolated call. A TRANSACTION applying many ops pays
992
- * that full-tree walk once per primitive, which is what made a hundred-paragraph paste
993
- * quadratic; it defers instead, and runs the same validation ONCE on the final tree before
994
- * anything is published. Deferring is only sound for a caller that owns a commit boundary:
995
- * nothing may escape between the unvalidated intermediate and the validated result.
996
- */
997
- interface EditOptions {
998
- readonly deferValidation?: boolean;
999
- /**
1000
- * A shared minter for `@w:id` on a NEW revision, for the ops of one transaction.
1001
- *
1002
- * `nextRevisionId` walks the whole part to find the highest id in use, and a formatting
1003
- * write emits one op per run — so a Select All + Bold in suggesting mode paid a
1004
- * document-wide walk thousands of times over. The transaction hands its ops one minter
1005
- * instead, and it is DROPPED the moment an op that can import foreign revision ids runs
1006
- * (a paste carries its own), because a stale minter would hand out an id the document had
1007
- * just started using — and two revisions sharing an address are one card in the pane.
1008
- *
1009
- * Absent means "mint your own": every applier falls back to its own walk, which is what a
1010
- * caller outside a transaction gets.
1011
- */
1012
- readonly revisionIds?: () => string;
1013
- /**
1014
- * The transaction's revision-id bookkeeping for the tracked TEXT ops, where `revisionIds`
1015
- * above hands the property ops one shared id for their whole group.
1016
- *
1017
- * Absent means "mint your own and remember nothing", which is what a caller outside a
1018
- * transaction gets: every applier falls back to its own walk of the part.
1019
- */
1020
- readonly trackedRevisionIds?: TransactionRevisionIds;
1021
- }
1022
- /**
1023
- * What one transaction knows about the revision ids its tracked text ops write.
1024
- *
1025
- * TWO questions, and they are the same bookkeeping. `nextRevisionId` walks the whole part, so
1026
- * a replacement — a `deleteText` and an `insertText` in one transaction — walked it twice, and
1027
- * on a five-hundred-page document that doubled the cost of every one. And an insertion aimed
1028
- * at the front edge of a deletion relocates past it only when that deletion is THIS
1029
- * transaction's own: typing over a selection. Backspace, then a keystroke, is two
1030
- * transactions, and there the typed text belongs in FRONT of the struck character, as Word
1031
- * writes it. Adjacency alone cannot tell the two apart; the ids can.
1032
- */
1033
- interface TransactionRevisionIds {
1034
- /** A fresh `@w:id`, from this transaction's one walk of the part. */
1035
- mint(): string;
1036
- /**
1037
- * Record a wrapper this transaction wrote, by its FULL `CT_TrackChange` identity — id,
1038
- * author and date, as `revisionKey` spells it. Not by the id alone: that number comes out
1039
- * of the file, nothing makes it unique, and a strike joining `w:id="3"` in one paragraph
1040
- * would otherwise claim an unrelated `w:id="3"` elsewhere as this edit's own.
1041
- */
1042
- wrote(key: string): void;
1043
- /** Whether this transaction wrote a wrapper with that identity. */
1044
- wroteUnder(key: string): boolean;
1045
- }
1046
- /** Every node id currently present in the part. */
1047
- declare function collectNodeIds(part: OoxmlPart): Set<string>;
1048
- /**
1049
- * Mint ids for nodes an edit introduces.
1050
- *
1051
- * Deterministic and collision-checked against the whole part: a structural-path id from the
1052
- * original parse (`/word/document.xml#0.1.2`) and a minted one (`/word/document.xml#new:3`)
1053
- * can never coincide, and the counter skips anything already taken so repeated edits in one
1054
- * session stay unique.
1055
- *
1056
- * The collision check only sees nodes that are IN the tree. A caller that clones a subtree
1057
- * and attaches it LATER — after other ops have replaced the root and reset the counter —
1058
- * must mint in its own `family`: two `new`-family allocators over different roots can hand
1059
- * out the same id, one to a detached clone and one to the tree, and the clone's insertion
1060
- * then fails the duplicate-id invariant.
1061
- *
1062
- * Checks the part's node index directly rather than copying every id into a fresh set: the
1063
- * copy was O(document) per op, and an allocator is created for every op.
1064
- */
1065
- declare function createNodeIdAllocator(part: OoxmlPart, family?: 'new' | 'paste'): () => string;
1066
- /** Whether a node id exists in the part. */
1067
- declare function hasNode(part: OoxmlPart, nodeId: string): boolean;
1068
- /** Read a node back out of a part by id. */
1069
- declare function findNode(part: OoxmlPart, nodeId: string): OoxmlNode | null;
1070
- /** The element that holds a node, or null for the root and for unknown ids. */
1071
- declare function parentNodeOf(part: OoxmlPart, nodeId: string): OoxmlElement | null;
1072
- /** Replace one node's children wholesale. */
1073
- declare function replaceChildren(part: OoxmlPart, nodeId: string, children: readonly OoxmlNode[], options?: EditOptions): OoxmlEditResult;
1074
- /** Insert children into a node at `index` (clamped to the child list). */
1075
- declare function insertChildren(part: OoxmlPart, nodeId: string, index: number, children: readonly OoxmlNode[], options?: EditOptions): OoxmlEditResult;
1076
- /** Replace one node with another, keeping its position among its siblings. */
1077
- declare function replaceNode(part: OoxmlPart, nodeId: string, replacement: OoxmlNode, options?: EditOptions): OoxmlEditResult;
1078
- /** Remove a node and its subtree. */
1079
- declare function removeNode(part: OoxmlPart, nodeId: string, options?: EditOptions): OoxmlEditResult;
1080
- /**
1081
- * Apply several primitives as ONE atomic step.
1082
- *
1083
- * Each edit runs against the result of the previous one, and the whole sequence is
1084
- * validated once at the end. If any step fails, the ORIGINAL part is what the caller keeps
1085
- * — there is no partially-edited intermediate to publish. This is the shape a multi-`DocOp`
1086
- * store transaction needs.
1087
- */
1088
- declare function applyEdits(part: OoxmlPart, edits: readonly ((current: OoxmlPart) => OoxmlEditResult)[], options?: EditOptions): OoxmlEditResult;
1089
-
1090
- /** UTF-16 placeholder for a page break in paragraph text projections. */
1091
- declare const PAGE_BREAK_CHAR = "\f";
1092
- /** What a `w:br` breaks. `other` covers values this engine does not model, kept losslessly. */
1093
- type HardBreakKind = 'line' | 'page' | 'column' | 'other';
1094
- /** Read the semantic break kind from a typed `w:br` node. */
1095
- declare function hardBreakKind(node: OoxmlHardBreakNode): HardBreakKind;
1096
- /** Whether a node is a `w:br` with `w:type="page"`. */
1097
- declare function isPageBreakNode(node: OoxmlNode): node is OoxmlHardBreakNode;
1098
- /** Text projection for a `w:br` node — one UTF-16 code unit per break. */
1099
- declare function hardBreakText(node: OoxmlHardBreakNode): string;
1100
- /** Attributes for a newly authored `w:br`. */
1101
- declare function hardBreakAttributes(kind: 'line' | 'page'): OoxmlHardBreakNode['attributes'];
1102
-
1103
- /** UTF-16 placeholder for one atomic field unit in `paragraphTextOf` / segments. */
1104
- declare const FIELD_ATOM_CHAR = "\uFFFC";
1105
- /**
1106
- * Which part of a complex field a `w:fldChar` marks.
1107
- *
1108
- * A complex field spans many runs: `begin`, the instruction, `separate`, the cached result, then
1109
- * `end` — which is why a field is one logical unit across several nodes.
1110
- */
1111
- type FldCharType = 'begin' | 'separate' | 'end';
1112
- /** Read `@w:fldCharType` when present and schema-legal. */
1113
- declare function fldCharType(node: OoxmlNode): FldCharType | null;
1114
- /** Whether a node is a `w:fldChar` field boundary marker. */
1115
- declare function isFldCharNode(node: OoxmlNode): node is OoxmlFldCharNode;
1116
- /**
1117
- * Whether a node is `w:instrText` — a field's instruction.
1118
- *
1119
- * Instructions are never EXECUTED or auto-resolved: `DDE` and `INCLUDE*` render inert.
1120
- */
1121
- declare function isInstrTextNode(node: OoxmlNode): node is OoxmlInstrTextNode;
1122
- /** Whether a node is `w:fldSimple` — a field whose instruction and result are one element. */
1123
- declare function isFldSimpleNode(node: OoxmlNode): node is OoxmlFldSimpleNode;
1124
- /** Typed or generic `w:fldChar` with the given type. */
1125
- declare function isFldChar(node: OoxmlNode, type: FldCharType): boolean;
1126
- /**
1127
- * Typed or generic `w:instrText`, and `w:delInstrText` — the form a tracked deletion gives
1128
- * the instruction (§17.16.13), always generic in the canonical tree.
1129
- *
1130
- * One predicate for both on purpose: everything that consumes instruction text (the offset
1131
- * authority, the layout field machine, span collection) must treat a deleted field's
1132
- * instruction exactly like a live one — ingested per phase, never painted. Excluding the
1133
- * deleted form let its `w:delInstrText` fall through those walks as ordinary run content.
1134
- */
1135
- declare function isInstrText(node: OoxmlNode): boolean;
1136
- /** Typed or generic `w:fldSimple`. */
1137
- declare function isFldSimple(node: OoxmlNode): boolean;
1138
- /** Concatenated text descendants of `w:instrText` (instruction only — never executed). */
1139
- declare function instrTextValue(node: OoxmlNode): string;
1140
- /** `@w:instr` on `w:fldSimple`, or undefined when absent. */
1141
- declare function fldSimpleInstr(node: OoxmlNode): string | undefined;
1142
- /**
1143
- * Read an on/off WML attribute (`dirty` / `fldLock`).
1144
- *
1145
- * Returns `undefined` when absent, otherwise the OOXML on/off interpretation
1146
- * (present without val, or val not explicitly off → true).
1147
- */
1148
- declare function fieldOnOffAttribute(node: OoxmlNode, localName: 'dirty' | 'fldLock'): boolean | undefined;
1149
- /** Model text contributed by one atomic field unit. */
1150
- declare function fieldAtomText(): typeof FIELD_ATOM_CHAR;
1151
- /**
1152
- * True when a node is field chrome that never contributes its own model text outside
1153
- * an atomic span (markers + instruction). Cached result `w:t` is separate.
1154
- */
1155
- declare function isFieldChrome(node: OoxmlNode): boolean;
1156
- /**
1157
- * True when a `w:fldChar` carries `w:ffData` — a LEGACY FORM FIELD (§17.16.17).
1158
- *
1159
- * FORMTEXT, FORMCHECKBOX and FORMDROPDOWN are what a fillable Word form is made of, and Word
1160
- * shades them on sight so a reader can find the blanks. That is a presentation question,
1161
- * answered by the element's presence alone — this predicate never looks inside.
1162
- *
1163
- * Rendering STATE (a checkbox's checked bit, a dropdown's entries and selection) is different:
1164
- * {@link legacyFormFieldDataOf} reads exactly that, bounded, and nothing else. The contract
1165
- * stands: `w:ffData` macro references (`w:entryMacro` / `w:exitMacro`), `w:name`, help/status
1166
- * text and behavior flags are attacker-supplied script references and are NEVER read, returned
1167
- * or resolved by anything in this module.
1168
- */
1169
- declare function hasLegacyFormFieldData(node: OoxmlNode): boolean;
1274
+ /** Whether a content kind is one this engine refuses to execute or auto-resolve. */
1275
+ declare function isInertExecutable(kind: string): boolean;
1276
+ /** Whether a field instruction's leading keyword is safe to evaluate. */
1277
+ declare function isEvaluableField(instruction: string): boolean;
1278
+ /** One item a scrub pass considers: its kind, and where in the package it sits. */
1279
+ interface ContentItem {
1280
+ readonly id: string;
1281
+ readonly kind: string;
1282
+ }
1170
1283
  /**
1171
- * One atomic field span inside a paragraph for caret / delete / selection.
1172
- *
1173
- * `removeNodeIds` lists every node that must leave with the unit (begin…end chrome and
1174
- * cached-result content for complex fields; the `fldSimple` element for simple fields).
1284
+ * What an explicit scrub removed.
1175
1285
  *
1176
- * `formatRunIds` lists the runs whose `w:rPr` owns displayed result formatting — result-phase
1177
- * runs with measurable cache text for complex fields, child `w:r`s for `fldSimple`, or the
1178
- * separate/begin run when the result is empty. Delete / caret addressing still uses `runId`
1179
- * (the begin / simple node); formatting must not rewrite chrome-only begin runs when the
1180
- * painted glyphs come from a different result run.
1286
+ * A scrub DECLARES ITSELF non-lossless: removing executable content changes the file, which is a
1287
+ * choice a caller makes deliberately rather than a default the engine applies.
1181
1288
  */
1182
- interface AtomicFieldSpan {
1183
- readonly kind: 'complex' | 'simple';
1184
- /** Addressable segment node (begin `fldChar` or `fldSimple`). */
1185
- readonly node: OoxmlNode;
1186
- /** Run that owns the begin marker; empty string for paragraph-level `fldSimple`. */
1187
- readonly runId: string;
1188
- readonly removeNodeIds: readonly string[];
1189
- /** Runs that own displayed result formatting (may differ from `runId`). */
1190
- readonly formatRunIds: readonly string[];
1289
+ interface ScrubResult {
1290
+ readonly kept: readonly ContentItem[];
1291
+ readonly removed: readonly ContentItem[];
1292
+ /** A scrub that removes anything is non-lossless by definition. */
1293
+ readonly nonLossless: boolean;
1191
1294
  }
1192
- /** Collect only fields whose cached result is one atomic model unit. */
1193
- declare function atomicFieldSpansOf(paragraph: OoxmlParagraphNode, options?: {
1194
- readonly maxNesting?: number;
1195
- readonly maxInstructionChars?: number;
1196
- }): readonly AtomicFieldSpan[];
1197
- /** Whether `fldCharType` is a legal ST_FldCharType value (used by tests / guards). */
1198
- declare function isLegalFldCharType(value: string): boolean;
1295
+ /** Explicit scrub export: remove inert executable classes, report removals. */
1296
+ declare function scrubExport(items: readonly ContentItem[]): ScrubResult;
1297
+
1298
+ /** UTF-16 placeholder for a page break in paragraph text projections. */
1299
+ declare const PAGE_BREAK_CHAR = "\f";
1300
+ /** What a `w:br` breaks. `other` covers values this engine does not model, kept losslessly. */
1301
+ type HardBreakKind = 'line' | 'page' | 'column' | 'other';
1302
+ /** Read the semantic break kind from a typed `w:br` node. */
1303
+ declare function hardBreakKind(node: OoxmlHardBreakNode): HardBreakKind;
1304
+ /** Whether a node is a `w:br` with `w:type="page"`. */
1305
+ declare function isPageBreakNode(node: OoxmlNode): node is OoxmlHardBreakNode;
1306
+ /** Text projection for a `w:br` node — one UTF-16 code unit per break. */
1307
+ declare function hardBreakText(node: OoxmlHardBreakNode): string;
1308
+ /** Attributes for a newly authored `w:br`. */
1309
+ declare function hardBreakAttributes(kind: 'line' | 'page'): OoxmlHardBreakNode['attributes'];
1199
1310
 
1200
1311
  /** Parsed TOC instruction. Unknown switches are ignored for generation but left on the wire. */
1201
1312
  interface TocInstruction {
@@ -1540,162 +1651,33 @@ declare function mintedParagraphIdentityAttributes(prefix: string, value: string
1540
1651
  */
1541
1652
  declare function normalizeParagraphIdentity(part: OoxmlPart): OoxmlPart;
1542
1653
 
1543
- /** One addressable unit of paragraph text: text, tab, hard break, or atomic field. */
1544
- interface Segment {
1545
- readonly runId: string;
1546
- readonly node: OoxmlNode;
1547
- readonly start: number;
1548
- readonly end: number;
1549
- /**
1550
- * When set, deleting this segment removes every listed node id in one step (atomic
1551
- * field begin→end or `fldSimple`). Absent for ordinary text/tab/break segments.
1552
- */
1553
- readonly removeNodeIds?: readonly string[];
1554
- /**
1555
- * When set, run formatting for this atom targets these runs (field result ownership),
1556
- * not necessarily `runId`. Absent for ordinary text/tab/break segments.
1557
- */
1558
- readonly formatRunIds?: readonly string[];
1559
- }
1560
- /**
1561
- * Flatten a paragraph into UTF-16 addressable segments, in document order.
1562
- *
1563
- * A HYPERLINK's runs are addressed too. `w:hyperlink` is a run container, not a leaf, and
1564
- * the characters inside a link are ordinary paragraph text: the user selects them, types
1565
- * over them and deletes them like any other. Skipping the container — which is what
1566
- * iterating only direct `w:r` children did — left every link's text with no offsets at all,
1567
- * so `paragraphTextOf` read "Visit or ." for a sentence that says "Visit Example.com or
1568
- * Anthropic's website." and layout, selection and the ops all agreed on the wrong string.
1569
- *
1570
- * Inline CONTENT CONTROLS are the same class of wrapper: their `w:sdtContent` runs join the
1571
- * paragraph's offset stream with no break opportunity at the boundary. Nesting is bounded
1572
- * (`MAX_INLINE_CONTAINER_DEPTH`); beyond the bound the wrapper is opaque so recursion
1573
- * cannot exhaust the stack.
1574
- *
1575
- * `runId` stays the id of the run the content actually lives in, at whatever depth: the
1576
- * appliers resolve it with `findNode` and rebuild that run's children, so nesting costs them
1577
- * nothing.
1578
- */
1579
- declare function segmentsOf(paragraph: OoxmlParagraphNode): Segment[];
1580
- /** Half-open `[start, end)` of one node in its paragraph's model offset space. */
1581
- interface OffsetSpan {
1582
- readonly start: number;
1583
- readonly end: number;
1584
- }
1585
- /**
1586
- * Every node's place in the paragraph's model offset space, from the SAME walk `segmentsOf`
1587
- * uses.
1588
- *
1589
- * The offset model has exactly one authority, and this is how a caller borrows it. Three
1590
- * private walkers used to re-derive it — one in the tracked-change writer, one in the comment
1591
- * anchor reader, one in the review queue — and all three disagreed with `segmentsOf` and with
1592
- * each other: none gave a note reference or an atomic field its length of one, one counted a
1593
- * field's instruction text as visible characters, and one never descended into `w:hyperlink`
1594
- * at all. The consequences were an anchor short by a link's length, two unrelated comments
1595
- * threaded onto one zero-width offset, and a tracked insert landing a character out in any
1596
- * paragraph carrying a footnote. Patching each walker only resets the clock on the next drift.
1597
- *
1598
- * A node the walk never reaches — content under a `generic` container, or past the nesting cap
1599
- * — has NO span, and {@link ParagraphOffsetIndex.lengthOf} reports zero for it. That is the
1600
- * same answer `segmentsOf` gives: it contributes no addressable characters.
1601
- */
1602
- interface ParagraphOffsetIndex {
1603
- /** The paragraph's own length, identical to {@link paragraphLength}. */
1604
- readonly length: number;
1605
- readonly segments: readonly Segment[];
1606
- /** Where a node sits, or null when the offset walk never reached it. */
1607
- spanOf(node: OoxmlNode | string): OffsetSpan | null;
1608
- /** A node's model length: `end - start` of its span, and 0 when it has none. */
1609
- lengthOf(node: OoxmlNode | string): number;
1654
+ /** One `w:docPart` of the glossary, with the blocks its body holds. */
1655
+ interface BuildingBlock {
1656
+ /** `w:docPartPr/w:name`, the identity a control's placeholder and a pick refer to. */
1657
+ readonly name: string;
1658
+ /** `w:category/w:gallery`, an `ST_DocPartGallery` value such as `docParts`. */
1659
+ readonly gallery: string;
1660
+ /** `w:category/w:name`; `General` when the block declares none. */
1661
+ readonly category: string;
1662
+ /** The `w:docPartBody` children: paragraphs, tables and block controls, in order. */
1663
+ readonly blocks: readonly OoxmlNode[];
1610
1664
  }
1611
- /**
1612
- * THE paragraph offset authority: maps a paragraph's UTF-16 offsets to the nodes holding them.
1613
- *
1614
- * One authority on purpose. An atomic field spans many nodes but is ONE unit to an offset, and a
1615
- * second implementation that disagreed would place edits inside content that cannot be split.
1616
- */
1617
- declare function paragraphOffsetIndex(paragraph: OoxmlParagraphNode): ParagraphOffsetIndex;
1618
- /** One inline content control's identity and the UTF-16 span its content covers. */
1619
- interface InlineControlSpan {
1620
- readonly controlId: string;
1621
- readonly start: number;
1622
- readonly end: number;
1665
+ /** The gallery and category a `w:docPartList` control lists. */
1666
+ interface BuildingBlockGalleryFilter {
1667
+ readonly gallery: string;
1668
+ readonly category: string | null;
1623
1669
  }
1670
+ /** The glossary part, through the main part's relationship or the conventional name. */
1671
+ declare function glossaryPartOf(pkg: OoxmlPackage): OoxmlPart | null;
1672
+ /** Every named building block of the glossary, in authored order. Empty without a glossary. */
1673
+ declare function buildingBlocksOf(pkg: OoxmlPackage): readonly BuildingBlock[];
1674
+ /** The gallery a `w:docPartList` control lists, or null for any other control. */
1675
+ declare function buildingBlockGalleryOf(control: OoxmlNode): BuildingBlockGalleryFilter | null;
1624
1676
  /**
1625
- * The innermost inline content control whose content ends exactly at `offset` — the caret
1626
- * at its right outer edge. What Backspace consults to delete the node as ONE unit
1627
- * (pro-review-and-custom-nodes 4.6): deleting its last character from outside would either
1628
- * strip one letter from a content-locked label (refused, so the key looks dead) or leave a
1629
- * half-deleted chip whose tag still claims the full payload.
1630
- */
1631
- declare function inlineControlEndingAt(paragraph: OoxmlParagraphNode, offset: number): InlineControlSpan | null;
1632
- /** The forward-delete mirror: the control whose content STARTS exactly at `offset`. */
1633
- declare function inlineControlStartingAt(paragraph: OoxmlParagraphNode, offset: number): InlineControlSpan | null;
1634
-
1635
- /** Structural validation, run before any tree work so a rejection changes nothing. */
1636
- declare function validateTreeOp(part: OoxmlPart, op: TreeDocOp): TreeOpRejection | null;
1637
-
1638
- /**
1639
- * Apply one validated op to a part.
1640
- *
1641
- * Validation runs first and returns before any tree work, so a rejected op is a true no-op:
1642
- * the caller keeps the part it passed in, unchanged and still frozen.
1643
- *
1644
- * `options.deferValidation` passes through to the edit primitives: a transaction applying
1645
- * many ops re-validates the whole part once at its commit boundary rather than after every
1646
- * primitive, which is the difference between a paste that is linear and one that is
1647
- * quadratic in document size.
1648
- */
1649
- declare function applyTreeOp(part: OoxmlPart, op: TreeDocOp, options?: EditOptions): TreeOpResult;
1650
- /** Paragraph text as the ops address it, for tests and callers computing offsets. */
1651
- declare function paragraphTextOf(part: OoxmlPart, paragraphId: string): string | null;
1652
-
1653
- /**
1654
- * Read forms protection from the settings root.
1655
- *
1656
- * Delegates to the ONE parse of `w:documentProtection` rather than reading the element again:
1657
- * a second reading of `@w:enforcement` is how a document ends up protected to the Review menu
1658
- * and unprotected to the store.
1659
- */
1660
- declare function formsProtectionEnabled(root: OoxmlNode | null | undefined): boolean;
1661
- /**
1662
- * Whether the section owning a node still has form protection on.
1663
- *
1664
- * `w:formProt` is per-section, so a protected document may carry an unprotected section. The
1665
- * owning section is the first `w:sectPr` at or after the node in body order, which is how a
1666
- * section's extent is expressed in the body at all.
1677
+ * The blocks a gallery control offers: same gallery, and the control's category when it names
1678
+ * one. Sorted by category, then name, as Word groups its list.
1667
1679
  */
1668
- declare function sectionProtectsForms(part: OoxmlPart, nodeId: string): boolean;
1669
-
1670
- interface RevisionSite {
1671
- readonly node: OoxmlElement;
1672
- readonly parent: OoxmlElement | null;
1673
- /** True when this site cannot be resolved and the whole op must refuse. */
1674
- readonly refused: boolean;
1675
- /** True for `w:pPr/w:rPr/w:ins|w:del` — the paragraph MARK, not content. */
1676
- readonly paragraphMark: boolean;
1677
- /** True for `w:rPrChange` / `w:pPrChange`. */
1678
- readonly propertyChange: boolean;
1679
- /**
1680
- * How many content-revision wrappers ENCLOSE this one, counted within its own paragraph.
1681
- *
1682
- * Revisions nest for real: `w:ins` wrapping `w:del` is content one reviewer added and another
1683
- * struck, and both stay pending because each author has to be answered separately. The two
1684
- * wrappers then cover exactly the same characters, so a range cannot tell them apart and
1685
- * "which change is this text under" has only one honest answer — the innermost one, which is
1686
- * the change that decides what the reader is looking at.
1687
- *
1688
- * Relative to the paragraph or table subtree, which is the unit the site walk memoizes. That
1689
- * is enough and it is what keeps the memo valid: a content revision cannot enclose a
1690
- * paragraph, and two sites can only cover one position if they are in the same paragraph.
1691
- */
1692
- readonly nesting: number;
1693
- }
1694
- /** Every revision-bearing element in the part. */
1695
- declare function collectRevisionSites(part: OoxmlPart): RevisionSite[];
1696
-
1697
- /** Every {@link TreeDocOpKind}, for validation and exhaustiveness checks. */
1698
- declare const TREE_DOC_OP_KINDS: readonly ["replaceStoryBlocks", "insertText", "deleteText", "setParagraphMarkRevision", "proposeParagraphMerge", "insertCommentMarker", "acceptRevision", "rejectRevision", "acceptAllRevisions", "rejectAllRevisions", "insertTab", "insertHardBreak", "insertPageBreak", "insertPageField", "setFieldCode", "setListLevel", "setListNumbering", "setParagraphTabStops", "setParagraphMarkProperties", "splitParagraph", "splitParagraphMany", "joinParagraphs", "setRunProperties", "setParagraphProperties", "setSectionProperties", "setSectionMark", "insertHyperlink", "setHyperlinkTarget", "removeHyperlink", "setMathEquation", "removeMathEquation", "setContentControlValue", "removeContentControl", "insertInlineContentControl", "addRepeatingSectionItem", "removeRepeatingSectionItem", "deleteBlock", "insertTable", "insertTableRow", "deleteTableRow", "insertTableColumn", "deleteTableColumn", "setTableColumnWidths", "setTableRightEdgeWidth", "setTableRowHeight", "setTableProperties", "authorTable", "setTableCellBorders", "setTableCellFill", "setTableCellVerticalAlignment", "createHeaderFooter", "deleteHeaderFooter", "linkToPrevious", "unlinkFromPrevious", "setSectionFurnitureOptions", "setDocumentProtection", "insertNote", "deleteNote", "convertNote", "convertAllNotes", "setNoteProperties", "setContentControlProperties", "insertContentControl", "insertFragment", "insertDrawing", "replaceDrawingResource", "deleteDrawing", "resizeDrawing", "cropDrawing", "positionDrawing", "setDrawingWrap", "setDrawingMetadata", "setDrawingLocks", "transformDrawing", "insertToc", "replaceTocResult", "rewriteTocPageNumbers", "refreshFieldResults", "setTextFormFieldDefault", "commitTextFormField"];
1680
+ declare function buildingBlocksForControl(pkg: OoxmlPackage, control: OoxmlNode): readonly BuildingBlock[];
1699
1681
 
1700
1682
  /**
1701
1683
  * Which story a comment deletion or resolution may read markers from.
@@ -2420,6 +2402,33 @@ declare function formattableRanges(part: OoxmlPart, paragraphId: string, start:
2420
2402
  */
2421
2403
  declare function runsCovering(part: OoxmlPart, paragraphId: string, start: number, end: number, displayMode?: FormattingDisplayMode, authorFilter?: FormattingRevisionAuthorFilter): readonly OoxmlNode[];
2422
2404
 
2405
+ interface RevisionSite {
2406
+ readonly node: OoxmlElement;
2407
+ readonly parent: OoxmlElement | null;
2408
+ /** True when this site cannot be resolved and the whole op must refuse. */
2409
+ readonly refused: boolean;
2410
+ /** True for `w:pPr/w:rPr/w:ins|w:del` — the paragraph MARK, not content. */
2411
+ readonly paragraphMark: boolean;
2412
+ /** True for a supported property-history wrapper. */
2413
+ readonly propertyChange: boolean;
2414
+ /**
2415
+ * How many content-revision wrappers ENCLOSE this one, counted within its own paragraph.
2416
+ *
2417
+ * Revisions nest for real: `w:ins` wrapping `w:del` is content one reviewer added and another
2418
+ * struck, and both stay pending because each author has to be answered separately. The two
2419
+ * wrappers then cover exactly the same characters, so a range cannot tell them apart and
2420
+ * "which change is this text under" has only one honest answer — the innermost one, which is
2421
+ * the change that decides what the reader is looking at.
2422
+ *
2423
+ * Relative to the paragraph or table subtree, which is the unit the site walk memoizes. That
2424
+ * is enough and it is what keeps the memo valid: a content revision cannot enclose a
2425
+ * paragraph, and two sites can only cover one position if they are in the same paragraph.
2426
+ */
2427
+ readonly nesting: number;
2428
+ }
2429
+ /** Every revision-bearing element in the part. */
2430
+ declare function collectRevisionSites(part: OoxmlPart): RevisionSite[];
2431
+
2423
2432
  /** The `w:p` a node sits inside, and the model offset it starts at within that paragraph. */
2424
2433
  interface SiteLocation {
2425
2434
  readonly paragraphId: string;
@@ -2442,17 +2451,11 @@ declare function locateSites(part: OoxmlPart): ReadonlyMap<string, SiteLocation>
2442
2451
  /**
2443
2452
  * Every revision in one story, one card per DECISION.
2444
2453
  *
2445
- * Sites sharing an `(id, author, date)` triple are ONE revision — a tracked row insertion is
2446
- * `w:trPr/w:ins` plus `w:cellIns` on every cell — so they coalesce into one card listing every
2447
- * range it touches. Keying per site would show the reviewer four decisions where there is one,
2448
- * and accepting any of them would make the other three vanish.
2454
+ * Sites sharing an `(id, author, date)` and revision kind coalesce into one decision
2455
+ * containing every canonical site and affected range.
2449
2456
  *
2450
- * Memoized per part root like the indexes it reads, and for the same reason: a heavily
2451
- * tracked document produces tens of thousands of cards, and rebuilding them per read cost
2452
- * more than everything the memos above saved. The paragraph-scoped view the local review
2453
- * patch derives (`revisionItemsOfParagraph`'s synthetic paragraph-root part) is NOT cached:
2454
- * each keystroke would insert a fresh root and churn the bounded ring. The instance is
2455
- * SHARED, so the return type is readonly.
2457
+ * Cached by part root except for paragraph-scoped synthetic roots. Results are shared
2458
+ * and readonly; part names are checked because ranges embed them.
2456
2459
  */
2457
2460
  declare function revisionItemsOf(part: OoxmlPart): readonly ReviewRevisionItem[];
2458
2461
  /**
@@ -2597,4 +2600,30 @@ declare function wrapTargetToAnchorSpec(target: ImageWrapTarget): {
2597
2600
  /** Whether an op is one of the drawing ops. Narrows the type. */
2598
2601
  declare function isDrawingTreeDocOp(op: TreeDocOp): op is DrawingTreeDocOp;
2599
2602
 
2600
- export { ALL_FROZEN_IDS, AUTHORABLE_PARAGRAPH_PROPERTIES, AUTHORABLE_RUN_PROPERTIES, type AddCommentRequest, type AddCommentResult, type AnchorSnapshot, type AtomicFieldSpan, type AuditPort, type AuthorizationPort, BoundedCounter, Budget, BudgetError, CANONICAL_MUTATION_ORIGINS, COMPARATORS, CUSTOM_NODE_XPATH_PREFIX, CUSTOM_XML_PROPS_REL, CUSTOM_XML_PROPS_TYPE, CUSTOM_XML_REL, CancellationController, CancellationError, type CancellationPhase, type CancellationPort, type CancellationToken, type CapabilityId, type ClockPort, type CommentAnchorRequest, type CommentDeletionOwner, CommentRecord, CommentThreadState, type ComparatorDescriptor, type ComparatorMode, type ComparatorName, type ComparisonResult, type ConformanceFixture, type ContentItem, type Contribution, type CustomNodeBinding, type CustomNodeExportPolicy, type CustomNodeExportRequest, type CustomNodeExportResult, CustomNodeWriteResult, type CustomXmlDataPart, type CustomXmlDataPartResult, type CustomXmlNode, DANGEROUS_KEYS, DATASTORE_NAMESPACE_URI, DEFAULT_FORMATTING_DISPLAY_MODE, DEFAULT_VIEW_SETTINGS, DEPENDENCY_KEY_IDS, DangerousKeyError, type DetectedToc, DeterministicClock, DeterministicMemoryMeter, type DigestDifference, type DocumentViewSettings, DrawingTreeDocOp, type EditOptions, type EncodedEnvelope, type EnforcementPhase, type ExternalResourceConsentPort, FIELD_ATOM_CHAR, type FeatureBundle, type FixtureExpectation, type FixtureOutcome, type FixtureSource, type FixtureStep, type FldCharType, type FontPort, type FormattingDisplayMode, type FormattingRevisionAuthorFilter, type FragmentCoverage, type FragmentExtractRejection, type FragmentExtractResult, type FragmentMergeRejection, type FragmentMergeResult, type HardBreakKind, type HrefProjection, ID_KINDS, INERT_EXECUTABLE_KINDS, type IdKind, type IdentityPort, type ImagePort, ImageWrapTarget, ImpactClass, type InertExecutableKind, type InlineControlSpan, InsertCustomNodeWrite, type Json, LIMIT_KEYS, LIMIT_SPECS, LimitExceededError, type LimitSpec, type LimitUnit, type LinkableReviewItem, MAX_STORY_SDT_NESTING, type ModelChangeSummary, NON_CANONICAL_ORIGINS, ORIGIN_IDS, type OffsetSpan, OoxmlAttribute, type OoxmlEditResult, OoxmlElement, OoxmlFldCharNode, OoxmlFldSimpleNode, OoxmlHardBreakNode, type OoxmlIndexes, OoxmlInstrTextNode, OoxmlInvariantIssue, OoxmlInvariantResult, OoxmlNode, OoxmlPackage, OoxmlParagraphNode, OoxmlPart, OoxmlProperty, type OoxmlStoryKind, type OoxmlStoryRoot, type OperationContext, type OperationInit, PAGE_BREAK_CHAR, type PackageCommentDelete, type PackageInvariantCode, type PackageInvariantIssue, type PackageInvariantResult, type ParagraphDigest, type ParagraphIndexEntry, type ParagraphOffsetIndex, type PersistencePort, type Points, PortRegistry, PortResolutionError, PrefixAllocator, RESULT_IDS, RUNTIME_PORT_IDS, RegistryError, type RegistryErrorCode, RelationshipRecord, type ReplacementPolicy, type ReplayOutcome, type ReplayReport, type ReplayStore, type Reservation, type ResolveOptions, type ResolvedRegistry, type ResourceAccountingPort, ResourceLimits, ReviewCommentItem, ReviewItem, ReviewModelInput, ReviewPosition, ReviewRange, ReviewRevisionItem, type RunPropertyEdit, SEARCH_MATCH_LIMIT, SEARCH_QUERY_MAX, type SchedulingPort, type ScrubResult, type Segment, type SemVer, type SemanticDigest, SequentialIdentity, type SetCommentResolvedResult, type ShapingPort, type StoryDigest, type StoryIndexEntry, StoryScope, type StyleIndexEntry, TOC_LEVEL_INDENT_TWIPS, TOC_MAX_BOOKMARKS_PER_REFRESH, TOC_MAX_ENTRIES, TOC_MAX_FIELD_NESTING, TOC_MAX_INSTRUCTION_CHARS, TOC_MAX_PAGE_PASSES, TREE_DOC_OP_KINDS, TWIPS_PER_POINT, type TextMatchOptions, type TextOccurrence, type TextOccurrences, type TextboxStoryRoot, type TocEntryPlan, type TocInstruction, type TocOutlineHeading, type TransactionRevisionIds, type TransportPort, TreeDocOp, TreeDocumentStore, TreeModelChange, TreeOpRejection, TreeOpResult, TreePackageStore, type Twips, type ValidationResult, addComment, addPackageComment, applyEdits, applyTreeOp, assertLimitInvariants, assertValidId, assertValidQName, atomicFieldSpansOf, authoredProperties, beginOperation, bodyStoryRoot, bookmarkPairNodes, boundCustomXmlNodeIdOf, boundCustomXmlNodeIds, boundCustomXmlNodeIdsInPackage, buildTocContentControl, buildTocEntryParagraph, canonicalOoxmlFingerprint, canonicalize, cascadeEmptiedComments, collectNodeIds, collectReviewItems, collectRevisionSites, collectStoryParagraphs, commentItemsOf, commentPartNameOf, commentsExtendedPartNameOf, compareArtifacts, compareSemVer, containsCssFetch, contentTypesPartBytes, createNodeIdAllocator, customNodeBinding, customXmlDataParts, customXmlLabelXPath, customXmlNodes, customXmlPrefixMappings, datastoreItemIdFor, deleteCommentThread, deletePackageComments, deriveOoxmlIndexes, detectBodyTocs, diffSemanticDigests, digestPart, directParagraphMarkProperties, directParagraphProperties, drawingOpImpact, endOperation, escapeCssString, escapeXml, extractFragmentPackage, fieldAtomText, fieldOnOffAttribute, findCustomXmlDataPart, findDetectedToc, findNode, findOccurrences, fingerprint, fldCharType, fldSimpleInstr, fnv1a32, foldCase, formatOwnedRunIds, formattableRanges, formsProtectionEnabled, hardBreakAttributes, hardBreakKind, hardBreakText, hasCommentPart, hasLegacyFormFieldData, hasNode, hashAuthored, indexStyles, inlineControlEndingAt, inlineControlStartingAt, insertChildren, insertPackageCustomNode, instrTextValue, isAuthorableRunProperty, isDangerousKey, isDrawingTreeDocOp, isEvaluableField, isFieldChrome, isFldChar, isFldCharNode, isFldSimple, isFldSimpleNode, isInertExecutable, isInstrText, isInstrTextNode, isLegalFldCharType, isPageBreakNode, isSearchableQuery, isStoryPart, isValidId, isValidNCName, isValidParaId, isValidQName, isWholeWord, linkRevisionReplies, locateSites, makeLimitCounter, mergeFragmentIntoPackage, mergedFontProperty, mergedMultiSettingProperty, mergedParagraphMarkProperties, mergedProperties, mintParaId, mintedParagraphIdentityAttributes, nextCommentId, normalizeParagraphIdentity, nullRecord, ooxmlTreesEqual, paraIdOf, paragraphOffsetIndex, paragraphTextOf, parentNodeOf, parseSemVer, parseTocInstruction, planTocEntries, points, pointsToTwips, propertyContainer, readCustomXmlNode, readViewSettings, relationshipsOf, relsPartNameFor, removeNode, removePackageCustomNode, replaceChildren, replaceNode, replayFixture, resolve, resolveContentTypeOf, resolveTocRowHeadings, revisionItemsOf, runAddressRanges, runPropertyEdits, runsCovering, sanitizeHref, satisfies, scrubExport, sectionProtectsForms, segmentsOf, semanticDigest, serializeOoxmlPart, setCommentResolved, setPackageCommentResolved, stableHash, storyParagraphs, storyRootsOf, stylesPartOf, textboxStoriesInPart, toSafeRecord, tocEntryText, tocLeftIndentTwips, twips, twipsToPoints, usedParaIds, validateDrawingOp, validateFixture, validateOoxmlPart, validatePackageInvariants, validateTreeOp, w14RootPrefix, withContentTypeOverride, withCustomXmlDataPart, withCustomXmlNode, withExportedCustomNodes, withNewPart, withRelationship, withoutCustomXmlDataPart, withoutCustomXmlNode, withoutOrphanCustomXmlNodes, wrapTargetToAnchorSpec };
2603
+ /**
2604
+ * Fill every empty prompt-bearing control in `part` with its placeholder and mark it as
2605
+ * showing one. Returns `part` itself when there is nothing to fill.
2606
+ */
2607
+ declare function materializeGlossaryPlaceholders(pkg: OoxmlPackage, part: OoxmlPart): OoxmlPart;
2608
+
2609
+ /**
2610
+ * Read forms protection from the settings root.
2611
+ *
2612
+ * Delegates to the ONE parse of `w:documentProtection` rather than reading the element again:
2613
+ * a second reading of `@w:enforcement` is how a document ends up protected to the Review menu
2614
+ * and unprotected to the store.
2615
+ */
2616
+ declare function formsProtectionEnabled(root: OoxmlNode | null | undefined): boolean;
2617
+ /**
2618
+ * Whether the section owning a node still has form protection on.
2619
+ *
2620
+ * `w:formProt` is per-section, so a protected document may carry an unprotected section. The
2621
+ * owning section is the first `w:sectPr` at or after the node in body order, which is how a
2622
+ * section's extent is expressed in the body at all.
2623
+ */
2624
+ declare function sectionProtectsForms(part: OoxmlPart, nodeId: string): boolean;
2625
+
2626
+ /** Every {@link TreeDocOpKind}, for validation and exhaustiveness checks. */
2627
+ declare const TREE_DOC_OP_KINDS: readonly ["replaceStoryBlocks", "insertText", "deleteText", "setParagraphMarkRevision", "proposeParagraphMerge", "insertCommentMarker", "acceptRevision", "rejectRevision", "acceptAllRevisions", "rejectAllRevisions", "insertTab", "insertHardBreak", "insertPageBreak", "insertPageField", "setFieldCode", "setListLevel", "setListNumbering", "setParagraphTabStops", "setParagraphMarkProperties", "splitParagraph", "splitParagraphMany", "joinParagraphs", "setRunProperties", "setParagraphProperties", "setSectionProperties", "setSectionMark", "insertHyperlink", "setHyperlinkTarget", "removeHyperlink", "setMathEquation", "removeMathEquation", "setContentControlValue", "removeContentControl", "insertInlineContentControl", "addRepeatingSectionItem", "removeRepeatingSectionItem", "deleteBlock", "insertTable", "insertTableRow", "deleteTableRow", "insertTableColumn", "deleteTableColumn", "setTableColumnWidths", "setTableRightEdgeWidth", "setTableRowHeight", "setTableProperties", "authorTable", "setTableCellBorders", "setTableCellFill", "setTableCellVerticalAlignment", "createHeaderFooter", "deleteHeaderFooter", "linkToPrevious", "unlinkFromPrevious", "setSectionFurnitureOptions", "setDocumentProtection", "insertNote", "deleteNote", "convertNote", "convertAllNotes", "setNoteProperties", "setContentControlProperties", "insertContentControl", "insertFragment", "insertDrawing", "replaceDrawingResource", "deleteDrawing", "resizeDrawing", "cropDrawing", "positionDrawing", "setDrawingWrap", "setDrawingMetadata", "setDrawingLocks", "transformDrawing", "insertToc", "replaceTocResult", "rewriteTocPageNumbers", "refreshFieldResults", "setTextFormFieldDefault", "commitTextFormField", "setLegacyCheckbox", "setLegacyDropdown", "insertBuildingBlock"];
2628
+
2629
+ export { ALL_FROZEN_IDS, AUTHORABLE_PARAGRAPH_PROPERTIES, AUTHORABLE_RUN_PROPERTIES, type AddCommentRequest, type AddCommentResult, type AnchorSnapshot, type AtomicFieldSpan, type AuditPort, type AuthorizationPort, BoundedCounter, Budget, BudgetError, type BuildingBlock, type BuildingBlockGalleryFilter, CANONICAL_MUTATION_ORIGINS, COMPARATORS, CUSTOM_NODE_XPATH_PREFIX, CUSTOM_XML_PROPS_REL, CUSTOM_XML_PROPS_TYPE, CUSTOM_XML_REL, CancellationController, CancellationError, type CancellationPhase, type CancellationPort, type CancellationToken, type CapabilityId, type ClockPort, type CommentAnchorRequest, type CommentDeletionOwner, CommentRecord, CommentThreadState, type ComparatorDescriptor, type ComparatorMode, type ComparatorName, type ComparisonResult, type ConformanceFixture, type ContentItem, type Contribution, type CustomNodeBinding, type CustomNodeExportPolicy, type CustomNodeExportRequest, type CustomNodeExportResult, CustomNodeWriteResult, type CustomXmlDataPart, type CustomXmlDataPartResult, type CustomXmlNode, DANGEROUS_KEYS, DATASTORE_NAMESPACE_URI, DEFAULT_FORMATTING_DISPLAY_MODE, DEFAULT_VIEW_SETTINGS, DEPENDENCY_KEY_IDS, DangerousKeyError, type DetectedToc, DeterministicClock, DeterministicMemoryMeter, type DigestDifference, type DocumentViewSettings, DrawingTreeDocOp, type EditOptions, type EncodedEnvelope, type EnforcementPhase, type ExternalResourceConsentPort, FIELD_ATOM_CHAR, type FeatureBundle, type FixtureExpectation, type FixtureOutcome, type FixtureSource, type FixtureStep, type FldCharType, type FontPort, type FormattingDisplayMode, type FormattingRevisionAuthorFilter, type FragmentCoverage, type FragmentExtractRejection, type FragmentExtractResult, type FragmentMergeRejection, type FragmentMergeResult, type HardBreakKind, type HrefProjection, ID_KINDS, INERT_EXECUTABLE_KINDS, type IdKind, type IdentityPort, type ImagePort, ImageWrapTarget, ImpactClass, type InertExecutableKind, type InlineControlSpan, InsertCustomNodeWrite, type Json, LIMIT_KEYS, LIMIT_SPECS, LimitExceededError, type LimitSpec, type LimitUnit, type LinkableReviewItem, MAX_STORY_SDT_NESTING, type ModelChangeSummary, NON_CANONICAL_ORIGINS, ORIGIN_IDS, type OffsetSpan, OoxmlAttribute, type OoxmlEditResult, OoxmlElement, OoxmlFldCharNode, OoxmlFldSimpleNode, OoxmlHardBreakNode, type OoxmlIndexes, OoxmlInstrTextNode, OoxmlInvariantIssue, OoxmlInvariantResult, OoxmlNode, OoxmlPackage, OoxmlParagraphNode, OoxmlPart, OoxmlProperty, type OoxmlStoryKind, type OoxmlStoryRoot, type OperationContext, type OperationInit, PAGE_BREAK_CHAR, type PackageCommentDelete, type PackageInvariantCode, type PackageInvariantIssue, type PackageInvariantResult, type ParagraphDigest, type ParagraphIndexEntry, type ParagraphOffsetIndex, type PersistencePort, type Points, PortRegistry, PortResolutionError, PrefixAllocator, RESULT_IDS, RUNTIME_PORT_IDS, RegistryError, type RegistryErrorCode, RelationshipRecord, type ReplacementPolicy, type ReplayOutcome, type ReplayReport, type ReplayStore, type Reservation, type ResolveOptions, type ResolvedRegistry, type ResourceAccountingPort, ResourceLimits, ReviewCommentItem, ReviewItem, ReviewModelInput, ReviewPosition, ReviewRange, ReviewRevisionItem, type RunPropertyEdit, SEARCH_MATCH_LIMIT, SEARCH_QUERY_MAX, type SchedulingPort, type ScrubResult, type Segment, type SemVer, type SemanticDigest, SequentialIdentity, type SetCommentResolvedResult, type ShapingPort, type StoryDigest, type StoryIndexEntry, StoryScope, type StyleIndexEntry, TOC_LEVEL_INDENT_TWIPS, TOC_MAX_BOOKMARKS_PER_REFRESH, TOC_MAX_ENTRIES, TOC_MAX_FIELD_NESTING, TOC_MAX_INSTRUCTION_CHARS, TOC_MAX_PAGE_PASSES, TREE_DOC_OP_KINDS, TWIPS_PER_POINT, type TextMatchOptions, type TextOccurrence, type TextOccurrences, type TextboxStoryRoot, type TocEntryPlan, type TocInstruction, type TocOutlineHeading, type TransactionRevisionIds, type TransportPort, TreeDocOp, TreeDocumentStore, TreeModelChange, TreeOpRejection, TreeOpResult, TreePackageStore, type Twips, type ValidationResult, addComment, addPackageComment, applyEdits, applyTreeOp, assertLimitInvariants, assertValidId, assertValidQName, atomicFieldSpansOf, authoredProperties, beginOperation, bodyStoryRoot, bookmarkPairNodes, boundCustomXmlNodeIdOf, boundCustomXmlNodeIds, boundCustomXmlNodeIdsInPackage, buildTocContentControl, buildTocEntryParagraph, buildingBlockGalleryOf, buildingBlocksForControl, buildingBlocksOf, canonicalOoxmlFingerprint, canonicalize, cascadeEmptiedComments, collectNodeIds, collectReviewItems, collectRevisionSites, collectStoryParagraphs, commentItemsOf, commentPartNameOf, commentsExtendedPartNameOf, compareArtifacts, compareSemVer, containsCssFetch, contentTypesPartBytes, createNodeIdAllocator, customNodeBinding, customXmlDataParts, customXmlLabelXPath, customXmlNodes, customXmlPrefixMappings, datastoreItemIdFor, deleteCommentThread, deletePackageComments, deriveOoxmlIndexes, detectBodyTocs, diffSemanticDigests, digestPart, directParagraphMarkProperties, directParagraphProperties, drawingOpImpact, endOperation, escapeCssString, escapeXml, extractFragmentPackage, fieldAtomText, fieldOnOffAttribute, findCustomXmlDataPart, findDetectedToc, findNode, findOccurrences, fingerprint, fldCharType, fldSimpleInstr, fnv1a32, foldCase, formatOwnedRunIds, formattableRanges, formsProtectionEnabled, glossaryPartOf, hardBreakAttributes, hardBreakKind, hardBreakText, hasCommentPart, hasLegacyFormFieldData, hasNode, hashAuthored, indexStyles, inlineControlEndingAt, inlineControlStartingAt, insertChildren, insertPackageCustomNode, instrTextValue, isAuthorableRunProperty, isDangerousKey, isDrawingTreeDocOp, isEvaluableField, isFieldChrome, isFldChar, isFldCharNode, isFldSimple, isFldSimpleNode, isInertExecutable, isInstrText, isInstrTextNode, isLegalFldCharType, isPageBreakNode, isSearchableQuery, isStoryPart, isValidId, isValidNCName, isValidParaId, isValidQName, isWholeWord, linkRevisionReplies, locateSites, makeLimitCounter, materializeGlossaryPlaceholders, mergeFragmentIntoPackage, mergedFontProperty, mergedMultiSettingProperty, mergedParagraphMarkProperties, mergedProperties, mintParaId, mintedParagraphIdentityAttributes, nextCommentId, normalizeParagraphIdentity, nullRecord, ooxmlTreesEqual, paraIdOf, paragraphOffsetIndex, paragraphTextOf, parentNodeOf, parseSemVer, parseTocInstruction, planTocEntries, points, pointsToTwips, propertyContainer, readCustomXmlNode, readViewSettings, relationshipsOf, relsPartNameFor, removeNode, removePackageCustomNode, replaceChildren, replaceNode, replayFixture, resolve, resolveContentTypeOf, resolveTocRowHeadings, revisionItemsOf, runAddressRanges, runPropertyEdits, runsCovering, sanitizeHref, satisfies, scrubExport, sectionProtectsForms, segmentsOf, semanticDigest, serializeOoxmlPart, setCommentResolved, setPackageCommentResolved, stableHash, storyParagraphs, storyRootsOf, stylesPartOf, textboxStoriesInPart, toSafeRecord, tocEntryText, tocLeftIndentTwips, twips, twipsToPoints, usedParaIds, validateDrawingOp, validateFixture, validateOoxmlPart, validatePackageInvariants, validateTreeOp, w14RootPrefix, withContentTypeOverride, withCustomXmlDataPart, withCustomXmlNode, withExportedCustomNodes, withNewPart, withRelationship, withoutCustomXmlDataPart, withoutCustomXmlNode, withoutOrphanCustomXmlNodes, wrapTargetToAnchorSpec };