import { BaseHelper } from '../../base/base.helper'; import { ValueOf, ValueOrPromise } from '../../common/types'; export declare class QueueStatuses { static readonly WAITING = "000_WAITING"; static readonly PROCESSING = "100_PROCESSING"; static readonly LOCKED = "200_LOCKED"; static readonly SETTLED = "300_SETTLED"; static readonly SCHEME_SET: Set; static isValid(scheme: string): boolean; } export type TQueueStatus = ValueOf>; export type TQueueElement = { isLocked: boolean; payload: T; }; interface IQueueCallback { autoDispatch?: boolean; onMessage?: (opts: { identifier: string; queueElement: TQueueElement; }) => ValueOrPromise; onDataEnqueue?: (opts: { identifier: string; queueElement: TQueueElement; }) => ValueOrPromise; onDataDequeue?: (opts: { identifier: string; queueElement: TQueueElement; }) => ValueOrPromise; onStateChange?: (opts: { identifier: string; from: TQueueStatus; to: TQueueStatus; }) => ValueOrPromise; } export declare class QueueHelper extends BaseHelper { storage: Array>; protected processingEvents: Set>; protected generator: Generator; protected totalEvent: number; protected autoDispatch: boolean; protected state: TQueueStatus; protected isSettleRequested: boolean; private onMessage?; private onDataEnqueue?; private onDataDequeue?; private onStateChange?; constructor(opts: IQueueCallback & { identifier: string; }); protected handleMessage(): Promise; private _messageListener; nextMessage(): void; enqueue(payload: TElementPayload): Promise; dequeue(): TQueueElement; lock(): void; unlock(opts: { shouldProcessNextElement?: boolean; }): void; settle(): void; isSettled(): boolean; close(): void; getElementAt(position: number): TQueueElement; getState(): TQueueStatus; getTotalEvent(): number; getProcessingEvents(): Set>; } export {}; //# sourceMappingURL=queue.helper.d.ts.map