forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
103 lines (83 loc) · 2.09 KB
/
index.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
100
101
102
103
// missing type definitions for libraries
// https://glebbahmutov.com/blog/trying-typescript/#manual-types-for-3rd-party-libraries
declare module '@cypress/get-windows-proxy' {
type ProxyConfig = {
httpProxy: string
noProxy: string
}
function getWindowsProxy(): Optional<ProxyConfig>
export = getWindowsProxy
}
declare module 'http' {
import { Socket } from 'net'
import { Url } from 'url'
type SocketCallback = (err: Optional<Error>, sock: Optional<Socket>) => void
interface Agent {
addRequest(req: ClientRequest, options: RequestOptions): void
createSocket(req: ClientRequest, options: RequestOptions, cb: SocketCallback): void
createConnection(options: RequestOptions, cb: Optional<SocketCallback>): void
protocol: 'http:' | 'https:' | string
}
interface ClientRequest {
_header: { [key: string]: string }
_implicitHeader: () => void
output: string[]
agent: Agent
insecureHTTPParser: boolean
}
interface RequestOptions extends ClientRequestArgs {
_agentKey: Optional<symbol>
host: string
href: string
port: number
proxy: Optional<string>
servername: Optional<string>
socket: Optional<Socket>
uri: Url
}
interface OutgoingMessage {
destroy(error?: Error): void
}
export const CRLF: string
}
declare module 'https' {
interface Agent {
_sessionCache: { [_agentKey: string]: Buffer }
}
}
declare interface InternalStream {
queue(str: string | null): void
}
declare module 'net' {
type family = 4 | 6
type TCPSocket = {}
interface Address {
address: string
family: family
}
interface Socket {
_handle: TCPSocket | null
}
}
declare interface Object {
assign(...obj: any[]): any
}
declare type Optional<T> = T | void
declare module 'plist' {
interface Plist {
parse: (s: string) => any
}
const plist: Plist
export = plist
}
declare module 'proxy-from-env' {
const getProxyForUrl: (url: string) => string
}
declare interface SymbolConstructor {
for(str: string): SymbolConstructor
}
declare module 'url' {
interface UrlWithStringQuery {
format(): string
}
}