@types/node 14.14.9 → 14.14.13

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: Thu, 19 Nov 2020 21:27:20 GMT
11
+ * Last updated: Sat, 12 Dec 2020 17:18:07 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14
14
 
node/assert.d.ts CHANGED
@@ -21,6 +21,7 @@ declare module 'assert' {
21
21
  /** The `operator` property on the error instance. */
22
22
  operator?: string;
23
23
  /** If provided, the generated stack trace omits frames before this function. */
24
+ // tslint:disable-next-line:ban-types
24
25
  stackStartFn?: Function;
25
26
  });
26
27
  }
@@ -52,6 +53,7 @@ declare module 'assert' {
52
53
  expected: any,
53
54
  message?: string | Error,
54
55
  operator?: string,
56
+ // tslint:disable-next-line:ban-types
55
57
  stackStartFn?: Function,
56
58
  ): never;
57
59
  function ok(value: any, message?: string | Error): asserts value;
@@ -71,7 +73,7 @@ declare module 'assert' {
71
73
  function throws(block: () => any, message?: string | Error): void;
72
74
  function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73
75
  function doesNotThrow(block: () => any, message?: string | Error): void;
74
- function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
76
+ function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
75
77
 
76
78
  function ifError(value: any): asserts value is null | undefined;
77
79
 
@@ -84,7 +86,7 @@ declare module 'assert' {
84
86
  function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
85
87
  function doesNotReject(
86
88
  block: (() => Promise<any>) | Promise<any>,
87
- error: RegExp | Function,
89
+ error: AssertPredicate,
88
90
  message?: string | Error,
89
91
  ): Promise<void>;
90
92
 
node/globals.d.ts CHANGED
@@ -73,6 +73,8 @@ declare var exports: any;
73
73
  // Buffer class
74
74
  type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
75
75
 
76
+ type WithImplicitCoercion<T> = T | { valueOf(): T };
77
+
76
78
  /**
77
79
  * Raw data is stored in instances of the Buffer class.
78
80
  * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
@@ -132,25 +134,19 @@ declare class Buffer extends Uint8Array {
132
134
  *
133
135
  * @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer()
134
136
  */
135
- static from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer;
137
+ static from(arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, byteOffset?: number, length?: number): Buffer;
136
138
  /**
137
139
  * Creates a new Buffer using the passed {data}
138
140
  * @param data data to create a new Buffer
139
141
  */
140
- static from(data: ReadonlyArray<number>): Buffer;
141
- static from(data: Uint8Array): Buffer;
142
- /**
143
- * Creates a new buffer containing the coerced value of an object
144
- * A `TypeError` will be thrown if {obj} has not mentioned methods or is not of other type appropriate for `Buffer.from()` variants.
145
- * @param obj An object supporting `Symbol.toPrimitive` or `valueOf()`.
146
- */
147
- static from(obj: { valueOf(): string | object } | { [Symbol.toPrimitive](hint: 'string'): string }, byteOffset?: number, length?: number): Buffer;
142
+ static from(data: Uint8Array | ReadonlyArray<number>): Buffer;
143
+ static from(data: WithImplicitCoercion<Uint8Array | ReadonlyArray<number> | string>): Buffer;
148
144
  /**
149
145
  * Creates a new Buffer containing the given JavaScript string {str}.
150
146
  * If provided, the {encoding} parameter identifies the character encoding.
151
147
  * If not provided, {encoding} defaults to 'utf8'.
152
148
  */
153
- static from(str: string, encoding?: BufferEncoding): Buffer;
149
+ static from(str: WithImplicitCoercion<string> | { [Symbol.toPrimitive](hint: 'string'): string }, encoding?: BufferEncoding): Buffer;
154
150
  /**
155
151
  * Creates a new Buffer using the passed {data}
156
152
  * @param values to create a new Buffer
@@ -555,7 +551,18 @@ declare namespace NodeJS {
555
551
  [Symbol.toPrimitive](): number;
556
552
  }
557
553
 
558
- type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
554
+ type TypedArray =
555
+ | Uint8Array
556
+ | Uint8ClampedArray
557
+ | Uint16Array
558
+ | Uint32Array
559
+ | Int8Array
560
+ | Int16Array
561
+ | Int32Array
562
+ | BigUint64Array
563
+ | BigInt64Array
564
+ | Float32Array
565
+ | Float64Array;
559
566
  type ArrayBufferView = TypedArray | DataView;
560
567
 
561
568
  interface Require {
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.14.9",
3
+ "version": "14.14.13",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -246,6 +246,6 @@
246
246
  },
247
247
  "scripts": {},
248
248
  "dependencies": {},
249
- "typesPublisherContentHash": "2f042275fd4e9e164f29f7f2c8d2480c637feb8732124486b1f906ff0d1f4dc3",
250
- "typeScriptVersion": "3.2"
249
+ "typesPublisherContentHash": "2d2baa6ba176af581ab0526fbd1ecf8426794040c566cca82cf3f03d6778229f",
250
+ "typeScriptVersion": "3.3"
251
251
  }
node/tls.d.ts CHANGED
@@ -436,7 +436,7 @@ declare module "tls" {
436
436
 
437
437
  interface PSKCallbackNegotation {
438
438
  psk: DataView | NodeJS.TypedArray;
439
- identitty: string;
439
+ identity: string;
440
440
  }
441
441
 
442
442
  interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
node/ts3.4/assert.d.ts CHANGED
@@ -21,6 +21,7 @@ declare module 'assert' {
21
21
  /** The `operator` property on the error instance. */
22
22
  operator?: string;
23
23
  /** If provided, the generated stack trace omits frames before this function. */
24
+ // tslint:disable-next-line:ban-types
24
25
  stackStartFn?: Function;
25
26
  });
