/** * Runs of inline text for the exercise expansion (#1225): a block's plain * text, its spans and its source map kept together, so a piece cut from a * block (an option, the right side of a pair) or a word the engine adds (a * label, a number) stays mapped to the source the Sandbox points at. */ import type { ContentBlock, InlineSpan } from '../parse/index.js'; /** A block's inline content: `text` is the spans joined, `sourceMap` one * offset per character of it. */ export interface Run { text: string; spans: InlineSpan[]; sourceMap: number[]; } export declare const EMPTY_RUN: Run; export declare function runOf(block: Pick): Run; /** `[start, end)` of a run. */ export declare function sliceRun(run: Run, start: number, end?: number): Run; /** The runs one after another. */ export declare function joinRuns(...runs: Run[]): Run; /** Words the engine sets (a label, a number), mapped to `at`. */ export declare function textRun(text: string, at: number, style?: Partial): Run; /** A run whose spans are all set bold (or `italic`). */ export declare function styledRun(run: Run, style: Partial>): Run; /** The run with the white space at its ends taken off. */ export declare function trimRun(run: Run): Run; /** The run cut at every match of `sep` (a plain-text pattern), trimmed. */ export declare function splitRun(run: Run, sep: RegExp): Run[]; /** A content block of `type` holding `run`. */ export declare function blockOfRun(type: ContentBlock['type'], run: Run, fields?: Partial): ContentBlock; //# sourceMappingURL=text.d.ts.map