-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.d.ts
30 lines (23 loc) · 833 Bytes
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
type RemoveEventListenerCallback = () => void;
type ErrorMessage = string;
export default interface EventRegistryPlugin {
name?: string;
uniqueName?: string;
}
interface EventRegistryFactory {
uniqueEvents?: boolean;
debug?: boolean;
}
interface WaitOptions {
timeout?: number|boolean;
resolveOnTimeout?: boolean;
}
export interface EventRegistry {
on(event: string, handler: Function): RemoveEventListenerCallback;
native(event: string, handler: Function, target?: EventTarget): RemoveEventListenerCallback;
wait(event: string, options?: WaitOptions): Promise<any | ErrorMessage>;
emit(event: string, ...args: any): Array<any>;
clear(event?: string): void;
history(): Array<object>;
}
export declare function createEventRegistry(options?: EventRegistryFactory): EventRegistry;