import { type RpcTarget } from './errors.js'; import { type JsonObject } from './shape.js'; export type FetchLike = (url: string, init: RequestInit) => Promise; export interface DepotClientOptions { readonly token: string; readonly apiUrl: string; readonly orgId?: string | undefined; readonly fetch?: FetchLike | undefined; readonly sleep?: ((ms: number) => Promise) | undefined; /** Clock, injectable so the deadline can be tested without waiting. */ readonly now?: (() => number) | undefined; readonly maxAttempts?: number | undefined; readonly requestTimeoutMs?: number | undefined; /** Upper bound on one `call()`, retries and backoff included. */ readonly callDeadlineMs?: number | undefined; readonly maxResponseBytes?: number | undefined; } export declare const DEFAULT_CALL_DEADLINE_MS = 40000; /** Depot's largest legitimate responses (a full log page) are well under 1 MiB. */ export declare const DEFAULT_MAX_RESPONSE_BYTES: number; export declare function backoffMs(attempt: number, error: unknown): number; /** A request payload: a JSON object for the JSON binding, or encoded bytes for the binary one. */ export type RpcPayload = JsonObject | Uint8Array; /** * Minimal client for Depot's Connect JSON binding: every unary RPC is * `POST //` with a JSON body. */ export declare class DepotClient { private readonly token; private readonly baseUrl; private readonly orgId; private readonly fetchImpl; private readonly sleep; private readonly now; private readonly maxAttempts; private readonly requestTimeoutMs; private readonly callDeadlineMs; private readonly maxResponseBytes; constructor(options: DepotClientOptions); call(target: RpcTarget, request?: JsonObject): Promise; /** * Sends an already-encoded protobuf request. Depot answers in kind (`application/proto`), in * which case the raw bytes come back for the caller to decode; a JSON body (which the test * harness and any proxy may return) is parsed and returned as an object. */ callBinary(target: RpcTarget, request: Uint8Array): Promise; private execute; private headers; private transportError; private attempt; } //# sourceMappingURL=client.d.ts.map