import { MarkdownTarget } from '../config/config'; /** One linkable item in a document: an OpenAPI endpoint, an AsyncAPI operation, ... */ export interface DocumentTarget { /** Stable identifier, unique within the document. `"get /pets"`, `"sendLightMeasurement"`. */ key: string; /** Human-readable label for a link or heading. `"GET /pets"`. */ label: string; /** The document's own one-line summary for this item, when it has one. */ summary?: string; /** Passed to `documentToMarkdown`, and the same shape `config.markdown.url` receives. */ target: MarkdownTarget; } interface SpecAdapter { /** Spec name, used in error messages. */ name: string; /** Whether this adapter handles the document, sniffed from its version key. */ matches: (doc: Record) => boolean; /** What the linkable items are called collectively, e.g. "Endpoints". */ sectionTitle: string; title: (doc: unknown) => string; summary: (doc: unknown) => string | undefined; targets: (doc: unknown) => DocumentTarget[]; toMarkdown: (doc: unknown, target?: MarkdownTarget) => string; } /** * Picks the adapter for a document by sniffing its version key (`openapi`, * `swagger`, `asyncapi`), the same discriminant the renderers use to choose a * component. Throws rather than guessing: silently treating an unrecognized * document as one spec would emit confidently wrong output. */ export declare function adapterFor(document: unknown): SpecAdapter; export {};