import { EventType } from './eventType'; export type Priority = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; export type Clone = { [K in keyof T]: T[K]; }; export interface Listener { (payload: Payload): void; } export declare class EventBus = EventType, WritableEvents extends EventType = EventType> { private static instance; private _emitter; constructor(); emit>(type: T): this; emit(type: T, payload: T['payload']): this; on(type: T, handler: Listener, priority?: Priority): this; off(type: T, handler: Listener): this; /** * Return the listeners registered for a given event. */ listeners(event: T): any; getSession(): EventBusSession; static EVENT_STOPPED: {}; static getInstance(): EventBus; static getSession(): EventBusSession; static getSession, WritableEvents extends EventType>(eventBus: EventBus): EventBusSession; static getSession, WritableEvents extends EventType>(eventBus: EventBusSession): EventBusSession; } export declare class EventBusSession = EventType, WritableEvents extends EventType = EventType> { eventBus: EventBus; private listenters; rawEventBus: EventBus; constructor(eventBus: EventBus); on(type: T, handler: Listener, priority?: Priority): this; off(type: T, handler: Listener): this; emit>(type: T): this; emit(type: T, payload: T['payload']): this; clear(): void; }