forked from sushiswap/sushiswap-interface
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sushi-env.d.ts
99 lines (83 loc) · 2.41 KB
/
sushi-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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/// <reference types="gtag.js" />
declare module 'gtag.js'
import { BigNumber, BigNumberish } from '@ethersproject/bignumber'
import Fraction from './src/entities/bignumber/Fraction'
declare global {
interface String {
toBigNumber(decimals: number): BigNumber
}
interface Window {
walletLinkExtension?: any
ethereum?: {
isCoinbaseWallet?: true
isMetaMask?: true
on?: (...args: any[]) => void
removeListener?: (...args: any[]) => void
removeAllListeners?: (...args: any[]) => void
autoRefreshOnNetworkChange?: boolean
}
gamestop?: any
web3?: Record<string, unknown>
}
}
// Used by Ethers.js
interface CustomError extends Error {
reason?: string
}
// Polyfill for ResizeObserver since type is missing from TS
// https://github.com/que-etc/resize-observer-polyfill/blob/master/src/index.d.ts
interface DOMRectReadOnly {
readonly x: number
readonly y: number
readonly width: number
readonly height: number
readonly top: number
readonly right: number
readonly bottom: number
readonly left: number
}
type ResizeObserverCallback = (entries: ResizeObserverEntry[], observer: ResizeObserver) => void
interface ResizeObserverEntry {
readonly target: Element
readonly contentRect: DOMRectReadOnly
}
interface ResizeObserver {
observe(target: Element): void
unobserve(target: Element): void
disconnect(): void
}
declare const ResizeObserver: {
prototype: ResizeObserver
new (callback: ResizeObserverCallback): ResizeObserver
}
interface ResizeObserver {
observe(target: Element): void
unobserve(target: Element): void
disconnect(): void
}
declare module 'content-hash' {
declare function decode(x: string): string
declare function getCodec(x: string): string
}
declare module 'multihashes' {
declare function decode(buff: Uint8Array): {
code: number
name: string
length: number
digest: Uint8Array
}
declare function toB58String(hash: Uint8Array): string
}
declare module 'jazzicon' {
export default function (diameter: number, seed: number): HTMLElement
}
declare module 'formatic'
declare module '@ethersproject/bignumber' {
interface BigNumber {
mulDiv(multiplier: BigNumberish, divisor: BigNumberish): BigNumber
toFixed(decimals: BigNumberish): string
toFraction(decimals: BigNumberish, base: BigNumberish): Fraction
min(...values: BigNumberish[]): BigNumber
max(...values: BigNumberish[]): BigNumber
}
}