import type { ResolvedConfig } from "../core/schema.ts"; export { normalizeRoute } from "../core/base-path.ts"; /** * Pure resolution of the configured API reference blocks into concrete routes, * labels, and a renderer choice — no file IO, so the content source, the * nav-target validation, the Scalar page generator, and the `blume:openapi` * data module all share one source of truth. Kept free of any Astro/template * imports so `core` can depend on it without a cycle. */ export type ReferenceKind = "openapi" | "asyncapi"; /** Who renders a reference: Blume's own UI, or the embedded Scalar SPA. */ export type ReferenceRenderer = "blume" | "scalar"; /** Per-block display options for the Blume renderer. */ export interface ReferenceDisplay { /** Code-sample languages shown per operation. */ codeSamples: string[]; /** Whether nested schema rows start expanded. */ expandSchemas: boolean; /** * The "Try it" playground: whether operation pages render it, and the CORS * proxy the Send button routes through (`false` off, a URL string, or * `true` for the built-in `/_api-proxy` endpoint). */ playground: { enabled: boolean; proxy: string | boolean; }; } /** A spec source resolved to a concrete route, label, and renderer. */ export interface ReferenceSource { kind: ReferenceKind; renderer: ReferenceRenderer; /** Unique token derived from the route; the `` / data key. */ slug: string; /** Normalized route the reference mounts at, e.g. `/reference`. */ route: string; /** * Site-wide `basePath` the rendered pages are mounted under (`""` when * none). Kept separate from `route` — the content pipeline applies it to * staged entries itself — so consumers prefix only the URLs they emit. */ basePath: string; label: string; /** Whether generated pages are included in llms.txt/llms-full.txt. */ includeInLlms: boolean; /** Whether generated pages are included in site search. */ includeInSearch: boolean; /** Whether generated pages emit noindex metadata and stay out of the sitemap. */ noindex: boolean; /** Local path or `http(s)` URL, verbatim from config. */ spec: string; /** Per-block Scalar theme name override, if any (Scalar renderer only). */ theme?: string; /** * Arbitrary Scalar config forwarded to `` (Scalar renderer * only). Takes precedence over Blume's derived spec/theme config. Typed off * the config schema so the two can never drift. */ scalar?: ResolvedConfig["openapi"]["scalar"]; /** Display options carried through to the Blume renderer. */ display: ReferenceDisplay; /** * Warnings recorded while deduping — another source's route collided with * this one and was dropped. Surfaced as diagnostics when the source loads. */ collisions?: string[]; } /** * Lowercase, hyphen-separated slug: `Add a Pet!` -> `add-a-pet`. Unicode * letters are kept (`Größe` -> `größe`), NFC-normalized so canonically * equivalent spellings (NFD input from macOS tooling) land on one slug. * Non-ASCII slugs rely on the emitter percent-encoding the URL where a raw * URI is required (sitemap, canonical). */ export declare const slugify: (text: string) => string; /** * Resolve every enabled reference. Both blocks honor their `renderer` — * Blume's own UI by default, with the embedded Scalar SPA as the opt-out. */ export declare const resolveReferences: (config: ResolvedConfig) => ReferenceSource[]; /** * Mounted route for every reference, regardless of renderer. References no * longer add a header tab automatically — authors point a `navigation.tabs` * entry at one of these routes to surface it (and, for Blume-rendered specs, to * scope its operations sidebar). These routes are whitelisted as valid nav * targets so such a tab doesn't read as a broken link. */ export declare const referenceRoutes: (config: ResolvedConfig) => string[]; /** Blume-rendered references (both kinds), deduped by route (first wins). */ export declare const blumeReferences: (config: ResolvedConfig) => ReferenceSource[]; /** Whether any reference is Scalar-rendered (gates the `@scalar/astro` dep + pages). */ export declare const hasScalarReferences: (config: ResolvedConfig) => boolean;