@types/node 13.13.1 → 13.13.5

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: Mon, 20 Apr 2020 16:28:04 GMT
11
+ * Last updated: Tue, 05 May 2020 19:02:53 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/assert.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  declare module "assert" {
2
- function internal(value: any, message?: string | Error): void;
3
- namespace internal {
2
+ function assert(value: any, message?: string | Error): void;
3
+ namespace assert {
4
4
  class AssertionError implements Error {
5
5
  name: string;
6
6
  message: string;
@@ -22,9 +22,13 @@ declare module "assert" {
22
22
  /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
23
23
  function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
24
24
  function ok(value: any, message?: string | Error): void;
25
+ /** @deprecated since v9.9.0 - use strictEqual() instead. */
25
26
  function equal(actual: any, expected: any, message?: string | Error): void;
27
+ /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
26
28
  function notEqual(actual: any, expected: any, message?: string | Error): void;
29
+ /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
27
30
  function deepEqual(actual: any, expected: any, message?: string | Error): void;
31
+ /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
28
32
  function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
29
33
  function strictEqual(actual: any, expected: any, message?: string | Error): void;
30
34
  function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
@@ -46,8 +50,8 @@ declare module "assert" {
46
50
  function match(value: string, regExp: RegExp, message?: string | Error): void;
47
51
  function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
48
52
 
49
- const strict: typeof internal;
53
+ const strict: typeof assert;
50
54
  }
51
55
 
52
- export = internal;
56
+ export = assert;
53
57
  }
node/base.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  // base definnitions for all NodeJS modules that are not specific to any version of TypeScript
2
2
  /// <reference path="globals.d.ts" />
3
- /// <reference path="assert.d.ts" />
4
3
  /// <reference path="async_hooks.d.ts" />
5
4
  /// <reference path="buffer.d.ts" />
6
5
  /// <reference path="child_process.d.ts" />
node/index.d.ts CHANGED
@@ -59,6 +59,9 @@
59
59
  // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
60
60
  /// <reference path="base.d.ts" />
61
61
 
62
+ // We can't include assert.d.ts in base.d.ts, as it'll cause duplication errors in +ts3.7
63
+ /// <reference path="assert.d.ts" />
64
+
62
65
  // Forward-declarations for needed types from es2015 and later (in case users are using `--lib es5`)
63
66
  // Empty interfaces are used here which merge fine with the real declarations in the lib XXX files
64
67
  // just to ensure the names are known and node typings can be used without importing these libs.
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "13.13.1",
3
+ "version": "13.13.5",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -223,15 +223,20 @@
223
223
  "main": "",
224
224
  "types": "index.d.ts",
225
225
  "typesVersions": {
226
- ">=3.2.0-0": {
226
+ ">=3.7.0-0": {
227
227
  "*": [
228
- "ts3.2/*"
228
+ "ts3.7/*"
229
229
  ]
230
230
  },
231
231
  ">=3.5.0-0": {
232
232
  "*": [
233
233
  "ts3.5/*"
234
234
  ]
235
+ },
236
+ ">=3.2.0-0": {
237
+ "*": [
238
+ "ts3.2/*"
239
+ ]
235
240
  }
236
241
  },
237
242
  "repository": {
@@ -241,6 +246,6 @@
241
246
  },
242
247
  "scripts": {},
243
248
  "dependencies": {},
244
- "typesPublisherContentHash": "591b3799a73e412587cd03b0a69fd21b70f4b95fa606b60b698dc9c3f2593729",
245
- "typeScriptVersion": "2.8"
249
+ "typesPublisherContentHash": "b73ab9dec7a4e1a0914408fda9cc86996e74b29727d9bd10d86120cd7c7c7706",
250
+ "typeScriptVersion": "2.9"
246
251
  }
node/ts3.2/base.d.ts ADDED
@@ -0,0 +1,22 @@
1
+ // NOTE: These definitions support NodeJS and TypeScript 3.2.
2
+
3
+ // NOTE: TypeScript version-specific augmentations can be found in the following paths:
4
+ // - ~/base.d.ts - Shared definitions common to all TypeScript versions
5
+ // - ~/index.d.ts - Definitions specific to TypeScript 2.1
6
+ // - ~/ts3.2/base.d.ts - Definitions specific to TypeScript 3.2
7
+ // - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2 with assert pulled in
8
+
9
+ // Reference required types from the default lib:
10
+ /// <reference lib="es2018" />
11
+ /// <reference lib="esnext.asynciterable" />
12
+ /// <reference lib="esnext.intl" />
13
+ /// <reference lib="esnext.bigint" />
14
+
15
+ // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
16
+ // tslint:disable-next-line:no-bad-reference
17
+ /// <reference path="../base.d.ts" />
18
+
19
+ // TypeScript 3.2-specific augmentations:
20
+ /// <reference path="fs.d.ts" />
21
+ /// <reference path="util.d.ts" />
22
+ /// <reference path="globals.d.ts" />
node/ts3.2/index.d.ts CHANGED
@@ -1,16 +1,8 @@
1
1
  // NOTE: These definitions support NodeJS and TypeScript 3.2.
2
+ // This is requried to enable typing assert in ts3.7 without causing errors
3
+ // Typically type modifiations should be made in base.d.ts instead of here
2
4
 
3
- // Reference required types from the default lib:
4
- /// <reference lib="es2018" />
5
- /// <reference lib="esnext.asynciterable" />
6
- /// <reference lib="esnext.intl" />
7
- /// <reference lib="esnext.bigint" />
5
+ /// <reference path="base.d.ts" />
8
6
 
9
- // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
10
7
  // tslint:disable-next-line:no-bad-reference
11
- /// <reference path="../base.d.ts" />
12
-
13
- // TypeScript 3.2-specific augmentations:
14
- /// <reference path="fs.d.ts" />
15
- /// <reference path="util.d.ts" />
16
- /// <reference path="globals.d.ts" />
8
+ /// <reference path="../assert.d.ts" />
node/ts3.5/base.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ // NOTE: These definitions support NodeJS and TypeScript 3.5.
2
+
3
+ // NOTE: TypeScript version-specific augmentations can be found in the following paths:
4
+ // - ~/base.d.ts - Shared definitions common to all TypeScript versions
5
+ // - ~/index.d.ts - Definitions specific to TypeScript 2.1
6
+ // - ~/ts3.5/base.d.ts - Definitions specific to TypeScript 3.5
7
+ // - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.5 with assert pulled in
8
+
9
+ // Reference required types from the default lib:
10
+ /// <reference lib="es2018" />
11
+ /// <reference lib="esnext.asynciterable" />
12
+ /// <reference lib="esnext.intl" />
13
+ /// <reference lib="esnext.bigint" />
14
+
15
+ // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
16
+ // tslint:disable-next-line:no-bad-reference
17
+ /// <reference path="../ts3.2/base.d.ts" />
18
+
19
+ // TypeScript 3.5-specific augmentations:
20
+ /// <reference path="wasi.d.ts" />
node/ts3.5/index.d.ts CHANGED
@@ -1,14 +1,8 @@
1
1
  // NOTE: These definitions support NodeJS and TypeScript 3.5.
2
+ // This is requried to enable typing assert in ts3.7 without causing errors
3
+ // Typically type modifiations should be made in base.d.ts instead of here
2
4
 
3
- // Reference required types from the default lib:
4
- /// <reference lib="es2018" />
5
- /// <reference lib="esnext.asynciterable" />
6
- /// <reference lib="esnext.intl" />
7
- /// <reference lib="esnext.bigint" />
5
+ /// <reference path="base.d.ts" />
8
6
 
9
- // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
10
7
  // tslint:disable-next-line:no-bad-reference
11
- /// <reference path="../ts3.2/index.d.ts" />
12
-
13
- // TypeScript 3.5-specific augmentations:
14
- /// <reference path="wasi.d.ts" />
8
+ /// <reference path="../assert.d.ts" />
node/ts3.7/assert.d.ts ADDED
@@ -0,0 +1,57 @@
1
+ declare module "assert" {
2
+ function assert(value: any, message?: string | Error): asserts value;
3
+ namespace assert {
4
+ class AssertionError implements Error {
5
+ name: string;
6
+ message: string;
7
+ actual: any;
8
+ expected: any;
9
+ operator: string;
10
+ generatedMessage: boolean;
11
+ code: 'ERR_ASSERTION';
12
+
13
+ constructor(options?: {
14
+ message?: string; actual?: any; expected?: any;
15
+ operator?: string; stackStartFn?: Function
16
+ });
17
+ }
18
+
19
+ type AssertPredicate = RegExp | (new() => object) | ((thrown: any) => boolean) | object | Error;
20
+
21
+ function fail(message?: string | Error): never;
22
+ /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
23
+ function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
24
+ function ok(value: any, message?: string | Error): asserts value;
25
+ /** @deprecated since v9.9.0 - use strictEqual() instead. */
26
+ function equal(actual: any, expected: any, message?: string | Error): void;
27
+ /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
28
+ function notEqual(actual: any, expected: any, message?: string | Error): void;
29
+ /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
30
+ function deepEqual(actual: any, expected: any, message?: string | Error): void;
31
+ /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
32
+ function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
33
+ function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
34
+ function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
35
+ function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
36
+ function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
37
+
38
+ function throws(block: () => any, message?: string | Error): void;
39
+ function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
40
+ function doesNotThrow(block: () => any, message?: string | Error): void;
41
+ function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
42
+
43
+ function ifError(value: any): asserts value is null | undefined;
44
+
45
+ function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
46
+ function rejects(block: (() => Promise<any>) | Promise<any>, error: AssertPredicate, message?: string | Error): Promise<void>;
47
+ function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
48
+ function doesNotReject(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
49
+
50
+ function match(value: string, regExp: RegExp, message?: string | Error): void;
51
+ function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
52
+
53
+ const strict: typeof assert;
54
+ }
55
+
56
+ export = assert;
57
+ }
node/ts3.7/base.d.ts ADDED
@@ -0,0 +1,20 @@
1
+ // NOTE: These definitions support NodeJS and TypeScript 3.7.
2
+
3
+ // NOTE: TypeScript version-specific augmentations can be found in the following paths:
4
+ // - ~/base.d.ts - Shared definitions common to all TypeScript versions
5
+ // - ~/index.d.ts - Definitions specific to TypeScript 2.1
6
+ // - ~/ts3.7/base.d.ts - Definitions specific to TypeScript 3.7
7
+ // - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in
8
+
9
+ // Reference required types from the default lib:
10
+ /// <reference lib="es2018" />
11
+ /// <reference lib="esnext.asynciterable" />
12
+ /// <reference lib="esnext.intl" />
13
+ /// <reference lib="esnext.bigint" />
14
+
15
+ // Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
16
+ // tslint:disable-next-line:no-bad-reference
17
+ /// <reference path="../ts3.5/base.d.ts" />
18
+
19
+ // TypeScript 3.7-specific augmentations:
20
+ /// <reference path="assert.d.ts" />
node/ts3.7/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ // NOTE: These definitions support NodeJS and TypeScript 3.7.
2
+ // This isn't strictly needed since 3.7 has the assert module, but this way we're consistent.
3
+ // Typically type modificatons should be made in base.d.ts instead of here
4
+
5
+ /// <reference path="base.d.ts" />
node/worker_threads.d.ts CHANGED
@@ -105,29 +105,6 @@ declare module "worker_threads" {
105
105
  * Returns a Promise for the exit code that is fulfilled when the `exit` event is emitted.
106
106
  */
107
107
  terminate(): Promise<number>;
108
- /**
109
- * Transfer a `MessagePort` to a different `vm` Context. The original `port`
110
- * object will be rendered unusable, and the returned `MessagePort` instance will
111
- * take its place.
112
- *
113
- * The returned `MessagePort` will be an object in the target context, and will
114
- * inherit from its global `Object` class. Objects passed to the
115
- * `port.onmessage()` listener will also be created in the target context
116
- * and inherit from its global `Object` class.
117
- *
118
- * However, the created `MessagePort` will no longer inherit from
119
- * `EventEmitter`, and only `port.onmessage()` can be used to receive
120
- * events using it.
121
- */
122
- moveMessagePortToContext(port: MessagePort, context: Context): MessagePort;
123
-
124
- /**
125
- * Receive a single message from a given `MessagePort`. If no message is available,
126
- * `undefined` is returned, otherwise an object with a single `message` property
127
- * that contains the message payload, corresponding to the oldest message in the
128
- * `MessagePort`’s queue.
129
- */
130
- receiveMessageOnPort(port: MessagePort): {} | undefined;
131
108
 
132
109
  /**
133
110
  * Returns a readable stream for a V8 snapshot of the current state of the Worker.
@@ -187,4 +164,28 @@ declare module "worker_threads" {
187
164
  off(event: "online", listener: () => void): this;
188
165
  off(event: string | symbol, listener: (...args: any[]) => void): this;
189
166
  }
167
+
168
+ /**
169
+ * Transfer a `MessagePort` to a different `vm` Context. The original `port`
170
+ * object will be rendered unusable, and the returned `MessagePort` instance will
171
+ * take its place.
172
+ *
173
+ * The returned `MessagePort` will be an object in the target context, and will
174
+ * inherit from its global `Object` class. Objects passed to the
175
+ * `port.onmessage()` listener will also be created in the target context
176
+ * and inherit from its global `Object` class.
177
+ *
178
+ * However, the created `MessagePort` will no longer inherit from
179
+ * `EventEmitter`, and only `port.onmessage()` can be used to receive
180
+ * events using it.
181
+ */
182
+ function moveMessagePortToContext(port: MessagePort, context: Context): MessagePort;
183
+
184
+ /**
185
+ * Receive a single message from a given `MessagePort`. If no message is available,
186
+ * `undefined` is returned, otherwise an object with a single `message` property
187
+ * that contains the message payload, corresponding to the oldest message in the
188
+ * `MessagePort`’s queue.
189
+ */
190
+ function receiveMessageOnPort(port: MessagePort): { message: any } | undefined;
190
191
  }