import { EffectiveTextStyle } from './style'; export type TextRun = { text: string; style: EffectiveTextStyle; align: number; justify: boolean; spaceBefore?: number; }; /** One future text element: a paragraph (or a style-delimited piece of one). */ export type TextChunk = { runs: TextRun[]; align: number; justify: boolean; }; export declare const chunkText: (chunk: TextChunk) => string; /** * Split runs into chunks (= future text elements) at hard breaks. What counts * as "hard" (starts a new element) vs "soft" (kept as a `\n` inside the same * element) depends on the heuristic. A style OR leading change across a break is * always "differs" — differing leading forces a split because core has no per-line * leading, so the two lines can only be spaced correctly as separate elements: * * - `'strict'`: every PARAGRAPH break (IDML `
`, Enter) is hard; a forced * break (U+2028, Shift+Enter) is hard only when the style/leading differs. * - `'format-and-paragraph-only'`: ANY break is hard only when the style/leading * differs across it OR it forms a GAP (a blank line between content) — so * same-style consecutive lines with no blank line between (a hyphenated * "Firmen-\nlogo", a wrapped address) stay together as one element. * * `'never'` is handled by the caller (one element, richText for real diffs) * and never reaches here. Returned chunks are in order and may include empty * ones (blank-line gaps); callers skip those when emitting but need them for * line accounting. */ export declare function splitRunsIntoChunks(runs: TextRun[], heuristic: 'strict' | 'format-and-paragraph-only'): TextChunk[]; //# sourceMappingURL=split.d.ts.map