import type { TelemetryEvent } from './telemetry-types.js'; /** * HTTP client that queues telemetry events and flushes them to the API. * Failures are silent—telemetry should never crash the wizard. */ export declare class TelemetryClient { private events; private flushInFlight; private accessToken; private claimToken; private clientId; private apiKey; private gatewayUrl; setGatewayUrl(url: string): void; setAccessToken(token: string): void; setApiKeyAuth(apiKey: string): void; /** * Set claim-token auth for unclaimed environments. * The API accepts either a JWT (Bearer), claim token * (x-workos-claim-token + x-workos-client-id), or API key * (x-workos-api-key). */ setClaimTokenAuth(clientId: string, claimToken: string): void; queueEvent(event: TelemetryEvent): void; /** * Queue multiple pre-formed events (used by store-forward recovery). */ queueEvents(events: TelemetryEvent[]): void; /** * Flush queued events. Returns true if events were sent or intentionally * dropped (4xx), false if they should be retried (5xx/network error). * Uses splice to only remove the events that were in the snapshot, * protecting any events queued concurrently during the fetch. */ flush(): Promise; private flushInternal; /** * Synchronously write pending events to a file. * Used as last resort in process.on('exit') handler. */ persistToFile(filePath: string): void; } export declare const telemetryClient: TelemetryClient;