@types/node 13.9.5 → 13.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
node/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (http://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Fri, 27 Mar 2020 16:47:31 GMT
11
+ * Last updated: Thu, 02 Apr 2020 16:50:50 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `Buffer`, `Symbol`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
node/async_hooks.d.ts CHANGED
@@ -143,4 +143,105 @@ declare module "async_hooks" {
143
143
  */
144
144
  triggerAsyncId(): number;
145
145
  }
146
+
147
+ /**
148
+ * When having multiple instances of `AsyncLocalStorage`, they are independent
149
+ * from each other. It is safe to instantiate this class multiple times.
150
+ */
151
+ class AsyncLocalStorage<T> {
152
+ /**
153
+ * This method disables the instance of `AsyncLocalStorage`. All subsequent calls
154
+ * to `asyncLocalStorage.getStore()` will return `undefined` until
155
+ * `asyncLocalStorage.run()` or `asyncLocalStorage.runSyncAndReturn()`
156
+ * is called again.
157
+ *
158
+ * When calling `asyncLocalStorage.disable()`, all current contexts linked to the
159
+ * instance will be exited.
160
+ *
161
+ * Calling `asyncLocalStorage.disable()` is required before the
162
+ * `asyncLocalStorage` can be garbage collected. This does not apply to stores
163
+ * provided by the `asyncLocalStorage`, as those objects are garbage collected
164
+ * along with the corresponding async resources.
165
+ *
166
+ * This method is to be used when the `asyncLocalStorage` is not in use anymore
167
+ * in the current process.
168
+ */
169
+ disable(): void;
170
+
171
+ /**
172
+ * This method returns the current store.
173
+ * If this method is called outside of an asynchronous context initialized by
174
+ * calling `asyncLocalStorage.run` or `asyncLocalStorage.runAndReturn`, it will
175
+ * return `undefined`.
176
+ */
177
+ getStore(): T | undefined;
178
+
179
+ /**
180
+ * Calling `asyncLocalStorage.run(callback)` will create a new asynchronous
181
+ * context.
182
+ * Within the callback function and the asynchronous operations from the callback,
183
+ * `asyncLocalStorage.getStore()` will return an instance of `Map` known as
184
+ * "the store". This store will be persistent through the following
185
+ * asynchronous calls.
186
+ *
187
+ * The callback will be ran asynchronously. Optionally, arguments can be passed
188
+ * to the function. They will be passed to the callback function.
189
+ *
190
+ * If an error is thrown by the callback function, it will not be caught by
191
+ * a `try/catch` block as the callback is ran in a new asynchronous resource.
192
+ * Also, the stacktrace will be impacted by the asynchronous call.
193
+ */
194
+ // TODO: Apply generic vararg once available
195
+ run(store: T, callback: (...args: any[]) => void, ...args: any[]): void;
196
+
197
+ /**
198
+ * Calling `asyncLocalStorage.exit(callback)` will create a new asynchronous
199
+ * context.
200
+ * Within the callback function and the asynchronous operations from the callback,
201
+ * `asyncLocalStorage.getStore()` will return `undefined`.
202
+ *
203
+ * The callback will be ran asynchronously. Optionally, arguments can be passed
204
+ * to the function. They will be passed to the callback function.
205
+ *
206
+ * If an error is thrown by the callback function, it will not be caught by
207
+ * a `try/catch` block as the callback is ran in a new asynchronous resource.
208
+ * Also, the stacktrace will be impacted by the asynchronous call.
209
+ */
210
+ exit(callback: (...args: any[]) => void, ...args: any[]): void;
211
+
212
+ /**
213
+ * This methods runs a function synchronously within a context and return its
214
+ * return value. The store is not accessible outside of the callback function or
215
+ * the asynchronous operations created within the callback.
216
+ *
217
+ * Optionally, arguments can be passed to the function. They will be passed to
218
+ * the callback function.
219
+ *
220
+ * If the callback function throws an error, it will be thrown by
221
+ * `runSyncAndReturn` too. The stacktrace will not be impacted by this call and
222
+ * the context will be exited.
223
+ */
224
+ runSyncAndReturn<R>(store: T, callback: (...args: any[]) => R, ...args: any[]): R;
225
+
226
+ /**
227
+ * This methods runs a function synchronously outside of a context and return its
228
+ * return value. The store is not accessible within the callback function or
229
+ * the asynchronous operations created within the callback.
230
+ *
231
+ * Optionally, arguments can be passed to the function. They will be passed to
232
+ * the callback function.
233
+ *
234
+ * If the callback function throws an error, it will be thrown by
235
+ * `exitSyncAndReturn` too. The stacktrace will not be impacted by this call and
236
+ * the context will be re-entered.
237
+ */
238
+ exitSyncAndReturn<R>(callback: (...args: any[]) => R, ...args: any[]): R;
239
+
240
+ /**
241
+ * Calling `asyncLocalStorage.enterWith(store)` will transition into the context
242
+ * for the remainder of the current synchronous execution and will persist
243
+ * through any following asynchronous calls.
244
+ */
245
+ enterWith(store: T): void;
246
+ }
146
247
  }
