/** * `:::index` — the back-of-book index (#165). The directive expands, before * layout, into ordinary content blocks, one per entry, that flow through * the column machinery like paragraphs (the contents do the same, see * `toc.ts`). The entries come from the index marks of the book's outline * (`OutlineEntry.indexMark`), each with the page it landed on: grouped by * term and sub-term, sorted in the document language's alphabetical order, * their pages merged into ranges. An entry that opens a new letter carries * the letter head in its own block, so a head never ends a column alone. */ import type { ContentBlock } from '../parse/index.js'; import type { OutlineEntry } from '../types.js'; import type { ContentWarning, ResolvedConfig, VDTDocument } from '../vdt.js'; import type { BlockMeasureContext, MeasuredContentBlock } from './measureContentBlock.js'; /** The locale the index sorts in: its own, else the document's. */ export declare function indexLocale(resolved: ResolvedConfig): string; /** The second number of a range, as `format` writes it: `'chicago'` drops * the digits it shares with the first (Chicago 9.64: 71–72, 100–104, * 101–8, 321–28, 498–532, 1087–89, 1496–500). Labels that are not plain * numbers are kept whole. */ export declare function rangeEnd(fromLabel: string, toLabel: string, format: 'full' | 'chicago'): string; /** The content blocks with every `:::index` directive replaced by the * entries it prints, and the warnings the index raised. Without an * outline (no directive) the input is returned as is. */ export declare function expandIndexDirectives(blocks: readonly ContentBlock[], outline: readonly OutlineEntry[] | undefined, resolved: ResolvedConfig): { blocks: ContentBlock[]; warnings: ContentWarning[]; }; /** Measure one block of an expanded `:::index` (see the module header). */ export declare function measureIndexBlock(rawBlock: ContentBlock, columnWidth: number, ctx: BlockMeasureContext): MeasuredContentBlock | null; /** * The page of each index mark of `blocks` (the parsed markdown body) in the * laid-out `doc`: the page of the line holding the character the mark is * attached to (`IndexMark.anchor`), found by the lines' source ranges. * When no line holds it (the character set by a design, not a line), the * mark takes the nearest line before it (`attach: 'before'`) or after it. * Undefined when the document has no marks. */ export declare function locateIndexMarks(doc: VDTDocument, blocks: readonly ContentBlock[], bodyOffset: number): { sourceStart: number; pageIndex: number; }[] | undefined; //# sourceMappingURL=indexDirective.d.ts.map