import { MarkdownTarget } from '../config/config'; import { DocumentTarget } from './specAdapters'; export type { DocumentTarget }; export interface LlmsTxtLink { label: string; url: string; description?: string; } export interface LlmsTxtOptions { /** * Absolute base URL of the docs site, e.g. `"https://docs.acme.com"`. Used * to build a default URL per entry; ignore it entirely by passing `url`. */ baseUrl?: string; /** * The URL serving an entry as Markdown. Return `null` to leave an entry out * of the index. Defaults to `${baseUrl}/${slug}.md`, which is a guess at * your routes: pass this whenever they differ, which is most of the time. */ url?: (entry: DocumentTarget) => string | null | undefined; /** Overrides the document's own `info.title`. */ title?: string; /** Overrides the document's own `info.description`. */ summary?: string; /** * Extra links for the trailing "Optional" section: the source spec, a * changelog, a support page. Serving the raw spec here (e.g. * `https://docs.acme.com/openapi.yaml`) is worth doing, since an agent can * consume it directly instead of reading prose. */ optional?: LlmsTxtLink[]; } /** URL-safe slug from a target key: `"get /pets/{petId}"` to `"get-pets-petid"`. */ export declare function targetSlug(key: string): string; /** * Every linkable item in a document: OpenAPI endpoints, AsyncAPI operations. * Each carries the `target` to hand `documentToMarkdown`, so generating a file * per entry is a loop over this list. */ export declare function listDocumentTargets(document: unknown): DocumentTarget[]; /** * Serializes a document to Markdown. Pass a `target` from * `listDocumentTargets` for a single endpoint/operation, or omit it for the * whole document. */ export declare function documentToMarkdown(document: unknown, target?: MarkdownTarget): string; /** * Builds an `llms.txt` index for a document, in the llmstxt.org format: an H1 * name, a blockquote summary, then one described link per endpoint/operation. */ export declare function documentToLlmsTxt(document: unknown, options?: LlmsTxtOptions): string;