import { OpenAPIV3 } from 'openapi-types'; /** Error thrown when an external `$ref` is encountered but not allowed. */ export declare class ExternalRefError extends Error { readonly ref: string; constructor(ref: string); } /** Returns true if a `$ref` string points at an http(s) URL. */ export declare function isExternalHttpRef(ref: unknown): ref is string; export declare function assertNoExternalRefs(node: unknown, seen?: WeakSet): void; /** * Parse and dereference an OpenAPI spec with optional SSRF protection. * * The SSRF protection targets external `$ref`s embedded *inside* the spec, not * the user-supplied input itself: a URL/path passed as the input is trusted * (the user typed it) and must still load. When `allowExternalRefs` is false * (the default) we: * 1. Parse the entry document (http allowed so a URL input is fetched). * 2. Scan the parsed tree and reject any external http(s) `$ref`. * 3. Dereference with the http resolver disabled — safe because step 2 * guaranteed no external refs remain to follow. * * Step 3 dereferences from the ORIGINAL local-path/object input (not the parsed * object) so relative file `$ref`s (e.g. `./schemas.json#/MyType`) resolve * against the spec's directory rather than the process cwd. For URL inputs, * which can't be re-fetched once http is disabled, it dereferences the parsed * object instead (URL specs are single-file or use absolute refs already * rejected in step 2). * * @param input Path, URL, or pre-parsed document * @param allowExternalRefs Permit external http(s) `$ref` resolution * @returns Fully dereferenced OpenAPI v3 document */ export declare function parseSpecSecurely(input: string | OpenAPIV3.Document, allowExternalRefs: boolean): Promise;