import type { TelemetryEvent, TelemetryOptions } from './types'; /** * In-memory batching client that ships `TelemetryEvent` objects to an * Arcis dashboard server. * * Design rules (spec/API_SPEC.md §9): * 1. `record()` is synchronous and never throws — safe to call from hot paths. * 2. Flushes trigger on batchSize OR flushIntervalMs, whichever comes first. * 3. Network errors are fail-open: they call `onError` (if provided) and * drop the batch. No retry, no disk persistence, no backpressure. * 4. `close()` attempts one final flush; safe to call multiple times. * 5. Interval timer uses `unref()` so it never holds the process open. */ export declare class TelemetryClient { private queue; private readonly endpoint; private readonly apiKey; private readonly workspaceId; private readonly batchSize; private readonly flushIntervalMs; private readonly maxQueueSize; private readonly onError; private readonly onQueueOverflow; private timer; private flushing; private closed; private signalHandler; private droppedSinceLastFlush; constructor(options: TelemetryOptions); /** * Enqueue an event. Fast, synchronous, cannot throw. * Triggers a flush if the queue has reached `batchSize`. */ record(event: TelemetryEvent): void; /** * Manually flush the queue. Pulls up to `batchSize` events into a batch and * POSTs them. Returns a resolved promise on success OR on handled failure. * Never throws. */ flush(): Promise; /** * Shut down: stop the interval timer and attempt one final flush. * Safe to call multiple times. */ close(): Promise; /** * Register `SIGTERM` / `SIGINT` handlers that call `close()` to drain * the queue on graceful shutdown. Opt-in — libraries should not silently * attach global signal handlers. Safe to call multiple times. */ installShutdownHooks(): void; /** Count of events currently waiting to be sent. Useful for tests. */ get pendingCount(): number; private send; private startTimer; private safeNotify; } export declare class TelemetryHttpError extends Error { readonly status: number; readonly responseBody: string; constructor(status: number, responseBody: string); } //# sourceMappingURL=client.d.ts.map