import { type OpenApiSourceFileSystem } from "./spec-source.js"; import type { OpenApiDocument } from "./generate.js"; export declare const DEFAULT_OPENAPI_FETCH_TIMEOUT_MS = 3000; export declare const DEFAULT_OPENAPI_CACHE_MAX_AGE_MS: number; export interface OpenApiSpecCacheOptions { directory?: string; maxAgeMs?: number; onFallback?: (message: string) => void | Promise; } export interface LoadCachedOpenApiSourceOptions { cache: false | OpenApiSpecCacheOptions; fetch: typeof globalThis.fetch; fs: OpenApiSpecCacheFileSystem; onTimeout?: (context: OpenApiTimeoutContext) => void | Promise; timeoutMs?: number; } export interface OpenApiTimeoutContext { source: string; timeoutMs: number; usingCachedDocument: boolean; } export interface OpenApiSpecCacheFileSystem extends OpenApiSourceFileSystem { writeFile?(filePath: string, contents: string, options?: { encoding?: BufferEncoding; flag?: string; mode?: number; }): Promise; rename?(fromPath: string, toPath: string): Promise; mkdir?(directoryPath: string, options?: { recursive?: boolean; mode?: number; }): Promise; unlink?(filePath: string): Promise; realpath?(filePath: string): Promise; } export interface LoadedOpenApiSource { sourceText: string; document: OpenApiDocument; commit?: () => Promise; } export declare function loadCachedOpenApiSource(inputUrl: URL, options: LoadCachedOpenApiSourceOptions): Promise;