/**
 * Base HTTP Client
 *
 * Shared request logic for IndexerClient and AuthClient.
 * Includes automatic retry with exponential backoff for transient failures.
 */
export declare class ApiError extends Error {
    readonly status: number;
    readonly body?: string | undefined;
    constructor(message: string, status: number, body?: string | undefined);
    /** Whether this error is retryable based on HTTP status or error type. */
    get retryable(): boolean;
    /** Extract retry_after_ms hint from server error response, if present. */
    get retryAfterMs(): number | undefined;
}
/** Retry configuration for API requests. */
export interface RetryConfig {
    /** Maximum number of retry attempts. 0 means no retries. Default: 3. */
    maxRetries: number;
    /** Base delay in ms. Actual delay uses exponential backoff. Default: 200. */
    baseDelayMs: number;
    /** Maximum delay in ms (caps exponential growth). Default: 10000. */
    maxDelayMs: number;
}
/**
 * Proxy function signature: routes requests through iframe WASM encryption.
 * When set, BaseClient skips direct fetch() and delegates to this function.
 */
export type HttpProxyFn = (path: string, method: string, body?: unknown, query?: unknown, baseUrl?: string, authToken?: string | null) => Promise<unknown>;
export declare class BaseClient {
    protected readonly baseUrl: string;
    protected readonly getToken: () => string | null;
    private _proxyFetch;
    private _retryConfig;
    constructor(baseUrl: string, getToken: () => string | null);
    /**
     * Set an HTTP proxy function. When set, all requests are routed through
     * the proxy instead of direct fetch(). Used in iframe mode to route
     * requests through the WASM encryption layer.
     */
    setProxy(proxyFetch: HttpProxyFn): void;
    /** Override the default retry configuration. */
    setRetryConfig(config: Partial<RetryConfig>): void;
    protected request<T>(path: string, options?: RequestInit): Promise<T>;
    /** Execute a direct fetch with automatic retry for retryable errors. */
    private fetchWithRetry;
    /** Single-attempt direct fetch (no retry). */
    private directFetch;
    /**
     * Route a request through the iframe proxy.
     * The proxy goes through WASM EncryptedHttpClient which handles encryption.
     * Retry is handled by the Rust HttpClient, so no retry here.
     */
    private proxyRequest;
}
//# sourceMappingURL=base-client.d.ts.map