/**
 * Creates a configured openapi-fetch client with auth, error handling,
 * and retry middleware.
 *
 * Supports custom `fetch` for BFF proxy patterns (e.g., developer-console
 * routing through Next.js API routes).
 */
import createClientImport, { type HeadersOptions } from 'openapi-fetch';
import type { paths } from '../generated/api.js';
import { parseRateLimitHeaders } from './rate-limit.js';
import { type AmigoRequestOptions } from './request-options.js';
import { type RetryOptions } from './retry.js';
declare const createClient: typeof createClientImport;
export type PlatformFetch = ReturnType<typeof createClient<paths>>;
export interface RequestHookContext {
    id: string;
    request: Request;
    schemaPath: string;
}
export interface ResponseHookContext extends RequestHookContext {
    response: Response;
    requestId: string | null;
    rateLimit: ReturnType<typeof parseRateLimitHeaders>;
}
export interface ErrorHookContext extends RequestHookContext {
    error: unknown;
}
export interface ClientHooks {
    onRequest?: (context: RequestHookContext) => void | Promise<void>;
    onResponse?: (context: ResponseHookContext) => void | Promise<void>;
    onError?: (context: ErrorHookContext) => void | Promise<void>;
}
export interface ClientConfig {
    apiKey: string;
    baseUrl: string;
    retry?: RetryOptions;
    maxRetries?: number;
    timeout?: number;
    headers?: HeadersOptions;
    hooks?: ClientHooks;
    /** Custom fetch implementation — use for BFF proxy routing or test mocking. */
    fetch?: typeof globalThis.fetch;
}
export declare function createPlatformClient(config: ClientConfig): PlatformFetch;
export declare function applyPlatformRequestOptions<Operation>(client: PlatformFetch, init: AmigoRequestOptions<Operation> | undefined): AmigoRequestOptions<Operation> | undefined;
export {};
//# sourceMappingURL=openapi-client.d.ts.map