node/fs.d.ts CHANGED
@@ -134,62 +134,131 @@ declare module "fs" {
134
134
  close(): void;
135
135
  bytesRead: number;
136
136
  path: string | Buffer;
137
+ pending: boolean;
137
138
 
138
139
  /**
139
140
  * events.EventEmitter
140
141
  * 1. open
141
142
  * 2. close
143
+ * 3. ready
142
144
  */
143
- addListener(event: string, listener: (...args: any[]) => void): this;
144
- addListener(event: "open", listener: (fd: number) => void): this;
145
145
  addListener(event: "close", listener: () => void): this;
146
+ addListener(event: "data", listener: (chunk: Buffer | string) => void): this;
147
+ addListener(event: "end", listener: () => void): this;
148
+ addListener(event: "error", listener: (err: Error) => void): this;
149
+ addListener(event: "open", listener: (fd: number) => void): this;
150
+ addListener(event: "pause", listener: () => void): this;
151
+ addListener(event: "readable", listener: () => void): this;
152
+ addListener(event: "ready", listener: () => void): this;
153
+ addListener(event: "resume", listener: () => void): this;
154
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
146
155
 
147
- on(event: string, listener: (...args: any[]) => void): this;
148
- on(event: "open", listener: (fd: number) => void): this;
149
156
  on(event: "close", listener: () => void): this;
157
+ on(event: "data", listener: (chunk: Buffer | string) => void): this;
158
+ on(event: "end", listener: () => void): this;
159
+ on(event: "error", listener: (err: Error) => void): this;
160
+ on(event: "open", listener: (fd: number) => void): this;
161
+ on(event: "pause", listener: () => void): this;
162
+ on(event: "readable", listener: () => void): this;
163
+ on(event: "ready", listener: () => void): this;
164
+ on(event: "resume", listener: () => void): this;
165
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
150
166
 
151
- once(event: string, listener: (...args: any[]) => void): this;
152
- once(event: "open", listener: (fd: number) => void): this;
153
167
  once(event: "close", listener: () => void): this;
168
+ once(event: "data", listener: (chunk: Buffer | string) => void): this;
169
+ once(event: "end", listener: () => void): this;
170
+ once(event: "error", listener: (err: Error) => void): this;
171
+ once(event: "open", listener: (fd: number) => void): this;
172
+ once(event: "pause", listener: () => void): this;
173
+ once(event: "readable", listener: () => void): this;
174
+ once(event: "ready", listener: () => void): this;
175
+ once(event: "resume", listener: () => void): this;
176
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
154
177
 
155
- prependListener(event: string, listener: (...args: any[]) => void): this;
156
- prependListener(event: "open", listener: (fd: number) => void): this;
157
178
  prependListener(event: "close", listener: () => void): this;
179
+ prependListener(event: "data", listener: (chunk: Buffer | string) => void): this;
180
+ prependListener(event: "end", listener: () => void): this;
181
+ prependListener(event: "error", listener: (err: Error) => void): this;
182
+ prependListener(event: "open", listener: (fd: number) => void): this;
183
+ prependListener(event: "pause", listener: () => void): this;
184
+ prependListener(event: "readable", listener: () => void): this;
185
+ prependListener(event: "ready", listener: () => void): this;
186
+ prependListener(event: "resume", listener: () => void): this;
187
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
158
188
 
159
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
160
- prependOnceListener(event: "open", listener: (fd: number) => void): this;
161
189
  prependOnceListener(event: "close", listener: () => void): this;
190
+ prependOnceListener(event: "data", listener: (chunk: Buffer | string) => void): this;
191
+ prependOnceListener(event: "end", listener: () => void): this;
192
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
193
+ prependOnceListener(event: "open", listener: (fd: number) => void): this;
194
+ prependOnceListener(event: "pause", listener: () => void): this;
195
+ prependOnceListener(event: "readable", listener: () => void): this;
196
+ prependOnceListener(event: "ready", listener: () => void): this;
197
+ prependOnceListener(event: "resume", listener: () => void): this;
198
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
162
199
  }
