-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathshim.d.ts
67 lines (64 loc) · 1.68 KB
/
shim.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { ProtocolWithReturn } from 'webext-bridge'
declare module 'webext-bridge' {
export interface ProtocolMap {
// define message protocol types
// see https://github.com/antfu/webext-bridge#type-safe-protocols
'tab-prev': { title: string | undefined }
'get-current-tab': ProtocolWithReturn<{ tabId: number }, { title: string }>
'init-background': ProtocolWithReturn<
{
account: string
turnUrl: string
nodeUrl: string
},
{
address: string
providers: any[]
}
>
'connect-node': ProtocolWithReturn<{ url: string }, any>
'sign-message': ProtocolWithReturn<{ auth: string }, { signed: string }>
'get-provider': ProtocolWithReturn<
any,
{
providers: any[]
currentAccount: string | undefined
}
>
'request-handler': ProtocolWithReturn<
{
type: string
requestId: number
params?: Record<string, any>
method?: string
} & Record<string, any>,
{
success?: boolean
requestId: number
} & Record<string, any>
>
'node-status-change': ProtocolWithReturn<Record<string, any>, any>
'destroy-provider': any
'get-peers': ProtocolWithReturn<any, any>
getWindowInfo: ProtocolWithReturn<
any,
{
screenX: number
screenY: number
outerWidth: number
}
>
event: { name: string; data: any }
}
}
declare module '@metamask/post-message-stream' {
interface WindowPostMessageStream<P = any, D = any> {
on: (type: 'data' | 'error', cb: (data: D) => void) => void
write: (data: P) => boolean
}
}
declare global {
interface Window {
rings: any
}
}