export interface BatchedUploader { enqueue(event: T): void; /** Drain hook for tests and orderly host shutdown; a turn never awaits it. */ flush(): Promise; } export interface BatchedUploaderOptions { /** The console API path this stream POSTs to. */ path: string; /** The verb, when the route is not a POST (the config report PUTs a whole * document rather than appending to a stream). */ method?: string; /** ADAPTER RULE: the key and base URL arrive from the composition seam. The * uploader never reads the environment for either. */ cloud: { apiKey: string; baseUrl?: string; }; /** The request body for one batch. Resolved INSIDE the retry loop, so a * failure to build it costs a retry rather than the whole batch. */ body: (events: T[]) => Promise | unknown; /** Is this a real answer? A `false` retries the batch like a transport * failure — a 200 carrying something we cannot read is not a delivery. */ accept: (response: unknown) => boolean; /** The console telling this deployment to stop talking. Checked BEFORE * `accept`, and it ends the stream for the rest of the process lifetime: * the queue is dropped and nothing is ever sent again. */ stop?: (response: unknown) => boolean; fetchImpl?: typeof fetch; batchSize?: number; queueLimit?: number; batchDelayMs?: number; requestTimeoutMs?: number; retryDelaysMs?: readonly number[]; } export declare function createBatchedUploader(options: BatchedUploaderOptions): BatchedUploader;