/// /** * Adds event subscription ability to inheriting classes */ export declare class EventEmitter { private readonly __state; private readonly __id; /** * @param scope Pass scope when the inheriting object is deep watched. This will create the internal state outside of the object. */ constructor(scope?: angular.IScope); private $state; /** * Invokes all event subscribers */ protected fire(eventName: string, ...args: any[]): EventEmitter; /** * Invokes all event subscribers, and also keep event in history list. */ protected stream(eventName: string, ...args: any[]): EventEmitter; /** * Subscribes to event * * @param invoke Pass true to immediately invoke the handler if event was already triggered * @param scope Pass scope to automatically remove the handler when scope is destroyed */ on(eventName: string, handler: (...args: any[]) => any, invoke?: boolean, scope?: angular.IScope): EventEmitter; /** * Subscribes to event, but only for one occurrence of the event. * * @param invoke Pass true to immediately invoke the handler if event was already triggered */ onOnce(eventName: string, handler: (...args: any[]) => any, invoke?: boolean): EventEmitter; /** * Invokes all event subscribers. This is a public version of {@link fire}. */ trigger(eventName: string, ...args: any[]): EventEmitter; /** * Invokes all event subscribers, but also keep it in history. This is a public version of {@link stream}. */ triggerStream(eventName: string, ...args: any[]): EventEmitter; /** * Use to update scope reference */ setScope(scope: angular.IScope): EventEmitter; }