163
200
 
164
201
  class WriteStream extends stream.Writable {
165
202
  close(): void;
166
203
  bytesWritten: number;
167
204
  path: string | Buffer;
205
+ pending: boolean;
168
206
 
169
207
  /**
170
208
  * events.EventEmitter
171
209
  * 1. open
172
210
  * 2. close
211
+ * 3. ready
173
212
  */
174
- addListener(event: string, listener: (...args: any[]) => void): this;
175
- addListener(event: "open", listener: (fd: number) => void): this;
176
213
  addListener(event: "close", listener: () => void): this;
214
+ addListener(event: "drain", listener: () => void): this;
215
+ addListener(event: "error", listener: (err: Error) => void): this;
216
+ addListener(event: "finish", listener: () => void): this;
217
+ addListener(event: "open", listener: (fd: number) => void): this;
218
+ addListener(event: "pipe", listener: (src: stream.Readable) => void): this;
219
+ addListener(event: "ready", listener: () => void): this;
220
+ addListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
221
+ addListener(event: string | symbol, listener: (...args: any[]) => void): this;
177
222
 
178
- on(event: string, listener: (...args: any[]) => void): this;
179
- on(event: "open", listener: (fd: number) => void): this;
180
223
  on(event: "close", listener: () => void): this;
224
+ on(event: "drain", listener: () => void): this;
225
+ on(event: "error", listener: (err: Error) => void): this;
226
+ on(event: "finish", listener: () => void): this;
227
+ on(event: "open", listener: (fd: number) => void): this;
228
+ on(event: "pipe", listener: (src: stream.Readable) => void): this;
229
+ on(event: "ready", listener: () => void): this;
230
+ on(event: "unpipe", listener: (src: stream.Readable) => void): this;
231
+ on(event: string | symbol, listener: (...args: any[]) => void): this;
181
232
 
182
- once(event: string, listener: (...args: any[]) => void): this;
183
- once(event: "open", listener: (fd: number) => void): this;
184
233
  once(event: "close", listener: () => void): this;
234
+ once(event: "drain", listener: () => void): this;
235
+ once(event: "error", listener: (err: Error) => void): this;
236
+ once(event: "finish", listener: () => void): this;
237
+ once(event: "open", listener: (fd: number) => void): this;
238
+ once(event: "pipe", listener: (src: stream.Readable) => void): this;
239
+ once(event: "ready", listener: () => void): this;
240
+ once(event: "unpipe", listener: (src: stream.Readable) => void): this;
241
+ once(event: string | symbol, listener: (...args: any[]) => void): this;
185
242
 
186
- prependListener(event: string, listener: (...args: any[]) => void): this;
187
- prependListener(event: "open", listener: (fd: number) => void): this;
188
243
  prependListener(event: "close", listener: () => void): this;
244
+ prependListener(event: "drain", listener: () => void): this;
245
+ prependListener(event: "error", listener: (err: Error) => void): this;
246
+ prependListener(event: "finish", listener: () => void): this;
247
+ prependListener(event: "open", listener: (fd: number) => void): this;
248
+ prependListener(event: "pipe", listener: (src: stream.Readable) => void): this;
249
+ prependListener(event: "ready", listener: () => void): this;
250
+ prependListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
251
+ prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
189
252
 
190
- prependOnceListener(event: string, listener: (...args: any[]) => void): this;
191
- prependOnceListener(event: "open", listener: (fd: number) => void): this;
192
253
  prependOnceListener(event: "close", listener: () => void): this;
254
+ prependOnceListener(event: "drain", listener: () => void): this;
255
+ prependOnceListener(event: "error", listener: (err: Error) => void): this;
256
+ prependOnceListener(event: "finish", listener: () => void): this;
257
+ prependOnceListener(event: "open", listener: (fd: number) => void): this;
258
+ prependOnceListener(event: "pipe", listener: (src: stream.Readable) => void): this;
259
+ prependOnceListener(event: "ready", listener: () => void): this;
260
+ prependOnceListener(event: "unpipe", listener: (src: stream.Readable) => void): this;
261
+ prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
193
262
  }
194
263
 
195
264
  /**
@@ -786,14 +855,15 @@ declare module "fs" {
786
855
  interface MakeDirectoryOptions {
787
856
  /**
788
857
  * Indicates whether parent folders should be created.
858
+ * If a folder was created, the path to the first created folder will be returned.
789
859
  * @default false
790
860
  */
