API reference
@searsuite/sear-domain-doc
Rich-document nodes, selections, schema helpers, inline styles, and layout contracts.
86 exportsderived from source
- classDocNodeRegistrysource ↗
-
class DocNodeRegistryRegistry that maps persisted rich-document node types to constructors.
constructorconstructor DocNodeRegistry(): DocNodeRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the document node registry.
methodcreate create(schema: Schema): RichDocNodeInstance method: delegates to the static registry; used by DI-injected consumers.
schema: Schema
methodisBlockType isBlockType(type: string): booleanInstance method: returns whether the persisted type has been registered as a block container.
type: string
methodisTextType isTextType(type: string): booleanInstance method: returns whether the persisted type has been registered as text-like.
type: string
methodregister register(definition: DocNodeDefinition): voidRegisters a node factory on this registry instance.
definition: DocNodeDefinition
methodrequireDefaultBlockType requireDefaultBlockType(): stringInstance method: returns the registered default block type for generic text editing.
methodrequireDefaultTextType requireDefaultTextType(): stringInstance method: returns the registered default text type for generic text editing.
methodcreatestatic create(schema: Schema): RichDocNodeCreates a rich-document node from persisted schema.
schema: Schema
methodisBlockTypestatic isBlockType(type: string): booleanReturns whether the persisted type has been registered as a block container.
type: string
methodisTextTypestatic isTextType(type: string): booleanReturns whether the persisted type has been registered as text-like.
type: string
methodregisterstatic register(type: string, creator: (schema: Schema): RichDocNode): voidregister(definition: DocNodeDefinition): voidRegisters a node factory for a persisted node type.
type: stringcreator: (schema: Schema): RichDocNodedefinition: DocNodeDefinition
methodrequireDefaultBlockTypestatic requireDefaultBlockType(): stringReturns the registered default block type for generic text editing.
methodrequireDefaultTextTypestatic requireDefaultTextType(): stringReturns the registered default text type for generic text editing.
- classParagraphNodesource ↗
-
class ParagraphNode extends RichDocNodeBuilt-in paragraph node.
constructorconstructor ParagraphNode(schema: NodeSchema): ParagraphNodeCreates a paragraph node from persisted schema.
schema: NodeSchema
propertynodeTypestatic readonly nodeType: "paragraph"Persisted schema type owned by the paragraph document feature.
- classRichDocNodesource ↗
-
class RichDocNodeBase class for rich-document nodes used by the document layout engine.
propertyattrs attrs: Record<string, any>Node attributes such as text styles or block metadata.
propertycontent content: RichDocNode[] | TextNode[]Child rich-document nodes.
propertyid id: string | undefinedStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytype type: stringDomain node type identifier.
methodcreatestatic create(_schema: Schema): RichDocNodeCreates a concrete rich-document node from persisted schema.
_schema: Schema
- classRichTextBlockFlowRegistrysource ↗
-
class RichTextBlockFlowRegistryOrdered registry for plugin-owned top-level block flow resolution.
constructorconstructor RichTextBlockFlowRegistry(defaultSpacingAfter?: number): RichTextBlockFlowRegistrydefaultSpacingAfter: number
propertysymbolstatic readonly symbol: typeof symbolmethodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void): voidassertWrite: (): void
methodregister register(contribution: RichTextBlockFlowContribution): (): voidcontribution: RichTextBlockFlowContribution
methodresolve resolve(input: { blockCount: number; index: number; node: RichDocNode }): numberinput: { blockCount: number; index: number; node: RichDocNode }
- classRichTextInlineStyleRegistrysource ↗
-
class RichTextInlineStyleRegistryOrdered registry for plugin-owned rich-text inline style readers and mutations.
constructorconstructor RichTextInlineStyleRegistry(): RichTextInlineStyleRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the inline style registry.
methodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void): voidassertWrite: (): void
methodgetMutation getMutation(styleKey: string): RichTextInlineStyleMutation | undefinedResolves a plugin-owned persisted inline style mutation by style key when registered.
styleKey: string
methodgetMutationKeys getMutationKeys(): readonly string[]Returns all registered persisted inline-style mutation keys in registration order.
methodreadTextNodeStyle readTextNodeStyle(node: TextNode): Readonly<Record<string, unknown>> | undefinedReads all registered style slices from a text node.
node: TextNode
methodregister register(contribution: RichTextInlineStyleContribution): (): voidRegisters one plugin-owned inline style contribution.
contribution: RichTextInlineStyleContribution
methodrequireMutation requireMutation(styleKey: string): RichTextInlineStyleMutationResolves a plugin-owned persisted inline style mutation by style key.
styleKey: string
methodsameStyle sameStyle(styleA: Readonly<Record<string, unknown>> | undefined, styleB: Readonly<Record<string, unknown>> | undefined): booleanCompares two style bags using stable key/value serialization.
styleA: Readonly<Record<string, unknown>> | undefinedstyleB: Readonly<Record<string, unknown>> | undefined
- classRichTextLineBoxRegistrysource ↗
-
class RichTextLineBoxRegistryOrdered registry for plugin-owned rich-text line box resolution.
constructorconstructor RichTextLineBoxRegistry(): RichTextLineBoxRegistrypropertysymbolstatic readonly symbol: typeof symbolDI token for resolving the rich-text line box registry.
methodenforceWriteBoundary enforceWriteBoundary(assertWrite: (): void): voidassertWrite: (): void
methodregister register(contribution: RichTextLineBoxContribution): (): voidRegisters one plugin-owned line box contribution.
contribution: RichTextLineBoxContribution
methodresolve resolve(input: { chars: readonly RichTextChar[]; lineSpacing?: RichTextLineSpacing }): RichTextLineBoxResolves the final line box for one measured line.
input: { chars: readonly RichTextChar[]; lineSpacing?: RichTextLineSpacing }
- classTableCellNodesource ↗
-
class TableCellNode extends RichDocNodeBuilt-in table cell node.
constructorconstructor TableCellNode(schema: NodeSchema): TableCellNodeCreates a table cell node from persisted schema.
schema: NodeSchema
propertynodeTypestatic readonly nodeType: "tableCell"Persisted schema type owned by the table document feature.
- classTableNodesource ↗
-
class TableNode extends RichDocNodeBuilt-in table block node.
constructorconstructor TableNode(schema: NodeSchema): TableNodeCreates a table node from persisted schema.
schema: NodeSchema
propertynodeTypestatic readonly nodeType: "table"Persisted schema type owned by the table document feature.
- classTableRowNodesource ↗
-
class TableRowNode extends RichDocNodeBuilt-in table row node.
constructorconstructor TableRowNode(schema: NodeSchema): TableRowNodeCreates a table row node from persisted schema.
schema: NodeSchema
propertynodeTypestatic readonly nodeType: "tableRow"Persisted schema type owned by the table document feature.
- classTextNodesource ↗
-
class TextNode extends RichDocNodeBuilt-in text leaf node.
constructorconstructor TextNode(schema: NodeSchema): TextNodeTextNode(schema: TextSchema): TextNodeCreates a text node from persisted schema.
schema: NodeSchema
propertytext text?: stringText content carried by this leaf node.
propertynodeTypestatic readonly nodeType: "text"Persisted schema type owned by the text input document feature.
- interfaceDocCursorPossource ↗
-
interface DocCursorPosCursor position inside a RichDocNode tree.
pathis an array of integer indices that navigates from the implicit document root (theRichDocNode[]array treated asroot.content) down to the text node that contains the cursor.Examples for a flat document: [0, 0] → paragraph 0 → text node 0 (the most common case in P0) [1, 2] → paragraph 1 → inline span 2
The path aligns with OT operation paths: a StringInsert at this cursor becomes
{ p: [...path, offset], si: text }applied to the root wrapper{ type: 'doc', content: doc }.offsetis the character position within the leaf text node: 0 = before first character n = after the nth character (= text.length means "end of node") - interfaceDocNodeDefinitionsource ↗
-
interface DocNodeDefinitionRegistration contract for one persisted rich-document node type.
propertycreate readonly create: (schema: Schema): RichDocNodeFactory that creates the runtime node instance for this persisted schema.
propertydefaultBlock readonly defaultBlock?: booleanWhether this block is the default container for plain text editing.
propertydefaultText readonly defaultText?: booleanWhether this text-like node is the default leaf for plain text editing.
propertyrole readonly role?: DocNodeRoleGeneric role consumed by core editing/layout helpers.
propertytype readonly type: stringPersisted schema type owned by a document feature plugin.
- interfaceDocSelectionsource ↗
-
interface DocSelectionAnchor + head selection model. Collapsed selection (cursor only): anchor === head.
headmoves freely;anchoris fixed until a non-Shift action resets it. - interfaceInlineTextRangePatchsource ↗
-
interface InlineTextRangePatchOne text-node replacement produced by an inline text range edit.
propertybeforeLength readonly beforeLength: numberpropertyblockIndex readonly blockIndex: numberpropertychildIndex readonly childIndex: numberpropertyendOffset readonly endOffset: numberpropertyoldNode readonly oldNode: TextNodepropertyreplacement readonly replacement: readonly RichDocNode[]propertyreplacementCount readonly replacementCount: numberpropertyselectedLength readonly selectedLength: numberpropertystartOffset readonly startOffset: numberpropertywholeNode readonly wholeNode: boolean - interfaceInlineTextRangePatchContextsource ↗
-
interface InlineTextRangePatchContextContext supplied when patching one selected text-node segment.
propertyblockIndex readonly blockIndex: numberpropertychildIndex readonly childIndex: numberpropertyendOffset readonly endOffset: numberpropertynode readonly node: TextNodepropertystartOffset readonly startOffset: number - interfaceRichNodeFactorysource ↗
-
interface RichNodeFactoryMinimal factory interface for creating document nodes. Implemented by
DocNodeRegistry(static or injected).methodcreate create(schema: { attrs?: Record<string, unknown>; content?: unknown[]; id?: string; text?: string; type: string }): RichDocNodeschema: { attrs?: Record<string, unknown>; content?: unknown[]; id?: string; text?: string; type: string }
- interfaceRichTextBlockFlowContributionsource ↗
-
interface RichTextBlockFlowContributionPlugin-owned contribution that can refine block flow metrics.
- interfaceRichTextBlockFlowResolveInputsource ↗
-
interface RichTextBlockFlowResolveInputInput used to resolve the flow spacing after one top-level document block.
propertyblockCount readonly blockCount: numberpropertyindex readonly index: numberpropertynode readonly node: RichDocNodepropertyspacingAfter readonly spacingAfter: number - interfaceRichTextBlockLayoutProvidersource ↗
-
interface RichTextBlockLayoutProviderDomain-side contract for services that provide measured rich-text block layout.
methodcalculateLayoutPerParagraph calculateLayoutPerParagraph(width: number): RichTextLine[][]width: number
methodsetBaseFont setBaseFont(font: string): voidUpdates the transient font used when measuring unstyled text.
font: string
- interfaceRichTextInlineStyleContributionsource ↗
-
interface RichTextInlineStyleContributionPlugin-owned contribution for one inline text style concern.
propertykey readonly key: stringStable contribution key used for duplicate detection and unregister.
propertymutations mutations?: readonly RichTextInlineStyleMutation[]Persisted inline text-style mutations owned by this contribution.
methodread read(input: RichTextInlineStyleReadInput): Readonly<Record<string, unknown>> | undefinedReads this contribution's style slice from a text node.
input: RichTextInlineStyleReadInput
- interfaceRichTextInlineStyleMutationsource ↗
-
interface RichTextInlineStyleMutationPlugin-owned mutation for one persisted inline text-style concern.
- interfaceRichTextInlineStyleMutationInputsource ↗
-
interface RichTextInlineStyleMutationInputInput supplied when an inline-style contribution mutates persisted text-node attrs.
- interfaceRichTextInlineStyleReadInputsource ↗
-
interface RichTextInlineStyleReadInputInput supplied when an inline-style contribution reads document attrs.
- interfaceRichTextLineBoxsource ↗
-
interface RichTextLineBoxFlow metrics for one rich-text line.
propertyascent readonly ascent: numberpropertycontentHeight readonly contentHeight: numberpropertydescent readonly descent: numberpropertyleadingBottom readonly leadingBottom: numberpropertyleadingTop readonly leadingTop: numberpropertylineGap readonly lineGap: numberpropertylineHeight readonly lineHeight: number - interfaceRichTextLineBoxContributionsource ↗
-
interface RichTextLineBoxContributionPlugin-owned contribution that can refine rich-text line flow metrics.
- interfaceRichTextLineBoxResolveInputsource ↗
-
interface RichTextLineBoxResolveInputInput used to resolve the flow box for one measured rich-text line.
propertychars readonly chars: readonly RichTextChar[]propertylineBox readonly lineBox: RichTextLineBoxpropertylineSpacing readonly lineSpacing?: RichTextLineSpacing - interfaceRichTextLineSpacingsource ↗
-
interface RichTextLineSpacingPersisted or default line-spacing policy resolved by paragraph layout.
- interfaceRichTextParagraphLayoutsource ↗
-
interface RichTextParagraphLayoutResolved paragraph layout values consumed by line and block flow.
propertylineSpacing readonly lineSpacing: RichTextLineSpacingpropertyspacingAfter readonly spacingAfter: number - interfaceRichTextParagraphLayoutDefaultssource ↗
-
interface RichTextParagraphLayoutDefaultsDefault paragraph layout values supplied by the owning document runtime.
propertylineSpacing readonly lineSpacing: RichTextLineSpacingpropertyspacingAfter readonly spacingAfter: number - interfaceTextAttributeRangesource ↗
-
interface TextAttributeRange<TAttributes>A generic text attribute range in document-relative character offsets.
- interfaceTextGraphemeRangesource ↗
-
interface TextGraphemeRangeOne grapheme range expressed in UTF-16 source offsets.
- interfaceTextSelectionsource ↗
-
interface TextSelectionPublic contract for TextSelection.
- typeDocNodeIdsource ↗
-
type DocNodeId = string & { [docNodeIdBrand]: true }Stable identity used by document layout and retained render nodes.
- typeDocNodeRolesource ↗
-
type DocNodeRole = typeof DocNodeRole[keyof typeof DocNodeRole]Type contract for DocNodeRole.
- typeInlineTextRangeAttrsPatchersource ↗
-
type InlineTextRangeAttrsPatcher = (attrs: Record<string, unknown>, context: InlineTextRangePatchContext): Record<string, unknown>Patches the attrs for the selected segment of one text node.
- typeRichTextCharsource ↗
-
type RichTextChar = unknownMeasured inline character/token used by rich-text line wrapping.
propertychar char: stringpropertyfontAscent fontAscent: numberpropertyfontDescent fontDescent?: numberpropertyfontLineGap fontLineGap?: numberpropertyheight height: numberpropertystyle style?: RichTextInlineStylepropertytextNodeIndex textNodeIndex?: numberDirect child index of the source text node within its paragraph.
propertytextNodeOffset textNodeOffset?: numberCharacter offset within the source text node.
propertywidth width: number - typeRichTextInlineStylesource ↗
-
type RichTextInlineStyle = Readonly<Record<string, unknown>>Domain-neutral inline style bag carried by measured rich-text chars.
- typeRichTextLinesource ↗
-
type RichTextLine = unknownOne laid-out rich-text line with aggregate dimensions.
propertychars chars: RichTextChar[]propertyfontAscent fontAscent: numberMax measured font ascent across all chars on this line; used for stable vertical centering.
propertyfontDescent fontDescent?: numberMax measured font descent across all chars on this line.
propertyheight height: numberpropertylineBox lineBox?: RichTextLineBoxPlugin-resolved line box used for flow and baseline placement.
propertywidth width: number - typeRichTextLineSpacingModesource ↗
-
type RichTextLineSpacingMode = "auto" | "multiple" | "atLeast" | "exact"Supported paragraph line-spacing semantics.
- typeTextAttributePatchsource ↗
-
type TextAttributePatch = Readonly<Record<string, unknown>>Attributes merged into a text node for one presentation range.
- variabledefaultRichTextParagraphLayoutDefaultssource ↗
-
defaultRichTextParagraphLayoutDefaults: RichTextParagraphLayoutDefaultsNeutral defaults for runtimes that do not configure document paragraph spacing.
- variableDocNodeRolesource ↗
-
DocNodeRole: { Block: "block"; Text: "text" }Node roles used by generic rich-document editing and layout helpers.
- variableRichTextParagraphAttributesource ↗
-
RichTextParagraphAttribute: { LineSpacing: "lineSpacing"; SpacingAfter: "spacingAfter" }Persisted paragraph attribute keys owned by the paragraph feature.
- functionapplyInlineTextRangePatchPlansource ↗
-
applyInlineTextRangePatchPlan(doc: readonly RichDocNode[], patches: readonly InlineTextRangePatch[]): RichDocNode[]Applies an inline text range patch plan to an immutable document snapshot.
doc: readonly RichDocNode[]patches: readonly InlineTextRangePatch[]
- functionapplyInlineTextStylePropertyMutationsource ↗
-
applyInlineTextStylePropertyMutation(attrs: Readonly<Record<string, unknown>>, property: string, value: unknown): Record<string, unknown>Applies or removes one persisted inline-text style property.
attrs: Readonly<Record<string, unknown>>property: stringvalue: unknown
- functionapplyRichTextFormatsource ↗
-
applyRichTextFormat(document: readonly Schema[], format: Readonly<Record<string, unknown>>, registry: RichTextInlineStyleRegistry): Schema[]Replaces registered styles while retaining text, structure and unrelated attributes.
document: readonly Schema[]format: Readonly<Record<string, unknown>>registry: RichTextInlineStyleRegistry
- functionapplyTextAttributeRangessource ↗
-
applyTextAttributeRanges(doc: RichDocNode[], ranges: readonly TextAttributeRange<Readonly<Record<string, unknown>>>[]): RichDocNode[]Applies presentation attributes to text ranges without owning their meaning. Plugins decide how to interpret the resulting text-node attrs.
doc: RichDocNode[]ranges: readonly TextAttributeRange<Readonly<Record<string, unknown>>>[]
- functionbuildInlineTextRangePatchPlansource ↗
-
buildInlineTextRangePatchPlan(doc: readonly RichDocNode[], selection: DocSelection, patchAttrs: InlineTextRangeAttrsPatcher): InlineTextRangePatch[]Builds reusable text-node split/replacement patches for a document selection.
doc: readonly RichDocNode[]selection: DocSelectionpatchAttrs: InlineTextRangeAttrsPatcher
- functioncaptureRichTextFormatsource ↗
-
captureRichTextFormat(document: readonly Schema[], registry: RichTextInlineStyleRegistry): Readonly<Record<string, unknown>>Captures the leading text run's explicit registered styles, excluding host defaults.
document: readonly Schema[]registry: RichTextInlineStyleRegistry
- functioncloneRichDocumentsource ↗
-
cloneRichDocument(document: readonly RichDocNode[]): RichDocNode[]Returns a detached mutable snapshot of a rich document.
document: readonly RichDocNode[]
- functioncompareCursorsource ↗
-
compareCursor(a: DocCursorPos, b: DocCursorPos): -1 | 0 | 1Lexicographic comparison of two cursor positions. Compares
pathelement-by-element, thenoffset. Returns -1 | 0 | 1.a: DocCursorPosb: DocCursorPos
- functioncomputeFirstBaselineYsource ↗
-
computeFirstBaselineY(boxHeight: number, cellPadding: number, fontAscent: number, lineHeight: number, offsetY?: number): numberCompute the Y coordinate of the first text line's baseline for vertical centering.
Text painters in this engine position runs by their alphabetic baseline, so the correct formula to visually center a line inside a padded box is:
baseline = center + (fontAscent - fontDescent) / 2
Since
lineHeight = fontAscent + fontDescent, this simplifies to:baseline = offsetY + cellPadding + (boxHeight - 2·cellPadding + 2·fontAscent - lineHeight) / 2
boxHeight: numberTotal pixel height of the containing box (e.g. cell height).
cellPadding: numberPadding on each side of the box.
fontAscent: numberMeasured font ascent of the first line (stable across all glyphs in the font).
lineHeight: numberTotal line height (
fontAscent + fontDescent) of the first line.offsetY: numberAbsolute Y offset of the box top-left (default 0 for relative coordinates).
- functioncreateDefaultRichTextBlockFlowContributionsource ↗
-
createDefaultRichTextBlockFlowContribution(): RichTextBlockFlowContributionCreates the paragraph-owned default after-spacing contribution.
- functioncreateDefaultRichTextLineBoxContributionsource ↗
-
createDefaultRichTextLineBoxContribution(): RichTextLineBoxContributionCreates the default line box contribution used by document composition roots.
- functioncreateDocNodeIdsource ↗
-
createDocNodeId(value: string): DocNodeIdCreates a typed document node id from a non-empty string value.
value: string
- functioncreateDocNodeIdFromPathsource ↗
-
createDocNodeIdFromPath(path: readonly string | number[]): DocNodeIdCreates a fallback document node id from a rich-document path.
path: readonly string | number[]
- functioncreateEmptyParagraphsource ↗
-
createEmptyParagraph(): RichDocNodeCreate a single empty paragraph containing one empty text node.
- functioncreateInlineTextStyleAttrsPatchersource ↗
-
createInlineTextStyleAttrsPatcher(property: string, value: unknown): InlineTextRangeAttrsPatcherCreates the compatibility inline text-style attrs patcher for property/value callers.
property: stringvalue: unknown
- functioncreateRichTextLineSpacingContributionsource ↗
-
createRichTextLineSpacingContribution(): RichTextLineBoxContributionCreates the paragraph-owned line-spacing contribution.
- functiongetDocumentOffsetsource ↗
-
getDocumentOffset(doc: RichDocNode[], position: DocCursorPos): numberConverts a cursor position into a zero-based offset in the document's plain text, using one newline character between paragraphs.
doc: RichDocNode[]position: DocCursorPos
- functiongetTextNodeLengthsource ↗
-
getTextNodeLength(doc: RichDocNode[], path: number[]): numberCharacter length of the text node at
path. Returns 0 for missing / non-text nodes.doc: RichDocNode[]path: number[]
- functionisCollapsedsource ↗
-
isCollapsed(sel: DocSelection): booleanRuns the is collapsed helper.
sel: DocSelection
- functionisDocSemanticallyEmptysource ↗
-
isDocSemanticallyEmpty(doc: RichDocNode[]): booleanReturns true if every paragraph in
doccontains no meaningful text.doc: RichDocNode[]
- functionisTextNodesource ↗
-
isTextNode(node: TextNode | RichDocNode): nodeReturns true when a rich-document node is a text leaf.
node: TextNode | RichDocNode
- functionmapInlineTextRangePatchCursorsource ↗
-
mapInlineTextRangePatchCursor(cursor: DocCursorPos, patches: readonly InlineTextRangePatch[]): DocCursorPosRepositions a cursor after an inline text range patch plan has been applied.
cursor: DocCursorPospatches: readonly InlineTextRangePatch[]
- functionnormalizeDocForEditsource ↗
-
normalizeDocForEdit(doc: RichDocNode[]): RichDocNode[]Ensure
dochas at least one paragraph. Returns the same array if already valid; otherwise[createEmptyParagraph()].doc: RichDocNode[]
- functionnormalizeSelectionsource ↗
-
normalizeSelection(sel: DocSelection): { end: DocCursorPos; start: DocCursorPos }Normalize selection so
start≤endregardless of direction.sel: DocSelection
- functionparaTextsource ↗
-
paraText(para: RichDocNode): stringExtract the concatenated plain text of a paragraph node.
para: RichDocNode
- functionparaTextLengthsource ↗
-
paraTextLength(para: RichDocNode): numberTotal plain-text length of a paragraph node (sums all direct text children).
para: RichDocNode
- functionparseRichTextLineSpacingsource ↗
-
parseRichTextLineSpacing(value: unknown): RichTextLineSpacing | nullParses a persisted line-spacing override, returning null when invalid.
value: unknown
- functionparseRichTextParagraphSpacingsource ↗
-
parseRichTextParagraphSpacing(value: unknown): number | nullParses a persisted paragraph-spacing override, returning null when invalid.
value: unknown
- functionreadTextStyleAttrssource ↗
-
readTextStyleAttrs(attrs: Record<string, unknown>): Record<string, unknown>Reads the inline text-style attribute bag from a node's attributes.
attrs: Record<string, unknown>
- functionregisterParagraphDocNodesource ↗
-
registerParagraphDocNode(registry: DocNodeRegistrar): voidRegisters the paragraph node type owned by paragraph-oriented document features.
registry: DocNodeRegistrar
- functionregisterTableDocNodessource ↗
-
registerTableDocNodes(registry: DocNodeRegistrar): voidRegisters the table node types owned by table-oriented document features.
registry: DocNodeRegistrar
- functionregisterTextDocNodesource ↗
-
registerTextDocNode(registry: DocNodeRegistrar): voidRegisters the text node type owned by text-input document features.
registry: DocNodeRegistrar
- functionreplaceInlineTextStylesource ↗
-
replaceInlineTextStyle(doc: RichDocNode[], selection: DocSelection, property: string, value: unknown, patchAttrs?: InlineTextRangeAttrsPatcher): RichDocNode[]Replaces one inline text-style property on the selected document range.
doc: RichDocNode[]selection: DocSelectionproperty: stringvalue: unknownpatchAttrs: InlineTextRangeAttrsPatcher
- functionresolveDocNodeIdsource ↗
-
resolveDocNodeId(node: { id?: string } | undefined, path: readonly string | number[]): DocNodeIdResolves a block-level document id, preferring persisted node identity over path fallback.
node: { id?: string } | undefinedpath: readonly string | number[]
- functionresolveNodesource ↗
-
resolveNode(doc: RichDocNode[], path: number[]): RichDocNode | undefinedResolve the text node at
pathinsidedoc(treated as the root content array). Returnsundefinedif the path is invalid.doc: RichDocNode[]path: number[]
- functionresolveRichTextParagraphLayoutsource ↗
-
resolveRichTextParagraphLayout(node: RichDocNode | undefined, defaults?: RichTextParagraphLayoutDefaults): RichTextParagraphLayoutResolves paragraph-owned overrides over the runtime defaults.
node: RichDocNode | undefineddefaults: RichTextParagraphLayoutDefaults
- functionresolveTextContentsource ↗
-
resolveTextContent(doc: RichDocNode[], path: number[]): stringGet the plain-text string of the node at
path. Convenience wrapper aroundresolveNode.doc: RichDocNode[]path: number[]
- functionsegmentTextGraphemessource ↗
-
segmentTextGraphemes(text: string): readonly TextGraphemeRange[]Segments text into grapheme ranges, with a code-point fallback for older hosts.
text: string
- functionstringToRichDocsource ↗
-
stringToRichDoc(text: string): RichDocNode[]Convert a plain string to a single-paragraph RichDocNode[]. Used for backward-compat when cell data is still stored as a plain string.
text: string
- functionupdateInlineTextStyleAttrssource ↗
-
updateInlineTextStyleAttrs(current: unknown, property: string, value: unknown): Record<string, unknown>Updates one entry in a text node's style attrs bag.
current: unknownproperty: stringvalue: unknown
- interfaceNodeSchemasource ↗
-
interface NodeSchemaPersisted rich-document node schema shared by document runtime, commands, and OT.
propertyattrs attrs?: Record<string, any>Node attributes for styles, formatting, and feature-owned metadata.
propertycontent content?: Schema[]Child rich-document nodes.
propertyid id?: stringStable structural identity for layout, retained render nodes, and collaboration mapping.
propertytext text?: stringOptional text content for leaf text nodes.
propertytype type: stringDomain node type identifier.
- interfaceTextSchemasource ↗
-
interface TextSchema extends NodeSchemaPersisted text-bearing rich-document node schema.
propertytext text: stringOptional text content for leaf text nodes.
No public exports match that search.