import type { Span } from "./recursive.js"; /** Where a chunk came from, for citations. */ export interface ChunkLocation { /** First page of the chunk (1-based), for paged sources such as PDF. */ page?: number; /** Last page, when the chunk crosses a page break. */ pageEnd?: number; /** Markdown heading path, e.g. "Policies > Refunds". */ section?: string; } export interface SourceLayout { /** Unit offset at which each page starts. */ pageStarts?: number[]; /** Unit offset and heading path of each markdown heading, in order. */ headings?: { start: number; section: string; }[]; } /** Page start offsets for text that is the pages joined with whitespace. */ export declare function pageStarts(pages: string[]): number[]; /** ATX headings outside fenced code blocks, each with its full heading path. */ export declare function markdownHeadings(text: string): { start: number; section: string; }[]; /** * Page range and section of a chunk covering units [start, end). The section * is the heading in effect where the chunk starts, or else the first heading * inside the chunk. */ export declare function chunkLocation(layout: SourceLayout, span: Span): ChunkLocation;