import type { OpenAPIComponents, RefCache } from "./types.js"; export declare class CircularReferenceError extends Error { constructor(ref: string); } export declare class MissingReferenceError extends Error { constructor(ref: string); } /** * Resolves a reference string to its corresponding object in the OpenAPI components. * * @param ref - The reference string to resolve (e.g., "#/components/schemas/Pet") * @param components - The OpenAPI components object containing all definitions * @param refStack - Set to track reference paths for circular reference detection * @param cache - Map to cache resolved references for better performance * @returns The resolved object from the components * @throws {CircularReferenceError} When a circular reference is detected * @throws {MissingReferenceError} When the referenced object cannot be found */ export declare function resolveRef(ref: string, components: OpenAPIComponents, refStack?: Set, cache?: RefCache): unknown; /** * Dereferences all $ref properties in an OpenAPI schema object, replacing them with their actual values. * Handles nested objects and arrays recursively. * * @param obj - The object to dereference, as of writing this is an OpenAPI operation * @param components - The OpenAPI components object containing all definitions * @param refStack - Set to track reference paths for circular reference detection * @param cache - Map to cache resolved references for better performance * @returns A new object with all references resolved * @template T - The type of the input object */ export declare function dereferenceSchema(obj: T, components: OpenAPIComponents, refStack?: Set, cache?: RefCache): T;