import { CacheManager } from "../cachemanager"; export declare const EventQueueType: { HTTP_REQUEST: string; }; export type Subscription = (...data: any) => void; export type EventQueueExecutor = (...params: any) => any; export type EventQueuePreExecutor = (cache: CacheManager, ...params: any) => any[]; export interface Event { date?: Date; type: string; params: any[]; retryIn?: number; subscriptionKey?: string; } export interface IEventQueue { clearSubscriptions(key?: string): void; subscriptions(key?: string): Subscription[]; subscribe(key: string, subscription: Subscription): void; queueEvent(cache: CacheManager, event: Event): string; unSubscribe(key: string, subscription: Subscription): void; execute(cache: CacheManager, type?: string): Promise; queue(cache: CacheManager, type: string, ...params: any[]): string; executeOnly(cache: CacheManager, id: string, type?: string): Promise; } export declare class EventQueue implements IEventQueue { protected static instance: EventQueue; private _ScheduledExecutions; private _Subscriptions; private static _RegisteredExecutors; private static _RegisteredPreExecutors; constructor(); static getInstance(): EventQueue; static executorIsRegistered(type: string): boolean; static registerExecutor(type: string, executor: EventQueueExecutor): void; static unregisterExecutor(type: string): void; static registerPreExecutor(type: string, preExecutor: EventQueuePreExecutor): void; static unregisterPreExecutor(type: string): void; queueEvent(cache: CacheManager, event: Event, key?: string): string; queue(cache: CacheManager, type: string, ...params: any[]): string; executeOnly(cache: CacheManager, id: string, type?: string): Promise; execute(cache: CacheManager, type?: string): Promise; subscribe(key: string, subscription: Subscription): void; unSubscribe(key: string, subscription: Subscription): void; report(key: string, ...data: any): void; subscriptions(key?: string): Subscription[]; clearSubscriptions(key?: string): void; private _generateId; private _buildId; }