export type BatchFn = (keys: K[]) => Promise; export interface CallBundlerOptions { maxBatchSize?: number; debounceMs?: number; maxConcurrentBatches?: number; } /** * Creates a load function that bundles individual calls within the same * debounce window into a single batch invocation. */ export declare function createCallBundler(batchFn: BatchFn, options?: CallBundlerOptions): (key: K) => Promise; /** * Wraps a batch function `(keys: K[]) => Promise` into a function with the * same signature, where keys from concurrent calls within the same debounce * window are merged into a single batch invocation. All callers receive the same * result. */ export declare function createBundledCall(batchFn: (keys: K[]) => Promise, options?: CallBundlerOptions): (keys: K[]) => Promise; export declare class CallBundler { private batchFn; private maxBatchSize; private debounceMs; private maxConcurrentBatches; private queue; private scheduled; private activeBatchCount; constructor(batchFn: BatchFn, options?: CallBundlerOptions); load(key: K): Promise; private scheduleDispatch; private drainQueue; private dispatchBatch; } //# sourceMappingURL=callBundler.d.ts.map