import { ApiClient } from '../utils/api'; import { AuthService } from './AuthService'; /** Options accepted by the TelemetryService constructor */ interface TelemetryOptions { apiClient: ApiClient; authService: AuthService; flushIntervalMs?: number; maxBatchSize?: number; } /** * TelemetryService * ---------------- * • Local in‑memory queue with offline persistence (localStorage). * • Batching + optional immediate flush when batchSize reached. * • Exponential back‑off retry (1 s → 60 s). * • Automatic context injection (sessionId, build, platform, locale, userId). */ export declare class TelemetryService { private apiClient; private authService; private flushIntervalMs; private maxBatchSize; private queue; private timer; private backoff; private readonly MAX_BACKOFF; constructor(opts: TelemetryOptions); /** Begins the periodic flush timer */ start(): Promise; /** Track an arbitrary event */ track>(name: string, payload: EventPayload, options?: { flushImmediately?: boolean; }): void; /** Sends all queued events to the backend with retry/back‑off */ flush(): Promise; /** Persist unsent events to localStorage (basic offline buffer) */ private persistQueue; /** Load events persisted while offline */ private loadPersistedQueue; /** Guess build string from global or fallback */ private detectBuild; /** Basic platform detection (browser / node target) */ private detectPlatform; } export {}; //# sourceMappingURL=TelemetryService.d.ts.map