-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathBellhop.d.ts
35 lines (31 loc) · 1.07 KB
/
Bellhop.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
29
30
31
32
33
34
35
export as namespace BellhopIframe;
interface PriorityFunction extends Function {
_priority: number;
}
export class BellhopEventDispatcher {
constructor();
destroy(): void;
listenerSorter(a: PriorityFunction, b: PriorityFunction): number;
off(name: string, callback?: Function): void;
on(name: string, callback: Function, priority?: number): void;
trigger(event: object | string, data?:object): void;
}
export class Bellhop extends BellhopEventDispatcher {
constructor(id?: number | string);
_sendLater: any[];
connected: boolean;
connecting: boolean;
id: string;
iframe: HTMLIFrameElement | null;
isChild: boolean;
origin: string;
connect(iframe?: HTMLIFrameElement, origin?: string ): Bellhop;
destroy(): void;
disconnect(): void;
fetch(event: string, callback: Function, data?: object, runOnce?: boolean): void;
onConnectionReceived(message: object);
receive(message: MessageEvent);
respond(event: string, data?: object, runOnce?: boolean): void;
send(type: string, data?: any): void;
target(): Window | HTMLIFrameElement | ParentNode;
}