/** * Cutting a `:::columns` group (#634). A group lays its children out in a * galley at the sub-column width — one galley for a `flow="snake"` group, * one per stream (the runs its `breaks` start) for a `flow="parallel"` one * — and sets that galley in N sub-columns. A box (or a main-flow group's * frameless box) that splits inside a group needs to know how far the * galley goes in a fragment of a given room: {@link fillGalley} fills the * sub-columns in turn, cutting between the galley's items or between the * lines of a text item, never leaving fewer than the minimum lines of a * paragraph on either side of a cut. The fragment that goes on is set * with {@link minFillHeight}: the lowest column height that still holds * its galley, so its sub-columns end as level as the cuts allow. */ /** One item of a galley: a child block (or a nested box) of the group. */ export interface GalleyItem { /** Position of the child in the box's children (a nested box's opening * marker). */ child: number; /** Lines of the child set before this item: a paragraph the fragment * opens inside of. */ lineBase: number; /** Top in its galley and height, px. */ y: number; height: number; /** A text item that may be cut: the bottom of each of its lines, * relative to `y`. Absent for an item never cut (a figure, a table, a * display formula, a nested box, a one-line paragraph). */ lineBottoms?: number[]; /** A heading under `headings.keepWithNext`: no cut right after it, so * it never closes a column (#1019). */ keepWithNext?: boolean; } /** Where a galley may be cut: before item `item` (`line` 0), or after the * first `line` lines of it. `endY` is the bottom of what goes before the * cut, `startY` the top of what goes after it (the space between two * items vanishes at a column's head). */ export interface GalleyBreak { item: number; line: number; endY: number; startY: number; } /** The places a galley may be cut, in order (the galley's start and end * are not among them). A cut inside a text item leaves at least * `minLines` of its lines before it and `minAfter` (default `minLines`) * after it, counted over this galley's part of it. An item that keeps * with the next one (a heading) is never followed by a cut. */ export declare function galleyBreaks(items: readonly GalleyItem[], minLines: number, minAfter?: number): GalleyBreak[]; /** How a galley fills `columns` sub-columns of height `height`: the * breaks that end each filled column, in order (the last one is where * the fragment ends, unless `end`), and the tallest column. `end`: the * whole galley fits. A column that cannot take the next item stops the * fill there. */ export interface GalleyFill { end: boolean; /** Indices into the breaks, one per column the fill closed with a cut. */ cuts: number[]; used: number; } export declare function fillGalley(items: readonly GalleyItem[], breaks: readonly GalleyBreak[], columns: number, height: number): GalleyFill; /** The lowest column height at which the galley fits `columns` * sub-columns whole (to within a hundredth of a px), or the galley's * height when nothing shorter does. */ export declare function minFillHeight(items: readonly GalleyItem[], breaks: readonly GalleyBreak[], columns: number): number; //# sourceMappingURL=columnsGroup.d.ts.map