/** * Shared visible-text ↔ DOM-node mapping for ODF block-level text elements. * * Extracted from `document.ts` so both the document view and the comments module use one * segmentation of a `text:p`/`text:h`'s visible text without an import cycle. * * All element matching is by `namespaceURI` + `localName` (ODF prefixes are not guaranteed). */ export declare const TEXT_NODE = 3; export declare const ELEMENT_NODE = 1; /** True for the block-level text elements that carry a paragraph's visible content. */ export declare function isTextBlock(el: { namespaceURI?: string | null; localName?: string | null; }): boolean; /** * True for an `office:annotation` / `office:annotation-end` element. Annotation subtrees carry * their own `text:p` comment body, which must NOT be walked as part of the host paragraph's * visible text nor enumerated as a paragraph block — callers skip these subtrees. */ export declare function isAnnotationSubtree(el: { namespaceURI?: string | null; localName?: string | null; }): boolean; /** * True for a `text:tracked-changes` container. It holds change DEFINITIONS — including deleted * paragraphs stored out-of-line inside `text:deletion` — which are NOT body content: they must * not be walked as a host paragraph's visible text nor enumerated as paragraph blocks. Callers * skip this subtree (the deletion-storage analogue of `isAnnotationSubtree`). */ export declare function isTrackedChangesSubtree(el: { namespaceURI?: string | null; localName?: string | null; }): boolean; /** A contiguous slice of a paragraph's visible text and where it came from. */ export type Segment = { kind: 'text'; node: { data: string; }; visStart: number; length: number; } | { kind: 'virtual'; node: Element; virtual: 'space' | 'tab' | 'line-break'; visStart: number; length: number; }; /** * Build the ordered segment list and concatenated visible string for a block. * `text:s` (count via `text:c`) expands to spaces, `text:tab` to a tab, and * `text:line-break` to a newline — each a "virtual" segment whose visible text has no host * `#text` node (so a match landing on one cannot be edited in place via `replaceTextById`); * the generating element itself is carried as `node` so offset-mapping consumers (the compare * emitter) can split or copy it. `office:annotation` / `office:annotation-end` subtrees are * skipped entirely. */ export declare function buildSegments(block: Element): { segments: Segment[]; visible: string; }; //# sourceMappingURL=text_segments.d.ts.map