import { CancelledAct } from './cancelled'; import { ActEventName, ActExec, ActMasterAction, ActMasterOptions, ActSubscribeType, devActMasterConfig, IActMaster, ListenerFunction } from './types'; export * from './decorators/index'; export * from './errors'; export * from './types'; export { CancelledAct }; /** * */ export declare class ActMaster implements IActMaster { readonly version: string; private readonly _actions; private readonly _watchers; private readonly _listeners; private readonly _inProgressWatchers; private _subCurrentName; private readonly _subsMap; /** @deprecated */ private _lastUnsubscribe; private _DIContainer; private readonly _singlePromisesStore; private readonly config; private static instance; constructor(options?: ActMasterOptions); static getInstance(): ActMaster; addActions(actions: ActMasterAction[]): void; addAction(action: ActMasterAction): ActMaster; /** @deprecated This feature is considered unsafe for use in production. */ removeAction(eventName: ActEventName): void; /** @deprecated This feature is considered unsafe for use in production. */ clearActions(): void; clearListeners(): void; exec: ActExec; private emit; private catchEmitException; private notifyListeners; /** * Subscribe to events * * @param actName Name of Act * @param listener Function that watches the event * @param context An entity that's used for unsubscribing. If a function is passed, a callback for unsubscribe will be passed to it. Otherwise, the entity will be used as the key for "subsList.clear(context)" * @returns Function for unsubscribing */ subscribe(...args: Parameters): () => boolean; unsubscribe(eventName: ActEventName, listener: ListenerFunction): boolean; once: ActSubscribeType; on: ActSubscribeType; off(eventName: ActEventName, listener: ListenerFunction): boolean; /** * @deprecated * */ inProgress(key: ActEventName | ActEventName[], callback: (inProgress: boolean) => void): () => any; private setProgress; get subsList(): { /** * After running this method, all subscriptions will be saved, * and can be cleared using the * subList.clear('key') method - with the same key passed in. * */ add(key: any, ...fns: (() => any)[]): (key: any) => void; clear: (key: any) => void; }; clearDI(): void; setDI(key: string, ctx: any): ActMaster; getDI(key: string): T; private freshEmitDI; private emitDIProps; private getActionOrNull; /** * @internal For devtools use only */ get _dev_(): { readonly actions: Map; readonly devConf: devActMasterConfig; readonly listeners: Map>; }; }