forked from ipfs/public-gateway-checker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.d.ts
62 lines (53 loc) · 1.45 KB
/
global.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
/* eslint-disable @typescript-eslint/consistent-type-definitions */
/* eslint-disable etc/prefer-interface */
declare module '@dutu/rate-limiter'
declare module 'ipfs-geoip'
// declare global {
/**
* An interface that allows various properties for gateways to be checked
*/
interface Checkable {
// @todo: Update to async/await
// check: () => Promise<void>
check: () => void
checked: () => void
onerror: () => void
}
/**
* A class implementing the Visible interface supports functionality that can make it visible in the UI
*/
interface Visible {
tag: import('./Tag').Tag
_tagName: string
_className: string
}
interface Window {
OnScriptloaded: typeof import('./onScriptLoaded').onScriptLoaded
checker: import('./Checker').Checker
}
declare namespace IpfsGeoip {
interface LookupResponse {
country_code: string
country_name: string
}
}
interface DnsQueryResponseAnswer { name: string, type: number, TTL: number, data: string }
interface DnsQueryResponseQuestion { name: string, type: number }
interface DnsQueryResponseAuthority {
TTL: number
data: string // "aragorn.ns.cloudflare.com. dns.cloudflare.com. 2271826322 10000 2400 604800 3600"
name: string // "stibarc.com"
type: number
}
interface DnsQueryResponse {
AD: boolean
Answer?: DnsQueryResponseAnswer[]
Authority?: DnsQueryResponseAuthority[]
CD: boolean
Question: DnsQueryResponseQuestion[]
RA: boolean
RD: boolean
Status: number
TC: boolean
}
// }