export type TelemetryUploaderParams = { sdkKey: string; telemetryUrl?: string; /** * Active domain used to derive the default telemetryUrl when omitted. * See `InitOptions.domain` for resolution order. */ domain?: string; /** Per-POST deadline (ms) for {@link TelemetryUploader.post}. Defaults to 10s. */ timeout?: number; clientVersion: string; }; /** What the transport needs from a telemetry response. */ export interface TelemetryHttpResult { status: number; /** The Retry-After header, when the response carried one the page can read. */ retryAfter?: string; /** First 1024 chars of the body, read only for a rejected (non-retryable 4xx) status. */ bodySnippet: string; } /** A telemetry POST that got no HTTP response. */ export declare class TelemetryRequestError extends Error { readonly reason: "timeout" | "aborted" | "network"; readonly cause: unknown; constructor(reason: "timeout" | "aborted" | "network", cause?: unknown); } export default class TelemetryUploader { sdkKey: string; telemetryUrl: string; timeout: number; clientVersion: string; constructor({ sdkKey, telemetryUrl, domain, timeout, clientVersion }: TelemetryUploaderParams); /** * @deprecated No-op. Every request owns its own deadline timer now, so there * is no shared timer to clear. */ clearAbortTimeout(): void; postUrl(): string; /** * POST one serialized batch. Each call owns its AbortController and its * deadline timer (set before fetch, cleared in `finally`), so concurrent * calls never share or clear each other's timer and no timer outlives the * request. Resolves with the HTTP status for every response; rejects with a * {@link TelemetryRequestError} (timeout, aborted, network) when there is * none. The deadline is a timer + AbortController rather than * `AbortSignal.timeout` so it runs on the page's (or a test's) timers. */ send(body: string, opts: { timeoutMs: number; signal?: AbortSignal; keepalive?: boolean; }): Promise; /** * Post telemetry data to the telemetry endpoint (one-off, outside the * reporter's retained queue). Resolves with the response JSON on 2xx or the * status code otherwise; rejects on a timeout or network error. * * @deprecated The SDK sends telemetry through its reporter; kept for callers * of the `telemetryUploader` accessor. */ post(data: any): Promise; }