export interface ICollectionItem { readonly key: string; readonly fn: Function; readonly context: object | Function; } export declare class EventCollectionEmitter { [key: string]: any; private listeners; private preHooks; private postHooks; private postFailHooks; constructor(); /** * Add listener callback at the end of the current chain * @param key * @param context * @param listener */ add(key: string, context: Object | Function, listener?: Function): void; /** * Remove the listener specified by its key from the collection * @param key */ remove(key: string): void; /** * add hook that will be executed before actual listener * @param fn */ pre(fn: Function): void; /** * add hook that will be executed after actual listener * @param fn */ post(fn: Function): void; /** * add hook that will be executed after actual listener when execution will fail * @param fn */ postFail(fn: Function): void; /** * Fire registered listeners in sequence and returns a promise containing wrapping an array of all individual results * The parameters passed to the fire are forwarded in the same order to the listeners * @returns {Promise} */ fire(...args: object[]): Promise; }