-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathneed-to-upstream-to-flow-lib.js.flow
138 lines (122 loc) · 3.39 KB
/
need-to-upstream-to-flow-lib.js.flow
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree.
*
* @flow
*/
/*
* APIs listed in this file are ones that should be built into Flow and need to be upstreamed.
*/
type IDisposable = {
dispose(): mixed,
};
/*
* These Notification & NotificationOptions definitions are not exhaustive while standardization,
* browser, and Electron support remain incomplete.
*/
type NotificationOptions = {
body?: string,
icon?: string,
};
declare class Notification {
constructor(
message: string,
options?: NotificationOptions,
): void,
onclick: () => void,
}
// T9254051 - Fix flow http/https definitions.
declare class http$fixed$Server extends events$EventEmitter {
listen(port: number, hostname?: string, backlog?: number, callback?: Function): http$fixed$Server,
listen(path: string, callback?: Function): http$fixed$Server,
listen(handle: Object, callback?: Function): http$fixed$Server,
close(callback?: Function): http$fixed$Server,
address(): {port: number, fmaily: string, address: string},
maxHeadersCount: number,
}
declare class http$fixed$IncomingMessage extends stream$Readable {
headers: Object,
httpVersion: string,
method: string,
trailers: Object,
setTimeout(msecs: number, callback: Function): void,
socket: any, // TODO net.Socket
statusCode: number,
url: string,
connection: { destroy: () => void },
}
declare class http$fixed$ClientRequest extends stream$Writable {
}
declare class http$fixed$ServerResponse {
setHeader(name: string, value: string): void,
statusCode: number,
write(value: string): void,
end(): void,
}
declare class https$fixed {
Server: typeof http$fixed$Server,
createServer(
options: Object,
requestListener?: (
request: http$fixed$IncomingMessage,
response: http$fixed$ServerResponse,
) => void,
): http$fixed$Server,
request(
options: Object | string,
callback: (response: http$fixed$IncomingMessage) => void
): http$fixed$ClientRequest,
get(
options: Object | string,
callback: (response: http$fixed$IncomingMessage) => void
): http$fixed$ClientRequest,
}
declare class http$fixed {
Server: typeof http$fixed$Server,
createServer(
requestListener?: (
request: http$fixed$IncomingMessage,
response: http$fixed$ServerResponse,
) => void
): http$fixed$Server,
request(
options: Object | string,
callback: (response: http$fixed$IncomingMessage) => void
): http$fixed$ClientRequest,
get(
options: Object | string,
callback: (response: http$fixed$IncomingMessage) => void
): http$fixed$ClientRequest,
}
declare class module$Module {
constructor(
id?: string,
parent?: string | module$Module
): void,
id: ?string,
exports: any,
parent?: string | module$Module,
filename?: string,
loaded: boolean,
children: Array<module$Module>,
paths: Array<string>,
_compile: (content: string, filename: string) => void,
static _resolveFilename(filename: string, module: any): string,
}
declare module 'module' {
declare module.exports: typeof module$Module;
}
declare module 'console' {
declare module.exports: any;
}
declare interface net$ListenOptions {
port?: number,
host?: string,
backlog?: number,
path?: string,
exclusive?: boolean,
}
declare export var module: module$Module;