-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathtype.ts
More file actions
56 lines (53 loc) · 1.91 KB
/
type.ts
File metadata and controls
56 lines (53 loc) · 1.91 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
export interface Context {
app_version?: string;
immersive?: boolean;
appearance?: 'light' | 'dark';
currency?: string;
locale?: string;
platform?: 'iOS' | 'Android' | 'Desktop';
conversation_id?: string;
}
export interface WebviewAsset {
asset_id: string;
balance: string;
chain_id: string;
icon_url: string;
name: string;
symbol: string;
}
export interface Messengers {
getContext: (args?: string) => string;
playlist: (audio: string[]) => any;
reloadTheme: (args?: string) => void;
close: (args?: string) => void;
getAssets: (assets: string[], globalCallBackFuncName: string) => void;
getTipAddress: (chainId: string, globalCallBackFuncName: string) => void;
tipSign: (chainId: string, message: string, globalCallBackFuncName: string) => void;
}
declare global {
interface Window {
webkit?: {
messageHandlers?: {
MixinContext?: { postMessage: Messengers['getContext'] };
playlist?: { postMessage: Messengers['playlist'] };
reloadTheme?: { postMessage: Messengers['reloadTheme'] };
close?: { postMessage: Messengers['close'] };
getAssets?: { postMessage: ([params, globalCallBackFuncName]: [string[], string]) => void };
getTipAddress?: { postMessage: ([chainId, globalCallBackFuncName]: [string, string]) => void };
tipSign?: { postMessage: ([chainId, message, globalCallBackFuncName]: [string, string, string]) => void };
};
};
MixinContext?: {
getContext?: Messengers['getContext'];
reloadTheme?: Messengers['reloadTheme'];
playlist?: Messengers['playlist'];
close?: Messengers['close'];
getAssets?: Messengers['getAssets'];
getTipAddress?: Messengers['getTipAddress'];
tipSign?: Messengers['tipSign'];
};
assetsCallbackFunction?: (res: string) => void;
tipAddressCallbackFunction?: (address: string) => void;
tipSignCallbackFunction?: (signature: string) => void;
}
}