forked from ChromeDevTools/devtools-frontend
-
Notifications
You must be signed in to change notification settings - Fork 7
/
frontend.d.ts
25 lines (20 loc) · 782 Bytes
/
frontend.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
export type MessagePayload = null | string | number | boolean | {[key: string]: MessagePayload} | MessagePayload[];
export type Message = {event: string, payload?: MessagePayload};
export type WallListener = (message: Message) => void;
export type Wall = {
listen: (fn: WallListener) => Function,
send: (event: string, payload?: MessagePayload) => void,
};
export type Bridge = {
shutdown: () => void,
};
export type Store = Object;
export type BrowserTheme = 'dark' | 'light';
export function createBridge(wall: Wall): Bridge;
export function createStore(bridge: Bridge): Store;
export type InitializationOptions = {
bridge: Bridge,
store: Store,
theme?: BrowserTheme,
};
export function initialize(node: Element | Document, options: InitializationOptions): void;