import type { TextMeasurer } from './measure.js'; import type { LayoutLine, LayoutParagraphFrame } from './result.js'; import type { LayoutParagraph } from './input.js'; export interface ParagraphLayoutResult { /** Lines with `yPx` relative to the paragraph box's own top (0 for the first line). */ lines: LayoutLine[]; spacingBeforePx: number; spacingAfterPx: number; contentHeightPx: number; /** Indices (into `lines`) after which an explicit page break token was consumed. */ pageBreakAfterLine: Set; /** Indices after which an explicit column break token was consumed. */ columnBreakAfterLine: Set; /** Space above the first line and below the last taken by top and bottom borders. */ insetTopPx: number; insetBottomPx: number; frame?: LayoutParagraphFrame; } /** * Lays out one paragraph's lines within `contentWidthPx` (the column/table * cell width available to the paragraph, before indents are subtracted). * Page and column breaks are reported back as line indices; the page-flow * stage decides what to do with them (start a new page/column) since only it * knows the current page/column state. */ /** * Space taken from one line by wrapped floating pictures: insets from the line's left and right * (beyond the paragraph indents) and a gap to skip first (text below a picture). `yPx` is the * line's top relative to the paragraph's first line. */ export type LineBoxFn = (yPx: number, heightPx: number) => { leftInsetPx: number; rightInsetPx: number; gapBeforePx: number; }; export declare function layoutParagraph(paragraph: LayoutParagraph, contentWidthPx: number, measurer: TextMeasurer, note: (message: string) => void, lineBox?: LineBoxFn, startToken?: number): ParagraphLayoutResult; //# sourceMappingURL=paragraph-layout.d.ts.map