-
Notifications
You must be signed in to change notification settings - Fork 17
/
env.d.ts
72 lines (64 loc) · 1.99 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
65
66
67
68
69
70
71
72
/// <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 PelagusProvider = WalletProvider & {
isPelagus: true
send: (method: string, params: unknown[]) => Promise<void>
}
type WindowEthereum = WalletProvider & {
isMetaMask?: boolean
pelagusSetAsDefault?: boolean
isPelagus?: boolean
autoRefreshOnNetworkChange?: boolean
}
interface Window {
walletRouter?: {
currentProvider: WalletProvider
providers: WalletProvider[]
shouldSetPelagusForCurrentProvider: (
shouldSetPelagus: boolean,
shouldReload?: boolean
) => void
getProviderInfo: (
provider: WalletProvider
) => WalletProvider["providerInfo"]
addProvider: (newProvider: WalletProvider) => void
}
pelagus?: PelagusProvider
ethereum?: WindowEthereum
oldEthereum?: WindowEthereum
}
declare namespace NodeJS {
interface ProcessEnv {
NODE_ENV: "production" | "development" | "test"
}
}