import { Subscription } from 'rxjs/Subscription'; import { Observable } from 'rxjs/Observable'; import { Subject } from 'rxjs/Subject'; import 'rxjs/add/operator/first'; import 'rxjs/add/operator/take'; /** * RxJs + EventBus * * * @langversion TypeScript 2.0 * @tiptext * */ export declare class RxEmitter { static cache: any; static on(eventName: string, target?: any): Observable; static one(eventName: string, target?: any): Observable; static emit(eventName: string, ...rest: T[]): string; static has(eventName: string): boolean; static get(eventName: string): any; static getByTarget(target: any, eventName?: string): ICacheObj[]; static off(eventName: string): any; static unsubscribe(target: any, eventName?: string): void; static offAllByTarget(target: any): void; static offByTarget(target: any): void; static offAll(eventName?: string): void; /** * create cache at emit time * eventName -> subject */ private static createChache(eventName); } export interface ICacheObj { subject?: Subject; eventName?: string; id?: any; target?: any; targets?: any[]; callback?: (...rest: any[]) => any; subscription?: Subscription; }