export interface CollectionDefinition { /** Schema for frontmatter validation (zod schema or plain function). */ schema?: unknown; } export interface ContentEntry> { /** Collection name, e.g. "blog". */ collection: string; /** Entry slug (filename without `.md`), e.g. "hello-world". */ slug: string; /** Parsed and validated frontmatter. */ data: TData; /** Raw Markdown body (not yet rendered to HTML). */ body: string; /** Rendered HTML body (lazily computed via `renderHTML()`). */ html?: string; /** Absolute path to the source `.md` file. */ filePath: string; } /** * Defines a collection with an optional schema. Used in `src/content/config.ts`. */ export declare function defineCollection(def: CollectionDefinition): CollectionDefinition; /** Type for the `collections` export from `src/content/config.ts`. */ export type CollectionsConfig = Record; /** * Sets the root directory for content. Called by the Vite plugin / CLI on * startup so `getCollection` knows where to find `src/content/`. */ export declare function setContentRoot(root: string): void; /** * Runs a function with a per-request content root (plan §11.4). * This prevents global state leakage between concurrent requests. */ export declare function withContentRoot(root: string, fn: () => T): T; /** * Clears the in-memory cache for all collections. Called by the HMR handler * when a `.md` file changes. */ export declare function clearContentCache(): void; /** * Returns all entries in a collection. * * @param name Collection name (directory under `src/content/`). * * Per plan §11.4: collection names are validated for containment — no * path traversal or escape from the content root is allowed. */ export declare function getCollection>(name: string): Promise[]>; /** * Returns a single entry by slug, or `undefined` if not found. * * @param collection Collection name. * @param slug Entry slug (filename without `.md`). */ export declare function getEntry>(collection: string, slug: string): Promise | undefined>; /** * Returns multiple entries by slug. * * @param collection Collection name. * @param slugs Array of slugs. */ export declare function getEntries>(collection: string, slugs: string[]): Promise[]>; /** * Renders the Markdown body of an entry to HTML. The result is cached on the * entry object so repeated calls don't re-render. * * @throws If `marked` is not installed. */ export declare function renderEntryHTML(entry: ContentEntry): Promise;