import type { Client } from "./client.js"; import type { IngestResult } from "./protocol.js"; interface RetryConfig { maxRetries: number; initialBackoffMs: number; maxBackoffMs: number; } export declare class IngestStreamBuilder { private readonly client; private readonly statement; private currentBatchBytes; private currentFlushIntervalMs; private currentChannelCapacity; private currentMaxPendingBytes; private currentRetry; constructor(client: Client, statement: string); batchBytes(batchBytes: number): this; flushInterval(flushIntervalMs: number): this; channelCapacity(channelCapacity: number): this; maxPendingBytes(maxPendingBytes: number): this; maxRetries(maxRetries: number): this; initialBackoff(initialBackoffMs: number): this; maxBackoff(maxBackoffMs: number): this; build(): IngestStream; } export declare class IngestStream { private readonly client; private readonly statement; private readonly batchBytes; private readonly flushIntervalMs; private readonly retry; private fatal; private readonly queue; private readonly pendingBytes; private readonly task; constructor(client: Client, statement: string, batchBytes: number, flushIntervalMs: number, channelCapacity: number, maxPendingBytes: number, retry: RetryConfig); /** Enqueues a single record for batched ingestion. Blocks when backpressure is applied. */ send(record: unknown): Promise; /** * Flushes any buffered records to the server immediately, without closing the stream. * * This is an optional checkpoint operation. You do NOT need to call `flush()` * before `shutdown()` — `shutdown()` already flushes remaining records before closing. * * Returns the ingest result for the flushed batch, or `null` if there was nothing to flush. */ flush(): Promise; /** * Flushes any remaining buffered records and shuts down the stream. * * Always call `shutdown()` when you are done sending records. It automatically * flushes whatever is still in the buffer — you do not need to call `flush()` first. * * Returns the ingest result for the final batch, or `null` if there were no pending records. */ shutdown(): Promise; private runWorker; private flushPending; private mergeQueuedRecords; private setFatal; private drainQueued; private checkFatal; private closedOrFatalError; private mapPendingBytesError; } export {}; //# sourceMappingURL=ingest-stream.d.ts.map