import { UserError } from "../../toolcraft/dist/index.js"; import type { OpenApiDocument } from "./generate.js"; export interface OpenApiSourceFileSystem { readFile(filePath: string, encoding: BufferEncoding): Promise; } export interface OpenApiSourceServices { cwd: string; fetch: typeof globalThis.fetch; fs: OpenApiSourceFileSystem; } export interface OpenApiHttpSourceOptions { etag?: string; timeoutMs?: number; } export type OpenApiHttpSourceResult = { status: "modified"; sourceText: string; etag?: string; cacheControl?: string; age?: string; } | { status: "not-modified"; etag?: string; cacheControl?: string; age?: string; }; export declare class OpenApiHttpStatusError extends UserError { } export declare class OpenApiTransportError extends UserError { } export declare class OpenApiTimeoutError extends OpenApiTransportError { readonly timeoutMs: number; constructor(message: string, timeoutMs: number, options?: ErrorOptions); } export declare function readOpenApiSourceText(input: string | URL, services: OpenApiSourceServices): Promise; export declare function fetchOpenApiHttpSource(inputUrl: URL, fetch: typeof globalThis.fetch, options?: OpenApiHttpSourceOptions): Promise; export declare function parseOpenApiDocument(sourceText: string, input: string | URL): OpenApiDocument;