/** * One doc page as authored on disk, before any index-specific derivation. Its * URL, version, headings and search text are all derived from these fields, so * everything downstream of the read is pure. */ export type SourcePage = { /** Absolute path to the page file. */ file: string; /** The page's raw markdown, frontmatter included. */ source: string; /** The page's parsed frontmatter, `{}` when it has none. */ frontmatter: Record; /** * The day (`YYYY-MM-DD`) the page last changed. Only {@link withCommitDates} * fills this in, so it is absent on a page list that never went through it. */ lastUpdated?: string; }; /** Whether a filename is a doc page the plugin should index. */ export declare function isPageFile(file: string): boolean; /** * Turn a page's path and raw markdown into a {@link SourcePage}. Pure, and * shared with tests so an in-memory page is built exactly the way a read one is. */ export declare function toPage(file: string, source: string): SourcePage; /** * Read every doc page under `contentDir`. `exists` distinguishes a missing docs * root from an empty one, which the page list alone cannot: both give no pages, * but only one of them is a misconfiguration worth reporting. */ export declare function readSourcePages(contentDir: string): { pages: SourcePage[]; exists: boolean; }; /** * A page's title, when it has one. A page whose frontmatter has no string * `title` is a stub: no index carries it, so nothing is derived for it and * nothing is looked up about it. */ export declare function titleOf(page: SourcePage): string | undefined; /** * Date each page from `dates`, keyed by absolute path, unless it carries its own * frontmatter `lastUpdated`. Archiving copies every page in one commit, so an * archive's pages are written with the date they last really changed and must * keep it. * * Pure: the caller walks git once with {@link commitDates} and hands the result * in. Asking per page cost a process each and was the build's largest single * expense, and doing the walk here would put it behind a function the search and * llms indexes also call, making them pay for a date neither has anywhere to put. * For the same reason this skips untitled pages, which no index carries. */ export declare function withCommitDates(pages: SourcePage[], dates: Map): SourcePage[]; /** * List the absolute paths of every `+page.md`/`+page.svx` under `contentDir`. */ export declare function listPageFiles(contentDir: string): string[];