UNPKG

corello

Version:

Main Kernel

21 lines (20 loc) 768 B
import { IEvent } from '..'; import { IDispatcher, TListener } from './meta'; export declare abstract class DispatcherBase<T> implements IDispatcher<T> { readonly id: string; listeners: { [k: string]: TListener<T>[]; }; target: any; private _isOn; once(event: IEvent<T>, callback: TListener<T>['callback']): void; get isOn(): boolean; turnOn(): void; turnOff(): void; on(event: IEvent<T>, callback: TListener<T>['callback'], options?: {}): void; off(event: IEvent<T>, callback?: TListener<T>['callback']): void; dispatch(event: IEvent<T>): boolean | void; dispose(): void; abstract validateEvent(event: any): void; } export declare const validate: (event: any, cls: new (...args: any[]) => any) => void;