import type { DurableOperationQueue } from './queue';
import type { QueueOperationHandler, QueueRunResult } from './types';
export interface DurableQueueWorkerOptions {
    parallelism?: number;
    pollIntervalMs?: number;
    onResult?: (result: QueueRunResult) => void;
    onError?: (error: unknown) => void;
}
/**
 * Runs a fixed number of durable polling lanes. The database queue remains the
 * source of truth for claims, resource locks, and per-scope concurrency.
 */
export declare class DurableQueueWorker {
    private readonly queue;
    private readonly handlers;
    private readonly parallelism;
    private readonly pollIntervalMs;
    private readonly onResult?;
    private readonly onError?;
    private readonly waits;
    private lanes;
    private running;
    constructor(queue: DurableOperationQueue, handlers: Record<string, QueueOperationHandler>, options?: DurableQueueWorkerOptions);
    get active(): boolean;
    start(): this;
    stop(): void;
    settled(): Promise<void>;
    /** Execute all currently claimable work, using the configured lane bound. */
    drain(): Promise<QueueRunResult[]>;
    private wait;
    private runLane;
}