791
861
  recursive?: boolean;
792
862
  /**
793
863
  * A file mode. If a string is passed, it is parsed as an octal integer. If not specified
794
- * @default 0o777.
864
+ * @default 0o777
795
865
  */
796
- mode?: number;
866
+ mode?: number | string;
797
867
  }
798
868
 
799
869
  /**
@@ -802,7 +872,23 @@ declare module "fs" {
802
872
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
803
873
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
804
874
  */
805
- function mkdir(path: PathLike, options: number | string | MakeDirectoryOptions | undefined | null, callback: NoParamCallback): void;
875
+ function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true }, callback: (err: NodeJS.ErrnoException | null, path: string) => void): void;
876
+
877
+ /**
878
+ * Asynchronous mkdir(2) - create a directory.
879
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
880
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
881
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
882
+ */
883
+ function mkdir(path: PathLike, options: number | string | (MakeDirectoryOptions & { recursive?: false; }) | null | undefined, callback: NoParamCallback): void;
884
+
885
+ /**
886
+ * Asynchronous mkdir(2) - create a directory.
887
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
888
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
889
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
890
+ */
891
+ function mkdir(path: PathLike, options: number | string | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path: string | undefined) => void): void;
806
892
 
807
893
  /**
808
894
  * Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
@@ -818,7 +904,23 @@ declare module "fs" {
818
904
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
819
905
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
820
906
  */
821
- function __promisify__(path: PathLike, options?: number | string | MakeDirectoryOptions | null): Promise<void>;
907
+ function __promisify__(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string>;
908
+
909
+ /**
910
+ * Asynchronous mkdir(2) - create a directory.
911
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
912
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
913
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
914
+ */
915
+ function __promisify__(path: PathLike, options?: number | string | (MakeDirectoryOptions & { recursive?: false; }) | null): Promise<void>;
916
+
917
+ /**
918
+ * Asynchronous mkdir(2) - create a directory.
919
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
920
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
921
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
922
+ */
923
+ function __promisify__(path: PathLike, options?: number | string | MakeDirectoryOptions | null): Promise<string | undefined>;
822
924
  }
823
925
 
824
926
  /**
@@ -827,7 +929,23 @@ declare module "fs" {
827
929
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
828
930
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
829
931
  */
830
- function mkdirSync(path: PathLike, options?: number | string | MakeDirectoryOptions | null): void;
932
+ function mkdirSync(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): string;
933
+
934
+ /**
935
+ * Synchronous mkdir(2) - create a directory.
936
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
937
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
938
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
939
+ */
940
+ function mkdirSync(path: PathLike, options?: number | string | (MakeDirectoryOptions & { recursive?: false; }) | null): void;
941
+
942
+ /**
943
+ * Synchronous mkdir(2) - create a directory.
944
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
945
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
946
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
947
+ */
948
+ function mkdirSync(path: PathLike, options?: number | string | MakeDirectoryOptions | null): string | undefined;
831
949
 
832
950
  /**
833
951
  * Asynchronously creates a unique temporary directory.
@@ -2209,7 +2327,23 @@ declare module "fs" {
2209
2327
  * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
2210
2328
  * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
2211
2329
  */
2212
- function mkdir(path: PathLike, options?: number | string | MakeDirectoryOptions | null): Promise<void>;
2330
+ function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string>;
2331
+
2332
+ /**
2333
+ * Asynchronous mkdir(2) - create a directory.
2334
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2335
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
2336
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
2337
+ */
2338
+ function mkdir(path: PathLike, options?: number | string | (MakeDirectoryOptions & { recursive?: false; }) | null): Promise<void>;
2339
+
2340
+ /**
2341
+ * Asynchronous mkdir(2) - create a directory.
2342
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2343
+ * @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
2344
+ * should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
2345
+ */
2346
+ function mkdir(path: PathLike, options?: number | string | MakeDirectoryOptions | null): Promise<string | undefined>;
2213
2347
 
