import { D as DocumentReader, S as SyncDocumentReader, R as ResolvedSpec } from './resolver-DHYHw6oK.cjs'; export { a as ResolveSpecOptions, c as composeReaders, b as createFileReader, d as createHttpReader, e as createMemoryReader, r as resolveSpec } from './resolver-DHYHw6oK.cjs'; import { S as SpecOverlay } from './overlay-DCyY1H00.cjs'; export { M as ModifyOperationsEntry, a as ModifyParametersEntry, O as OperationOverride, b as OperationWhere, P as ParameterWhere, c as PathOverride, R as ResponseOverride, d as applyOverlays, i as isSpecOverlay, s as specOverlayVerbs } from './overlay-DCyY1H00.cjs'; export { S as SpecHygieneIssue, l as lintResolvedSpec } from './lint-fVgIO4pF.cjs'; export { r as resolveJsonPointer } from './json-pointer-BeL6jfns.cjs'; import './types-Dzi0PpYX.cjs'; /** * Options accepted by {@link loadSpec}. * * @public */ interface LoadSpecOptions { /** Reader used to fetch documents by URI. */ reader: DocumentReader; /** Entry URI. */ entry: string; /** Base directory/URI for resolving relative refs. Defaults to the entry's directory. */ baseUri?: string; /** Overlays to apply in order after resolution. */ overlays?: readonly SpecOverlay[]; /** * Run spec-hygiene lint passes against the post-overlay document. * Findings land in {@link ResolvedSpec.specHygieneIssues}. Defaults * to `false`. */ lint?: boolean; } /** * Load, resolve, and (optionally) overlay an OpenAPI spec in the one * step. Runs `resolveSpec` to inline external `$ref`s, then applies * each overlay in order to the resolved document. * * This is the recommended entrypoint for consumers; use * {@link resolveSpec} and {@link applyOverlays} directly only when you * need a custom composition. * * @example * ```ts * const reader = composeReaders([createFileReader()]); * const { document } = await loadSpec({ reader, entry: "openapi.yaml", overlays }); * const validator = createValidator(document); * ``` * * @public */ declare function loadSpec(options: LoadSpecOptions): Promise; /** * Options accepted by {@link loadSpecSync}. * * Mirror of {@link LoadSpecOptions} with one deliberate divergence: * `reader` is optional. The async {@link loadSpec} requires a reader * because composing readers (file / HTTP / memory / YAML) is a * first-class part of its multi-runtime story. The sync loader serves * one runtime (boot-time Node reading local files), so it defaults its * reader and keeps the sync reader-composition primitives out of the * public surface. `reader` is the additive seam: pass a * {@link SyncDocumentReader}-shaped `{ read, canRead }` object to plug * in a custom sync source without any extra import. * * @public */ interface LoadSpecSyncOptions { /** Entry URI. */ entry: string; /** * Synchronous reader. Defaults to a JSON-only filesystem reader * ({@link createFileReaderSync}). The batteries-included `oav` * distribution ships a `loadSpecSync` whose default also reads YAML. */ reader?: SyncDocumentReader; /** Base directory/URI for resolving relative refs. Defaults to the entry's directory. */ baseUri?: string; /** Overlays to apply in order after resolution. */ overlays?: readonly SpecOverlay[]; /** * Run spec-hygiene lint passes against the post-overlay document. * Findings land in {@link ResolvedSpec.specHygieneIssues}. Defaults * to `false`. */ lint?: boolean; } /** * Synchronous mirror of {@link loadSpec}: resolve external `$ref`s, * apply overlays, then (optionally) lint, returning a * {@link ResolvedSpec} directly instead of a `Promise`. Runs the * identical pipeline as {@link loadSpec} with the identical result * shape; the lint pass is deferred to after overlays for the same * reason (overlays change reachability). * * For load-once-at-boot programs and CLIs that build their validator * inside a synchronous bootstrap and can't await. Blocking by * construction (filesystem reads via `readFileSync`); for boot-time / * CLI use, not per-request. For non-blocking contexts the async * {@link loadSpec} stays the right tool. An unreadable or malformed * spec throws (mirroring {@link loadSpec}); a caller that wants * "unreadable spec disables validation rather than crashing boot" * expresses that with its own `try`/`catch`. * * @example * ```ts * // JSON specs (oav-core). For YAML, use oav's loadSpecSync. * const { document } = loadSpecSync({ entry: "openapi.json" }); * const validator = createValidator(document); * ``` * * @public */ declare function loadSpecSync(options: LoadSpecSyncOptions): ResolvedSpec; export { DocumentReader, type LoadSpecOptions, type LoadSpecSyncOptions, ResolvedSpec, SpecOverlay, loadSpec, loadSpecSync };