/** * Visible-offset → DOM mapping for the intra-paragraph compare emitter (issue #356). * * `resolveOffset` turns a visible-text offset in a block into a concrete DOM insertion point, * splitting a `#text` node or a `text:s` run when the offset falls strictly inside one. * `extractVisibleRange` clones a visible range's inline content (preserving `text:span` / * hyperlink structure) for out-of-line storage in a `text:deletion` changed-region. * * Contract for callers that mutate: `resolveOffset` re-segments the block on every call and * never trusts a previously computed `Segment[]`. Marker insertion (zero visible width) at an * offset never changes the visible offsets BELOW it, so emitters processing offsets in * DESCENDING order stay correct across splits. `#text` splits are done manually (truncate * `.data` + insert a sibling) — `Text.splitText` is not assumed to exist in xmldom. */ /** A visible offset could not be mapped onto the block's DOM. The emitter degrades the pair. */ export declare class OdfMapError extends Error { } /** A DOM insertion point: `parent.insertBefore(node, before)`. */ export type DomPoint = { parent: Node; before: Node | null; }; /** * Resolve visible offset `vis` in `block` to a DOM insertion point at the offset's natural * nesting depth (inside a `text:span` when the offset is inside one — the LibreOffice-authored * placement). Offsets 0 and `visible.length` resolve to block-level prepend/append. An offset * strictly inside a `#text` node splits it; strictly inside a `text:s` run splits the run, * rebalancing `text:c`. Throws `OdfMapError` when `vis` is out of range. */ export declare function resolveOffset(block: Element, vis: number): DomPoint; /** * Clone the inline content of `block`'s visible range [start, end) as nodes owned by * `targetDoc`, for storage inside a `text:deletion` changed-region. Ancestor inline elements * (`text:span`, hyperlinks) of covered content are shallow-cloned with their attributes; * `#text` is trimmed at the edges; a partially covered `text:s` is rebalanced to the covered * count; `text:tab` / `text:line-break` are copied whole (length 1 — never split). Pure with * respect to `block`. Throws `OdfMapError` on an empty or out-of-range span. */ export declare function extractVisibleRange(block: Element, start: number, end: number, targetDoc: Document): Node[]; //# sourceMappingURL=inline_map.d.ts.map