import { AgioEvent } from '@multimodal/agio'; /** * Options for configuring the AgioBatchProcessor. */ export interface AgioBatchProcessorOptions { /** * The URL of the AGIO provider endpoint. */ providerUrl: string; /** * The maximum number of events to buffer before sending a batch. * @default 20 */ maxBatchSize?: number; /** * The maximum time in milliseconds to wait before sending a batch. * @default 5000 */ flushInterval?: number; /** * The timeout for the fetch request in milliseconds. * @default 5000 */ requestTimeout?: number; } /** * AgioBatchProcessor handles batching and sending of AGIO events. * * It collects events in a buffer and sends them periodically or when the * buffer reaches a certain size, improving performance by reducing the number of * HTTP requests. */ export declare class AgioBatchProcessor { private readonly providerUrl; private readonly maxBatchSize; private readonly flushInterval; private readonly requestTimeout; private eventBuffer; private timer; constructor(options: AgioBatchProcessorOptions); /** * Adds an event to the buffer. * If the buffer reaches maxBatchSize, it will be flushed immediately. * @param event The AGIO event to add. */ addEvent(event: AgioEvent.ExtendedEvent): void; /** * Manually triggers a flush of the event buffer. * This is useful for ensuring all events are sent, e.g., on application shutdown. */ flush(): Promise; /** * Schedules a flush if one isn't already scheduled. */ private scheduleFlush; /** * Clears any scheduled flush. */ private clearScheduledFlush; } //# sourceMappingURL=AgioBatchProcessor.d.ts.map