import type { OperationRecord, OperationStore, OperationStoreFilter, OperationStoreStats } from '../types/operations.js'; /** * Queue counting shared by every operation store, kept apart from the stores themselves so a store * that uses it — Redis, say — does not also carry the in-memory one. */ /** Whether a record is queued and no worker holds a live lease on it. */ export declare function isUnheldQueued(record: OperationRecord, now: string): boolean; /** Whether a record passes a store filter. */ export declare function matchesFilter(record: OperationRecord, filter?: OperationStoreFilter): boolean; /** Counts records by status, the oldest queued one, and lapsed leases. */ export declare function countRecords(records: Iterable>, now: string, filter?: OperationStoreFilter): OperationStoreStats; /** * Counts what an operation store holds: records by status, the oldest queued one, and running * records whose lease has lapsed. Uses the store's own `stats()` when it has one, and counts * `list()` otherwise. A store with neither reports nothing. */ export declare function operationStats(store: Pick, 'stats' | 'list'>, options?: OperationStoreFilter & { now?: Date; }): Promise;