/** * simple event bus */ export default class { private listeners; on(type: string, fun: (p?: any) => void, opts?: Opts): void; off(type: string, fun: () => void): void; dispatch(type: string, data: any): void; clear(type?: string): void; } export interface Item { callback: (p?: any) => void; opts: Opts; } export interface Opts { once?: boolean; }