forked from tahowallet/extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
env.d.ts
64 lines (57 loc) · 1.78 KB
/
env.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
/// <reference types="styled-jsx" />
declare module "webext-redux/lib/strategies/deepDiff/diff" {
// This should be : DiffStrategy, but importing webext-redux to reuse
// DiffStrategy results in an error augmenting the diff module.
export default function (): (oldObj: unknown, newObj: unknown) => unknown
}
declare module "webext-redux/lib/strategies/deepDiff/patch" {
// This should be : DiffStrategy, but importing webext-redux to reuse
// DiffStrategy results in an error augmenting the patch module.
export default function (): (oldObj: unknown, newObj: unknown) => unknown
}
// Although you would expect this file to be unnecessary, removing it will
// result in a handful of type errors. See PR #196.
declare module "styled-jsx/style"
type WalletProvider = {
providerInfo?: {
label: string
injectedNamespace: string
iconURL: string
identityFlag?: string
checkIdentity?: () => boolean
}
on: (
eventName: string | symbol,
listener: (...args: unknown[]) => void
) => unknown
removeListener: (
eventName: string | symbol,
listener: (...args: unknown[]) => void
) => unknown
[optionalProps: string]: unknown
}
type TallyProvider = WalletProvider & {
isTally: true
}
type WindowEthereum = WalletProvider & {
isMetaMask?: boolean
isTally?: boolean
autoRefreshOnNetworkChange?: boolean
}
interface Window {
walletRouter?: {
currentProvider: WalletProvider
providers: WalletProvider[]
shouldSetTallyForCurrentProvider: (
shouldSetTally: boolean,
shouldReload?: boolean
) => void
getProviderInfo: (
provider: WalletProvider
) => WalletProvider["providerInfo"]
addProvider: (newProvider: WalletProvider) => void
}
tally?: TallyProvider
ethereum?: WindowEthereum
oldEthereum?: WindowEthereum
}