26
27
  }
@@ -52,6 +53,7 @@ declare module 'assert' {
52
53
  expected: any,
53
54
  message?: string | Error,
54
55
  operator?: string,
56
+ // tslint:disable-next-line:ban-types
55
57
  stackStartFn?: Function,
56
58
  ): never;
57
59
  function ok(value: any, message?: string | Error): void;
@@ -71,7 +73,7 @@ declare module 'assert' {
71
73
  function throws(block: () => any, message?: string | Error): void;
72
74
  function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73
75
  function doesNotThrow(block: () => any, message?: string | Error): void;
74
- function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
76
+ function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
75
77
 
76
78
  function ifError(value: any): void;
77
79
 
@@ -84,7 +86,7 @@ declare module 'assert' {
84
86
  function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
85
87
  function doesNotReject(
86
88
  block: (() => Promise<any>) | Promise<any>,
87
- error: RegExp | Function,
89
+ error: AssertPredicate,
88
90
  message?: string | Error,
89
91
  ): Promise<void>;
90
92
 
node/util.d.ts CHANGED
@@ -120,46 +120,57 @@ declare module "util" {
120
120
  }
121
121
 
122
122
  namespace types {
123
- function isAnyArrayBuffer(object: any): boolean;
123
+ function isAnyArrayBuffer(object: any): object is ArrayBufferLike;
124
124
  function isArgumentsObject(object: any): object is IArguments;
125
125
  function isArrayBuffer(object: any): object is ArrayBuffer;
126
- function isArrayBufferView(object: any): object is ArrayBufferView;
126
+ function isArrayBufferView(object: any): object is NodeJS.ArrayBufferView;
127
127
  function isAsyncFunction(object: any): boolean;
128
128
  function isBigInt64Array(value: any): value is BigInt64Array;
129
129
  function isBigUint64Array(value: any): value is BigUint64Array;
130
130
  function isBooleanObject(object: any): object is Boolean;
131
- function isBoxedPrimitive(object: any): object is (Number | Boolean | String | Symbol /* | Object(BigInt) | Object(Symbol) */);
131
+ function isBoxedPrimitive(object: any): object is String | Number | BigInt | Boolean | Symbol;
132
132
  function isDataView(object: any): object is DataView;
133
133
  function isDate(object: any): object is Date;
134
134
  function isExternal(object: any): boolean;
135
135
  function isFloat32Array(object: any): object is Float32Array;
136
136
  function isFloat64Array(object: any): object is Float64Array;
137
- function isGeneratorFunction(object: any): boolean;
138
- function isGeneratorObject(object: any): boolean;
137
+ function isGeneratorFunction(object: any): object is GeneratorFunction;
138
+ function isGeneratorObject(object: any): object is Generator;
139
139
  function isInt8Array(object: any): object is Int8Array;
140
140
  function isInt16Array(object: any): object is Int16Array;
141
141
  function isInt32Array(object: any): object is Int32Array;
142
- function isMap(object: any): boolean;
142
+ function isMap<T>(
143
+ object: T | {},
144
+ ): object is T extends ReadonlyMap<any, any>
145
+ ? unknown extends T
146
+ ? never
147
+ : ReadonlyMap<any, any>
148
+ : Map<any, any>;
143
149
  function isMapIterator(object: any): boolean;
144
150
  function isModuleNamespaceObject(value: any): boolean;
145
151
  function isNativeError(object: any): object is Error;
146
152
  function isNumberObject(object: any): object is Number;
147
- function isPromise(object: any): boolean;
153
+ function isPromise(object: any): object is Promise<any>;
148
154
  function isProxy(object: any): boolean;
149
155
  function isRegExp(object: any): object is RegExp;
150
- function isSet(object: any): boolean;
156
+ function isSet<T>(
157
+ object: T | {},
158
+ ): object is T extends ReadonlySet<any>
159
+ ? unknown extends T
160
+ ? never
161
+ : ReadonlySet<any>
162
+ : Set<any>;
151
163
  function isSetIterator(object: any): boolean;
152
- function isSharedArrayBuffer(object: any): boolean;
153
- function isStringObject(object: any): boolean;
154
- function isSymbolObject(object: any): boolean;
164
+ function isSharedArrayBuffer(object: any): object is SharedArrayBuffer;
165
+ function isStringObject(object: any): object is String;
166
+ function isSymbolObject(object: any): object is Symbol;
155
167
  function isTypedArray(object: any): object is NodeJS.TypedArray;
156
168
  function isUint8Array(object: any): object is Uint8Array;
157
169
  function isUint8ClampedArray(object: any): object is Uint8ClampedArray;
158
170
  function isUint16Array(object: any): object is Uint16Array;
159
171
  function isUint32Array(object: any): object is Uint32Array;
160
- function isWeakMap(object: any): boolean;
161
- function isWeakSet(object: any): boolean;
162
- function isWebAssemblyCompiledModule(object: any): boolean;
172
+ function isWeakMap(object: any): object is WeakMap<any, any>;
173
+ function isWeakSet(object: any): object is WeakSet<any>;
163
174
  }
164
175
 
165
176
  class TextDecoder {