/** * Elementary-run computation for inline serialization. * * The doc model permits arbitrarily overlapping spans; markdown needs properly * nested delimiters. Step one of the serializer is to slice a text range into * **elementary runs** — maximal intervals over which the set of active marks * is constant. The emitter (docToMd) then walks the runs with a close/reopen * stack, which is guaranteed to produce valid nesting. */ import type { InlineSpan, InlineSpanType } from '@sigx/lynx-richtext'; export interface ActiveMark { type: InlineSpanType; /** Identity key — distinguishes links by href so adjacent different links don't merge. */ key: string; attrs?: Record; } export interface Run { start: number; end: number; /** Marks active over the whole run. */ active: ActiveMark[]; } export declare function markPriority(mark: ActiveMark): number; /** * Slice `[start, end)` into elementary runs for the given spans. * * `code` is terminal: within a code span every other mark except an enclosing * `link` is suppressed (markdown cannot style inside code spans, but * `[`code`](href)` is valid). */ export declare function computeRuns(spans: InlineSpan[], start: number, end: number): Run[];