@types/node 15.0.3 → 15.6.1
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 +1 -1
- node/child_process.d.ts +19 -8
- node/crypto.d.ts +186 -0
- node/diagnostic_channel.d.ts +34 -0
- node/events.d.ts +11 -0
- node/fs/promises.d.ts +6 -5
- node/fs.d.ts +43 -34
- node/globals.d.ts +4 -0
- node/http.d.ts +5 -3
- node/http2.d.ts +11 -6
- node/index.d.ts +1 -1
- node/net.d.ts +2 -2
- node/package.json +2 -2
- node/path.d.ts +10 -0
- node/perf_hooks.d.ts +7 -4
- node/process.d.ts +13 -1
- node/readline.d.ts +1 -0
- node/stream.d.ts +21 -13
- node/tls.d.ts +3 -0
- node/ts3.6/base.d.ts +2 -0
- node/util/types.d.ts +53 -0
- node/util.d.ts +68 -119
- node/v8.d.ts +11 -0
- node/worker_threads.d.ts +26 -3
node/worker_threads.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
declare module 'worker_threads' {
|
|
2
2
|
import { Context } from 'vm';
|
|
3
|
-
import EventEmitter
|
|
3
|
+
import { EventEmitter } from 'events';
|
|
4
|
+
import { EventLoopUtilityFunction } from 'perf_hooks';
|
|
5
|
+
import { FileHandle } from 'fs/promises';
|
|
4
6
|
import { Readable, Writable } from 'stream';
|
|
5
7
|
import { URL } from 'url';
|
|
6
|
-
import {
|
|
8
|
+
import { X509Certificate } from 'crypto';
|
|
7
9
|
|
|
8
10
|
const isMainThread: boolean;
|
|
9
11
|
const parentPort: null | MessagePort;
|
|
@@ -17,7 +19,11 @@ declare module 'worker_threads' {
|
|
|
17
19
|
readonly port2: MessagePort;
|
|
18
20
|
}
|
|
19
21
|
|
|
20
|
-
|
|
22
|
+
interface WorkerPerformance {
|
|
23
|
+
eventLoopUtilization: EventLoopUtilityFunction;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
type TransferListItem = ArrayBuffer | MessagePort | FileHandle | X509Certificate;
|
|
21
27
|
|
|
22
28
|
class MessagePort extends EventEmitter {
|
|
23
29
|
close(): void;
|
|
@@ -119,6 +125,7 @@ declare module 'worker_threads' {
|
|
|
119
125
|
readonly stderr: Readable;
|
|
120
126
|
readonly threadId: number;
|
|
121
127
|
readonly resourceLimits?: ResourceLimits;
|
|
128
|
+
readonly performance: WorkerPerformance;
|
|
122
129
|
|
|
123
130
|
/**
|
|
124
131
|
* @param filename The path to the Worker’s main script or module.
|
|
@@ -203,6 +210,22 @@ declare module 'worker_threads' {
|
|
|
203
210
|
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
|
204
211
|
}
|
|
205
212
|
|
|
213
|
+
interface BroadcastChannel extends NodeJS.RefCounted {}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* See https://developer.mozilla.org/en-US/docs/Web/API/BroadcastChannel
|
|
217
|
+
*/
|
|
218
|
+
class BroadcastChannel {
|
|
219
|
+
readonly name: string;
|
|
220
|
+
onmessage: (message: unknown) => void;
|
|
221
|
+
onmessageerror: (message: unknown) => void;
|
|
222
|
+
|
|
223
|
+
constructor(name: string);
|
|
224
|
+
|
|
225
|
+
close(): void;
|
|
226
|
+
postMessage(message: unknown): void;
|
|
227
|
+
}
|
|
228
|
+
|
|
206
229
|
/**
|
|
207
230
|
* Mark an object as not transferable.
|
|
208
231
|
* If `object` occurs in the transfer list of a `port.postMessage()` call, it will be ignored.
|