/** * Configuration for creating an API client. */ export interface ClientConfig { /** Base URL for all requests. Can be a string or a function returning a string. */ baseUrl: string | (() => string); /** Default headers to include in every request. */ headers?: Record; /** Default request timeout in seconds. */ timeout?: number; /** Custom fetch implementation (defaults to global fetch). */ fetch?: typeof fetch; } /** * Configuration for a single HTTP request. */ export interface HttpRequestConfig { /** HTTP method (GET, POST, PUT, DELETE, PATCH, etc.) */ method: string; /** URL path (will be appended to baseUrl). */ url: string; /** Query parameters. */ query?: Record; /** Request headers (merged with default headers). */ headers?: Record; /** Request body (will be JSON-serialized if not a string or FormData). */ body?: unknown; /** AbortSignal for request cancellation. */ signal?: AbortSignal; /** Expected response type. */ responseType?: 'json' | 'text' | 'blob'; } /** * API client for making HTTP requests. */ export interface ApiClient { /** Execute an HTTP request and return the parsed response. */ request(config: HttpRequestConfig): Promise; } /** * Creates an API client with the given configuration. * @param config Client configuration including base URL and optional defaults. * @returns An ApiClient instance for making HTTP requests. */ export declare function createClient(config: ClientConfig): ApiClient; /** * Returns a lazily-initialized default API client. * Reads the base URL from the METAENGINE_API_URL environment variable. * @returns The default ApiClient instance. */ export declare function getDefaultClient(): ApiClient; //# sourceMappingURL=client.d.ts.map