/** * `:::toc` — the table of contents. The directive expands, before layout, * into ordinary content blocks (one per listed heading, one per part * divider) that flow through the column machinery like paragraphs: they * break across columns and pages, snap to the grid and map clicks back to * the directive line. Measurement is special: an entry is its title (with * a right-aligned number in a column of its own), a leader and the page * label on its last line, and an optional subtitle line (the chapter * authors) under it; a part row is an empty block of a fixed height whose * design `buildHeadersAndFooters` lays out from `toc.parts.design`. */ import type { ContentBlock } from '../parse/index.js'; import type { OutlineEntry, TocGroupHead } from '../types.js'; import type { VDTBlock } from '../vdt.js'; import type { ResolvedConfig } from '../vdt.js'; import type { BlockMeasureContext, MeasuredContentBlock } from './measureContentBlock.js'; export declare function expandTocDirectives(blocks: readonly ContentBlock[], outline: readonly OutlineEntry[] | undefined, resolved: ResolvedConfig): ContentBlock[]; /** What a placed block of the contents carries for the backends and the * design pass: the page its entry links to, or its part row's values * (the row's design is laid out from `toc.parts.design`). The flow * (`build.ts`) and a frame that holds the contents (`calloutLayout.ts`, * #983) stamp the same fields. */ export declare function tocBlockStamps(raw: ContentBlock): Pick; /** The heading levels a `:::toc{levels="…"}` lists (#850): a range * (`"1-2"`), a single level (`"2"`) or a list of either (`"1,3"`), levels * 1 to 6. Undefined when the attribute is absent or names no level: the * levels of `toc.levels` are listed. */ export declare function parseTocLevelsAttr(value: string | undefined): Set | undefined; /** What heads the blocks a contents keeps together (#850): its * directive's `keep` (`"part"`, `"1"`…`"6"`, `"none"`), else * `toc.groups.head` when `toc.groups.keepTogether` is on. Undefined: the * contents keeps nothing together. */ export declare function tocKeepOf(attrs: Readonly> | undefined, resolved: ResolvedConfig): TocGroupHead | undefined; /** * The visual order (`VDTLine.order`) of a contents row: its title's * `titleCount` segments in their own visual order (`titleOrder`, absent for * 0 … n − 1), then the leader and the page label. The row is laid out in the * document's direction, not by bidi over its text: in a right-to-left * document the label stands at the row's left and the title at its right, * even when the title is a Latin one, whose letters alone would make the * whole row one left-to-right run and send the page number to the right. * The mirror pass (`mirrorFrame.ts`) then turns the order for the page's * mirrored flow. Undefined when the order is the segments' own. */ export declare function tocRowOrder(titleOrder: readonly number[] | undefined, titleCount: number, total: number, rtl: boolean): number[] | undefined; /** Measure one block of an expanded `:::toc` (see the module header). */ export declare function measureTocBlock(rawBlock: ContentBlock, columnWidth: number, ctx: BlockMeasureContext): MeasuredContentBlock | null; //# sourceMappingURL=toc.d.ts.map