import type { ParsedComposedPage } from './document.js'; import type { SourceRange } from './types.js'; import type { ResolvedFrameGroup, ResolvedPageTemplate } from './types.js'; /** One item of a grid on a page. */ export interface RepeatItem { /** The grid group. */ group: string; /** 1-based, in Markdown order. */ item: number; /** Block indices each frame of the set receives, in Markdown order. */ frames: Map; /** The `:::frame` fence each frame's content came in, by frame: its * `label` and `title` dress the instance. */ fences: Map; /** The `slot="…"` value of the piece that opened the item. */ source: SourceRange; } /** An item past a grid's `repeat.max`. */ export interface RepeatOverflow { group: string; /** The grid's main frame. */ frame: string; item: number; max: number; /** Every block of the item. */ indices: number[]; source: SourceRange; } export interface PageRepeats { items: RepeatItem[]; overflow: RepeatOverflow[]; /** Every frame a grid of the template repeats. */ repeated: ReadonlySet; } /** The grids of `template` that repeat a frame set, with the set. */ export declare function repeatingGrids(template: Pick): { group: ResolvedFrameGroup; frames: string[]; max?: number; }[]; /** * The items of every repeating grid of `template` on `page` (see the * module comment). A piece whose slot is no frame of a set is not an item. */ export declare function pageRepeats(page: Pick, template: Pick): PageRepeats; /** The items of each repeating grid a page lays, read from its stories' * names (`[n]` for a frame of the set), by grid. */ export declare function repeatItemsOf(template: Pick, names: Iterable): Map; /** * `template` with each repeating grid's frame set laid out once per item * of `items` (by grid; see {@link repeatItemsOf}): the instances replace * the set's frames in template order, item after item, each item's main * frame first; the grid's `frames` are the instances, `items` says which * belong to which cell. A template with no repeating grid comes back as * it is. */ export declare function expandRepeats(template: ResolvedPageTemplate, items: ReadonlyMap): ResolvedPageTemplate; /** The grid an instance frame belongs to, its item and its set's frame * name, after {@link expandRepeats}. */ export declare function instanceOf(template: Pick, name: string): { group: ResolvedFrameGroup; item: number; frame: string; main: boolean; } | undefined; //# sourceMappingURL=repeat.d.ts.map