2214
2348
  /**
2215
2349
  * Asynchronous readdir(3) - read a directory.
node/http.d.ts CHANGED
@@ -297,6 +297,7 @@ declare module "http" {
297
297
  class IncomingMessage extends stream.Readable {
298
298
  constructor(socket: Socket);
299
299
 
300
+ aborted: boolean;
300
301
  httpVersion: string;
301
302
  httpVersionMajor: number;
302
303
  httpVersionMinor: number;
node/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for non-npm package Node.js 13.9
1
+ // Type definitions for non-npm package Node.js 13.11
2
2
  // Project: http://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
node/os.d.ts CHANGED
@@ -209,6 +209,14 @@ declare module "os" {
209
209
  }
210
210
 
211
211
  function arch(): string;
212
+ /**
213
+ * Returns a string identifying the kernel version.
214
+ * On POSIX systems, the operating system release is determined by calling
215
+ * [uname(3)][]. On Windows, `pRtlGetVersion` is used, and if it is not available,
216
+ * `GetVersionExW()` will be used. See
217
+ * https://en.wikipedia.org/wiki/Uname#Examples for more information.
218
+ */
219
+ function version(): string;
212
220
  function platform(): NodeJS.Platform;
213
221
  function tmpdir(): string;
214
222
  const EOL: string;
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "13.9.5",
3
+ "version": "13.11.0",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -241,6 +241,6 @@
241
241
  },
242
242
  "scripts": {},
243
243
  "dependencies": {},
244
- "typesPublisherContentHash": "9ed5f85eadcb83205d46c14fe467bff74e275854fe9f3070ea6cc9b0a0ddea0f",
244
+ "typesPublisherContentHash": "0fbeeb0b6e4acddc36e24b1455120076db2e6b76112dcb47230f57c67093c74e",
245
245
  "typeScriptVersion": "2.8"
246
246
  }
