assassin-bug/framework/event-bus/index.d.ts

14 lines
385 B
TypeScript

export declare class EventBus {
private events;
constructor();
emit(id: string, data?: any): void;
subscribe(id: string, subscriber: Function): void;
unsubscribe(id: string, subscriber: Function): void;
unsubscribeAll(id: string): void;
}
export declare class EventItem {
id: string;
subscribers: Function[];
constructor(id: string);
}