interface PeopleEvent { type: string; timestamp: number; payload: Record; } interface Event { name: string; payload: Record; timestamp: number; } /** * Creates batches of events, then sends them at intervals. */ declare class Batcher { private readonly backendUrl; private readonly getToken; private readonly init; private readonly standalone; private readonly autosendInterval; private readonly retryTimeout; private readonly retryLimit; private readonly apiEdp; private batch; private intervalId; private stopped; constructor(backendUrl: string, getToken: () => string | null, init: () => Promise, standalone: boolean); getBatches(): { data: { user_actions: PeopleEvent[]; events: Event[]; }; }; addEvent(event: any): void; sendImmediately(event: any): void; /** * * Essentially we're dividing the batch by identify events and squash all same category events into one in each part, * taking priority to the last one */ dedupePeopleEvents(): PeopleEvent[]; private squashPeopleEvents; private sendBatch; private paused; private onVisibilityChange; startAutosend(): void; flush(): void; stop(): void; restart(): void; } export default Batcher;