UNPKG

597 BTypeScriptView Raw
1import type { Fn } from "./fn.js";
2import type { IID } from "./id.js";
3/**
4 * Event listener.
5 */
6export declare type Listener = Fn<Event, void>;
7export interface Event extends IID<PropertyKey> {
8 target?: any;
9 canceled?: boolean;
10 value?: any;
11}
12/**
13 * Interface to provide event emitter functionality. Also see
14 * {@link INotifyMixin} decorator mixin.
15 */
16export interface INotify {
17 addListener(id: string, fn: Listener, scope?: any): boolean;
18 removeListener(id: string, fn: Listener, scope?: any): boolean;
19 notify(event: Event): void;
20}
21//# sourceMappingURL=event.d.ts.map
\No newline at end of file