/** * Index marks (`:index[…]` and `:index{…}`, #165): the terms a back-of-book * index lists. The marks are taken out of the markdown before the block * parser runs — an invisible mark leaves nothing, a visible one leaves its * text — so they never change the spans, the line breaks or the layout; * the parse result's source offsets are mapped back to the original * markdown. Each mark keeps the source offset of the character it is * attached to (`anchor`): the build finds the page of the laid-out line * holding that character. */ import type { AnchorMark, ContentBlock, IndexMark, ParseIssue } from './types.js'; /** A mark as extracted, before it is attached to a block. */ interface PendingMark { mark: IndexMark | AnchorMark; /** Position in the stripped text where the mark was. */ at: number; } export interface IndexMarkExtraction { /** The markdown without the marks (a visible mark leaves its text). */ text: string; marks: PendingMark[]; /** Offset in `text` → offset in the original markdown. */ toOriginal: (offset: number) => number; } export declare function extractIndexMarks(markdown: string, options?: { fences?: boolean; }): IndexMarkExtraction | null; /** * Attach the extracted marks to the blocks parsed from the stripped text * (offsets still in stripped coordinates): the text block holding the * mark's position, else the next one, else the last one. */ export declare function attachIndexMarks(blocks: ContentBlock[], marks: readonly PendingMark[]): void; /** Map every source offset of a parse result from the stripped text back * to the original markdown. */ export declare function remapParseOffsets(result: { blocks: ContentBlock[]; issues: ParseIssue[]; }, toOriginal: (offset: number) => number): void; export {}; //# sourceMappingURL=indexMarks.d.ts.map