node/stream.d.ts CHANGED
@@ -50,56 +50,72 @@ declare module "stream" {
50
50
  * 1. close
51
51
  * 2. data
52
52
  * 3. end
53
- * 4. readable
54
- * 5. error
53
+ * 4. error
54
+ * 5. pause
55
+ * 6. readable
56
+ * 7. resume
55
57
  */
56
58
  addListener(event: "close", listener: () => void): this;
57
59
  addListener(event: "data", listener: (chunk: any) => void): this;
58
60
  addListener(event: "end", listener: () => void): this;
59
- addListener(event: "readable", listener: () => void): this;
60
61
  addListener(event: "error", listener: (err: Error) => void): this;
62
+ addListener(event: "pause", listener: () => void): this;
63
+ addListener(event: "readable", listener: () => void): this;
64
+ addListener(event: "resume", listener: () => void): this;
61
65
  addListener(event: string | symbol, listener: (...args: any[]) => void): this;
62
66
 
63
67
  emit(event: "close"): boolean;
64
68
  emit(event: "data", chunk: any): boolean;
65
69
  emit(event: "end"): boolean;
66
- emit(event: "readable"): boolean;
67
70
  emit(event: "error", err: Error): boolean;
71
+ emit(event: "pause"): boolean;
72
+ emit(event: "readable"): boolean;
73
+ emit(event: "resume"): boolean;
68
74
  emit(event: string | symbol, ...args: any[]): boolean;
69
75
 
70
76
  on(event: "close", listener: () => void): this;
71
77
  on(event: "data", listener: (chunk: any) => void): this;
72
78
  on(event: "end", listener: () => void): this;
73
- on(event: "readable", listener: () => void): this;
74
79
  on(event: "error", listener: (err: Error) => void): this;
80
+ on(event: "pause", listener: () => void): this;
81
+ on(event: "readable", listener: () => void): this;
82
+ on(event: "resume", listener: () => void): this;
75
83
  on(event: string | symbol, listener: (...args: any[]) => void): this;
76
84
 
77
85
  once(event: "close", listener: () => void): this;
78
86
  once(event: "data", listener: (chunk: any) => void): this;
79
87
  once(event: "end", listener: () => void): this;
80
- once(event: "readable", listener: () => void): this;
81
88
  once(event: "error", listener: (err: Error) => void): this;
89
+ once(event: "pause", listener: () => void): this;
90
+ once(event: "readable", listener: () => void): this;
91
+ once(event: "resume", listener: () => void): this;
82
92
  once(event: string | symbol, listener: (...args: any[]) => void): this;
83
93
 
84
94
  prependListener(event: "close", listener: () => void): this;
85
95
  prependListener(event: "data", listener: (chunk: any) => void): this;
86
96
  prependListener(event: "end", listener: () => void): this;
87
- prependListener(event: "readable", listener: () => void): this;
88
97
  prependListener(event: "error", listener: (err: Error) => void): this;
98
+ prependListener(event: "pause", listener: () => void): this;
99
+ prependListener(event: "readable", listener: () => void): this;
100
+ prependListener(event: "resume", listener: () => void): this;
89
101
  prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
90
102
 
91
103
  prependOnceListener(event: "close", listener: () => void): this;
92
104
  prependOnceListener(event: "data", listener: (chunk: any) => void): this;
93
105
  prependOnceListener(event: "end", listener: () => void): this;
94
- prependOnceListener(event: "readable", listener: () => void): this;
95
106
  prependOnceListener(event: "error", listener: (err: Error) => void): this;
107
+ prependOnceListener(event: "pause", listener: () => void): this;
108
+ prependOnceListener(event: "readable", listener: () => void): this;
109
+ prependOnceListener(event: "resume", listener: () => void): this;
96
110
  prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
97
111
 
98
112
  removeListener(event: "close", listener: () => void): this;
99
113
  removeListener(event: "data", listener: (chunk: any) => void): this;
100
114
  removeListener(event: "end", listener: () => void): this;
101
- removeListener(event: "readable", listener: () => void): this;
102
115
  removeListener(event: "error", listener: (err: Error) => void): this;
116
+ removeListener(event: "pause", listener: () => void): this;
117
+ removeListener(event: "readable", listener: () => void): this;
118
+ removeListener(event: "resume", listener: () => void): this;
103
119
  removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
104
120
 
105
121
  [Symbol.asyncIterator](): AsyncIterableIterator<any>;
node/tls.d.ts CHANGED
@@ -297,6 +297,14 @@ declare module "tls" {
297
297
  */
298
298
  enableTrace(): void;
299
299
 
300
+ /**
301
+ * @param length number of bytes to retrieve from keying material
302
+ * @param label an application specific label, typically this will be a value from the
303
+ * [IANA Exporter Label Registry](https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels).
304
+ * @param context optionally provide a context.
305
+ */
306
+ exportKeyingMaterial(length: number, label: string, context: Buffer): Buffer;
307
+
300
308
  addListener(event: string, listener: (...args: any[]) => void): this;
301
309
  addListener(event: "OCSPResponse", listener: (response: Buffer) => void): this;
302
310
  addListener(event: "secureConnect", listener: () => void): this;
node/ts3.5/wasi.d.ts CHANGED
@@ -20,6 +20,15 @@ declare module 'wasi' {
20
20
  preopens?: {
21
21
  [key: string]: string;
22
22
  };
23
+
24
+ /**
25
+ * By default, WASI applications terminate the Node.js
26
+ * process via the `__wasi_proc_exit()` function. Setting this option to `true`
27
+ * causes `wasi.start()` to return the exit code rather than terminate the
28
+ * process.
29
+ * @default false
30
+ */
31
+ returnOnExit?: boolean;
23
32
  }
24
33
 
25
34
  class WASI {
node/vm.d.ts CHANGED
@@ -94,6 +94,23 @@ declare module "vm" {
94
94
  };
95
95
  }
96
96
 
97
+ type MeasureMemoryMode = 'summary' | 'detailed';
98
+
99
+ interface MeasureMemoryOptions {
100
+ /**
101
+ * @default 'summary'
102
+ */
103
+ mode?: MeasureMemoryMode;
104
+ context?: Context;
105
+ }
106
+
107
+ interface MemoryMeasurement {
108
+ total: {
109
+ jsMemoryEstimate: number;
110
+ jsMemoryRange: [number, number];
111
+ };
112
+ }
113
+
97
114
  class Script {
98
115
  constructor(code: string, options?: ScriptOptions);
99
116
  runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
@@ -107,4 +124,21 @@ declare module "vm" {
107
124
  function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any;
108
125
  function runInThisContext(code: string, options?: RunningScriptOptions | string): any;
109
126
  function compileFunction(code: string, params?: string[], options?: CompileFunctionOptions): Function;
127
+
128
+ /**
129
+ * Measure the memory known to V8 and used by the current execution context or a specified context.
130
+ *
131
+ * The format of the object that the returned Promise may resolve with is
132
+ * specific to the V8 engine and may change from one version of V8 to the next.
133
+ *
134
+ * The returned result is different from the statistics returned by
135
+ * `v8.getHeapSpaceStatistics()` in that `vm.measureMemory()` measures
136
+ * the memory reachable by V8 from a specific context, while
137
+ * `v8.getHeapSpaceStatistics()` measures the memory used by an instance
138
+ * of V8 engine, which can switch among multiple contexts that reference
139
+ * objects in the heap of one engine.
140
+ *
141
+ * @experimental
142
+ */
143
+ function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
110
144
  }