@types/node 12.6.4 → 12.6.8

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,9 +8,9 @@ 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: Tue, 16 Jul 2019 17:19:16 GMT
11
+ * Last updated: Wed, 17 Jul 2019 19:14:44 GMT
12
12
  * Dependencies: none
13
13
  * Global values: Buffer, NodeJS, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, queueMicrotask, require, setImmediate, setInterval, setTimeout
14
14
 
15
15
  # Credits
16
- These definitions were written by Microsoft TypeScript <https://github.com/Microsoft>, DefinitelyTyped <https://github.com/DefinitelyTyped>, Alberto Schiabel <https://github.com/jkomyno>, Alexander T. <https://github.com/a-tarasyuk>, Alvis HT Tang <https://github.com/alvis>, Andrew Makarov <https://github.com/r3nya>, Benjamin Toueg <https://github.com/btoueg>, Bruno Scheufler <https://github.com/brunoscheufler>, Chigozirim C. <https://github.com/smac89>, Christian Vaagland Tellnes <https://github.com/tellnes>, David Junger <https://github.com/touffy>, Deividas Bakanas <https://github.com/DeividasBakanas>, Eugene Y. Q. Shen <https://github.com/eyqs>, Flarna <https://github.com/Flarna>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Hoàng Văn Khải <https://github.com/KSXGitHub>, Huw <https://github.com/hoo29>, Kelvin Jin <https://github.com/kjin>, Klaus Meinhardt <https://github.com/ajafff>, Lishude <https://github.com/islishude>, Mariusz Wiktorczyk <https://github.com/mwiktorczyk>, Matthieu Sieben <https://github.com/matthieusieben>, Mohsen Azimi <https://github.com/mohsen1>, Nicolas Even <https://github.com/n-e>, Nicolas Voigt <https://github.com/octo-sniffle>, Parambir Singh <https://github.com/parambirs>, Sebastian Silbermann <https://github.com/eps1lon>, Simon Schick <https://github.com/SimonSchick>, Thomas den Hollander <https://github.com/ThomasdenH>, Wilco Bakker <https://github.com/WilcoBakker>, wwwy3y3 <https://github.com/wwwy3y3>, Zane Hannan AU <https://github.com/ZaneHannanAU>, Jeremie Rodriguez <https://github.com/jeremiergz>, Samuel Ainsworth <https://github.com/samuela>, Kyle Uehlein <https://github.com/kuehlein>, Jordi Oliveras Rovira <https://github.com/j-oliveras>, and Thanik Bhongbhibhat <https://github.com/bhongy>.
16
+ These definitions were written by Microsoft TypeScript <https://github.com/Microsoft>, DefinitelyTyped <https://github.com/DefinitelyTyped>, Alberto Schiabel <https://github.com/jkomyno>, Alexander T. <https://github.com/a-tarasyuk>, Alvis HT Tang <https://github.com/alvis>, Andrew Makarov <https://github.com/r3nya>, Benjamin Toueg <https://github.com/btoueg>, Bruno Scheufler <https://github.com/brunoscheufler>, Chigozirim C. <https://github.com/smac89>, Christian Vaagland Tellnes <https://github.com/tellnes>, David Junger <https://github.com/touffy>, Deividas Bakanas <https://github.com/DeividasBakanas>, Eugene Y. Q. Shen <https://github.com/eyqs>, Flarna <https://github.com/Flarna>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Hoàng Văn Khải <https://github.com/KSXGitHub>, Huw <https://github.com/hoo29>, Kelvin Jin <https://github.com/kjin>, Klaus Meinhardt <https://github.com/ajafff>, Lishude <https://github.com/islishude>, Mariusz Wiktorczyk <https://github.com/mwiktorczyk>, Matthieu Sieben <https://github.com/matthieusieben>, Mohsen Azimi <https://github.com/mohsen1>, Nicolas Even <https://github.com/n-e>, Nicolas Voigt <https://github.com/octo-sniffle>, Parambir Singh <https://github.com/parambirs>, Sebastian Silbermann <https://github.com/eps1lon>, Simon Schick <https://github.com/SimonSchick>, Thomas den Hollander <https://github.com/ThomasdenH>, Wilco Bakker <https://github.com/WilcoBakker>, wwwy3y3 <https://github.com/wwwy3y3>, Zane Hannan AU <https://github.com/ZaneHannanAU>, Samuel Ainsworth <https://github.com/samuela>, Kyle Uehlein <https://github.com/kuehlein>, Jordi Oliveras Rovira <https://github.com/j-oliveras>, and Thanik Bhongbhibhat <https://github.com/bhongy>.
node/buffer.d.ts CHANGED
@@ -10,7 +10,7 @@ declare module "buffer" {
10
10
 
11
11
  export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
12
12
 
13
- export function transcode(source: Buffer | Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
13
+ export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
14
14
 
15
15
  export const SlowBuffer: {
16
16
  /** @deprecated since v6.0.0, use Buffer.allocUnsafeSlow() */
node/child_process.d.ts CHANGED
@@ -296,7 +296,7 @@ declare module "child_process" {
296
296
 
297
297
  interface SpawnSyncOptions extends CommonOptions {
298
298
  argv0?: string; // Not specified in the docs
299
- input?: string | Buffer | NodeJS.TypedArray | DataView;
299
+ input?: string | NodeJS.TypedArray | DataView;
300
300
  stdio?: StdioOptions;
301
301
  killSignal?: string | number;
302
302
  maxBuffer?: number;
@@ -328,7 +328,7 @@ declare module "child_process" {
328
328
  function spawnSync(command: string, args?: ReadonlyArray<string>, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;
329
329
 
330
330
  interface ExecSyncOptions extends CommonOptions {
331
- input?: string | Buffer | Uint8Array;
331
+ input?: string | Uint8Array;
332
332
  stdio?: StdioOptions;
333
333
  shell?: string;
334
334
  killSignal?: string | number;
@@ -347,7 +347,7 @@ declare module "child_process" {
347
347
  function execSync(command: string, options?: ExecSyncOptions): Buffer;
348
348
 
349
349
  interface ExecFileSyncOptions extends CommonOptions {
350
- input?: string | Buffer | NodeJS.TypedArray | DataView;
350
+ input?: string | NodeJS.TypedArray | DataView;
351
351
  stdio?: StdioOptions;
352
352
  killSignal?: string | number;
353
353
  maxBuffer?: number;
node/crypto.d.ts CHANGED
@@ -159,7 +159,7 @@ declare module "crypto" {
159
159
  type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm';
160
160
  type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';
161
161
 
162
- type Binary = Buffer | NodeJS.TypedArray | DataView;
162
+ type Binary = NodeJS.TypedArray | DataView;
163
163
  type BinaryLike = string | Binary;
164
164
 
165
165
  type CipherKey = BinaryLike | KeyObject;
@@ -296,7 +296,7 @@ declare module "crypto" {
296
296
  sign(private_key: SignPrivateKeyInput | KeyLike, output_format: HexBase64Latin1Encoding): string;
297
297
  }
298
298
 
299
- function createVerify(algorith: string, options?: stream.WritableOptions): Verify;
299
+ function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
300
300
  class Verify extends stream.Writable {
301
301
  private constructor();
302
302
 
node/dgram.d.ts CHANGED
@@ -34,8 +34,8 @@ declare module "dgram" {
34
34
  function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
35
35
 
36
36
  class Socket extends events.EventEmitter {
37
- send(msg: Buffer | string | Uint8Array | any[], port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
38
- send(msg: Buffer | string | Uint8Array, offset: number, length: number, port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
37
+ send(msg: string | Uint8Array | any[], port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
38
+ send(msg: string | Uint8Array, offset: number, length: number, port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
39
39
  bind(port?: number, address?: string, callback?: () => void): void;
40
40
  bind(port?: number, callback?: () => void): void;
41
41
  bind(callback?: () => void): void;
node/fs.d.ts CHANGED
@@ -8,7 +8,7 @@ declare module "fs" {
8
8
  */
9
9
  type PathLike = string | Buffer | URL;
10
10
 
11
- type BinaryData = Buffer | DataView | NodeJS.TypedArray;
11
+ type BinaryData = DataView | NodeJS.TypedArray;
12
12
  class Stats {
13
13
  isFile(): boolean;
14
14
  isDirectory(): boolean;
@@ -1724,6 +1724,7 @@ declare module "fs" {
1724
1724
  mode?: number;
1725
1725
  autoClose?: boolean;
1726
1726
  start?: number;
1727
+ highWaterMark?: number;
1727
1728
  }): WriteStream;
1728
1729
 
1729
1730
  /**
@@ -1846,7 +1847,7 @@ declare module "fs" {
1846
1847
  * @param length The number of bytes to read.
1847
1848
  * @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
1848
1849
  */
1849
- read<TBuffer extends Buffer | Uint8Array>(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>;
1850
+ read<TBuffer extends Uint8Array>(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>;
1850
1851
 
1851
1852
  /**
1852
1853
  * Asynchronously reads the entire contents of a file. The underlying file will _not_ be closed automatically.
@@ -1898,7 +1899,7 @@ declare module "fs" {
1898
1899
  * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
1899
1900
  * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
1900
1901
  */
1901
- write<TBuffer extends Buffer | Uint8Array>(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>;
1902
+ write<TBuffer extends Uint8Array>(buffer: TBuffer, offset?: number | null, length?: number | null, position?: number | null): Promise<{ bytesWritten: number, buffer: TBuffer }>;
1902
1903
 
1903
1904
  /**
1904
1905
  * Asynchronously writes `string` to the file.
@@ -1967,7 +1968,7 @@ declare module "fs" {
1967
1968
  * @param position The offset from the beginning of the file from which data should be read. If
1968
1969
  * `null`, data will be read from the current position.
1969
1970
  */
1970
- function read<TBuffer extends Buffer | Uint8Array>(
1971
+ function read<TBuffer extends Uint8Array>(
1971
1972
  handle: FileHandle,
1972
1973
  buffer: TBuffer,
1973
1974
  offset?: number | null,
@@ -1985,7 +1986,7 @@ declare module "fs" {
1985
1986
  * @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
1986
1987
  * @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
1987
1988
  */
1988
- function write<TBuffer extends Buffer | Uint8Array>(
1989
+ function write<TBuffer extends Uint8Array>(
1989
1990
  handle: FileHandle,
1990
1991
  buffer: TBuffer,
1991
1992
  offset?: number | null,
node/globals.d.ts CHANGED
@@ -238,81 +238,9 @@ declare var exports: any;
238
238
 
239
239
  // Buffer class
240
240
  type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
241
- interface Buffer extends Uint8Array {
241
+
242
+ interface Buffer {
242
243
  constructor: typeof Buffer;
243
- write(string: string, encoding?: BufferEncoding): number;
244
- write(string: string, offset: number, encoding?: BufferEncoding): number;
245
- write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
246
- toString(encoding?: string, start?: number, end?: number): string;
247
- toJSON(): { type: 'Buffer', data: number[] };
248
- equals(otherBuffer: Uint8Array): boolean;
249
- compare(otherBuffer: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
250
- copy(targetBuffer: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
251
- /**
252
- * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
253
- *
254
- * This method is incompatible with `Uint8Array#slice()`, which returns a copy of the original memory.
255
- *
256
- * @param begin Where the new `Buffer` will start. Default: `0`.
257
- * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
258
- */
259
- slice(begin?: number, end?: number): Buffer;
260
- /**
261
- * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
262
- *
263
- * This method is compatible with `Uint8Array#subarray()`.
264
- *
265
- * @param begin Where the new `Buffer` will start. Default: `0`.
266
- * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
267
- */
268
- subarray(begin?: number, end?: number): Buffer;
269
- writeUIntLE(value: number, offset: number, byteLength: number): number;
270
- writeUIntBE(value: number, offset: number, byteLength: number): number;
271
- writeIntLE(value: number, offset: number, byteLength: number): number;
272
- writeIntBE(value: number, offset: number, byteLength: number): number;
273
- readUIntLE(offset: number, byteLength: number): number;
274
- readUIntBE(offset: number, byteLength: number): number;
275
- readIntLE(offset: number, byteLength: number): number;
276
- readIntBE(offset: number, byteLength: number): number;
277
- readUInt8(offset: number): number;
278
- readUInt16LE(offset: number): number;
279
- readUInt16BE(offset: number): number;
280
- readUInt32LE(offset: number): number;
281
- readUInt32BE(offset: number): number;
282
- readInt8(offset: number): number;
283
- readInt16LE(offset: number): number;
284
- readInt16BE(offset: number): number;
285
- readInt32LE(offset: number): number;
286
- readInt32BE(offset: number): number;
287
- readFloatLE(offset: number): number;
288
- readFloatBE(offset: number): number;
289
- readDoubleLE(offset: number): number;
290
- readDoubleBE(offset: number): number;
291
- reverse(): this;
292
- swap16(): Buffer;
293
- swap32(): Buffer;
294
- swap64(): Buffer;
295
- writeUInt8(value: number, offset: number): number;
296
- writeUInt16LE(value: number, offset: number): number;
297
- writeUInt16BE(value: number, offset: number): number;
298
- writeUInt32LE(value: number, offset: number): number;
299
- writeUInt32BE(value: number, offset: number): number;
300
- writeInt8(value: number, offset: number): number;
301
- writeInt16LE(value: number, offset: number): number;
302
- writeInt16BE(value: number, offset: number): number;
303
- writeInt32LE(value: number, offset: number): number;
304
- writeInt32BE(value: number, offset: number): number;
305
- writeFloatLE(value: number, offset: number): number;
306
- writeFloatBE(value: number, offset: number): number;
307
- writeDoubleLE(value: number, offset: number): number;
308
- writeDoubleBE(value: number, offset: number): number;
309
- fill(value: any, offset?: number, end?: number): this;
310
- indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
311
- lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
312
- entries(): IterableIterator<[number, number]>;
313
- includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
314
- keys(): IterableIterator<number>;
315
- values(): IterableIterator<number>;
316
244
  }
317
245
 
318
246
  /**
@@ -320,7 +248,7 @@ interface Buffer extends Uint8Array {
320
248
  * 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.
321
249
  * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
322
250
  */
323
- declare const Buffer: {
251
+ declare class Buffer extends Uint8Array {
324
252
  /**
325
253
  * Allocates a new buffer containing the given {str}.
326
254
  *
@@ -328,21 +256,21 @@ declare const Buffer: {
328
256
  * @param encoding encoding to use, optional. Default is 'utf8'
329
257
  * @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
330
258
  */
331
- new (str: string, encoding?: BufferEncoding): Buffer;
259
+ constructor(str: string, encoding?: BufferEncoding);
332
260
  /**
333
261
  * Allocates a new buffer of {size} octets.
334
262
  *
335
263
  * @param size count of octets to allocate.
336
264
  * @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
337
265
  */
338
- new (size: number): Buffer;
266
+ constructor(size: number);
339
267
  /**
340
268
  * Allocates a new buffer containing the given {array} of octets.
341
269
  *
342
270
  * @param array The octets to store.
343
271
  * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
344
272
  */
345
- new (array: Uint8Array): Buffer;
273
+ constructor(array: Uint8Array);
346
274
  /**
347
275
  * Produces a Buffer backed by the same allocated memory as
348
276
  * the given {ArrayBuffer}/{SharedArrayBuffer}.
@@ -351,22 +279,21 @@ declare const Buffer: {
351
279
  * @param arrayBuffer The ArrayBuffer with which to share memory.
352
280
  * @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
353
281
  */
354
- new (arrayBuffer: ArrayBuffer | SharedArrayBuffer): Buffer;
282
+ constructor(arrayBuffer: ArrayBuffer | SharedArrayBuffer);
355
283
  /**
356
284
  * Allocates a new buffer containing the given {array} of octets.
357
285
  *
358
286
  * @param array The octets to store.
359
287
  * @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
360
288
  */
361
- new (array: any[]): Buffer;
289
+ constructor(array: any[]);
362
290
  /**
363
291
  * Copies the passed {buffer} data onto a new {Buffer} instance.
364
292
  *
365
293
  * @param buffer The buffer to copy.
366
294
  * @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
367
295
  */
368
- new (buffer: Buffer): Buffer;
369
- prototype: Buffer;
296
+ constructor(buffer: Buffer);
370
297
  /**
371
298
  * When passed a reference to the .buffer property of a TypedArray instance,
372
299
  * the newly created Buffer will share the same allocated memory as the TypedArray.
@@ -375,37 +302,37 @@ declare const Buffer: {
375
302
  *
376
303
  * @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer()
377
304
  */
378
- from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer;
305
+ static from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer;
379
306
  /**
380
307
  * Creates a new Buffer using the passed {data}
381
308
  * @param data data to create a new Buffer
382
309
  */
383
- from(data: number[]): Buffer;
384
- from(data: Uint8Array): Buffer;
310
+ static from(data: number[]): Buffer;
311
+ static from(data: Uint8Array): Buffer;
385
312
  /**
386
313
  * Creates a new Buffer containing the given JavaScript string {str}.
387
314
  * If provided, the {encoding} parameter identifies the character encoding.
388
315
  * If not provided, {encoding} defaults to 'utf8'.
389
316
  */
390
- from(str: string, encoding?: BufferEncoding): Buffer;
317
+ static from(str: string, encoding?: BufferEncoding): Buffer;
391
318
  /**
392
319
  * Creates a new Buffer using the passed {data}
393
320
  * @param values to create a new Buffer
394
321
  */
395
- of(...items: number[]): Buffer;
322
+ static of(...items: number[]): Buffer;
396
323
  /**
397
324
  * Returns true if {obj} is a Buffer
398
325
  *
399
326
  * @param obj object to test.
400
327
  */
401
- isBuffer(obj: any): obj is Buffer;
328
+ static isBuffer(obj: any): obj is Buffer;
402
329
  /**
403
330
  * Returns true if {encoding} is a valid encoding argument.
404
331
  * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'
405
332
  *
406
333
  * @param encoding string to test.
407
334
  */
408
- isEncoding(encoding: string): encoding is BufferEncoding;
335
+ static isEncoding(encoding: string): encoding is BufferEncoding;
409
336
  /**
410
337
  * Gives the actual byte length of a string. encoding defaults to 'utf8'.
411
338
  * This is not the same as String.prototype.length since that returns the number of characters in a string.
@@ -413,7 +340,7 @@ declare const Buffer: {
413
340
  * @param string string to test.
414
341
  * @param encoding encoding used to evaluate (defaults to 'utf8')
415
342
  */
416
- byteLength(
343
+ static byteLength(
417
344
  string: string | NodeJS.TypedArray | DataView | ArrayBuffer | SharedArrayBuffer,
418
345
  encoding?: BufferEncoding
419
346
  ): number;
@@ -428,11 +355,11 @@ declare const Buffer: {
428
355
  * @param totalLength Total length of the buffers when concatenated.
429
356
  * If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
430
357
  */
431
- concat(list: Uint8Array[], totalLength?: number): Buffer;
358
+ static concat(list: Uint8Array[], totalLength?: number): Buffer;
432
359
  /**
433
360
  * The same as buf1.compare(buf2).
434
361
  */
435
- compare(buf1: Uint8Array, buf2: Uint8Array): number;
362
+ static compare(buf1: Uint8Array, buf2: Uint8Array): number;
436
363
  /**
437
364
  * Allocates a new buffer of {size} octets.
438
365
  *
@@ -441,26 +368,108 @@ declare const Buffer: {
441
368
  * If parameter is omitted, buffer will be filled with zeros.
442
369
  * @param encoding encoding used for call to buf.fill while initalizing
443
370
  */
444
- alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer;
371
+ static alloc(size: number, fill?: string | Buffer | number, encoding?: BufferEncoding): Buffer;
445
372
  /**
446
373
  * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents
447
374
  * of the newly created Buffer are unknown and may contain sensitive data.
448
375
  *
449
376
  * @param size count of octets to allocate
450
377
  */
451
- allocUnsafe(size: number): Buffer;
378
+ static allocUnsafe(size: number): Buffer;
452
379
  /**
453
380
  * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents
454
381
  * of the newly created Buffer are unknown and may contain sensitive data.
455
382
  *
456
383
  * @param size count of octets to allocate
457
384
  */
458
- allocUnsafeSlow(size: number): Buffer;
385
+ static allocUnsafeSlow(size: number): Buffer;
459
386
  /**
460
387
  * This is the number of bytes used to determine the size of pre-allocated, internal Buffer instances used for pooling. This value may be modified.
461
388
  */
462
- poolSize: number;
463
- };
389
+ static poolSize: number;
390
+
391
+ write(string: string, encoding?: BufferEncoding): number;
392
+ write(string: string, offset: number, encoding?: BufferEncoding): number;
393
+ write(string: string, offset: number, length: number, encoding?: BufferEncoding): number;
394
+ toString(encoding?: string, start?: number, end?: number): string;
395
+ toJSON(): { type: 'Buffer'; data: number[] };
396
+ equals(otherBuffer: Uint8Array): boolean;
397
+ compare(
398
+ otherBuffer: Uint8Array,
399
+ targetStart?: number,
400
+ targetEnd?: number,
401
+ sourceStart?: number,
402
+ sourceEnd?: number
403
+ ): number;
404
+ copy(targetBuffer: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
405
+ /**
406
+ * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
407
+ *
408
+ * This method is incompatible with `Uint8Array#slice()`, which returns a copy of the original memory.
409
+ *
410
+ * @param begin Where the new `Buffer` will start. Default: `0`.
411
+ * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
412
+ */
413
+ slice(begin?: number, end?: number): Buffer;
414
+ /**
415
+ * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
416
+ *
417
+ * This method is compatible with `Uint8Array#subarray()`.
418
+ *
419
+ * @param begin Where the new `Buffer` will start. Default: `0`.
420
+ * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
421
+ */
422
+ subarray(begin?: number, end?: number): Buffer;
423
+ writeUIntLE(value: number, offset: number, byteLength: number): number;
424
+ writeUIntBE(value: number, offset: number, byteLength: number): number;
425
+ writeIntLE(value: number, offset: number, byteLength: number): number;
426
+ writeIntBE(value: number, offset: number, byteLength: number): number;
427
+ readUIntLE(offset: number, byteLength: number): number;
428
+ readUIntBE(offset: number, byteLength: number): number;
429
+ readIntLE(offset: number, byteLength: number): number;
430
+ readIntBE(offset: number, byteLength: number): number;
431
+ readUInt8(offset: number): number;
432
+ readUInt16LE(offset: number): number;
433
+ readUInt16BE(offset: number): number;
434
+ readUInt32LE(offset: number): number;
435
+ readUInt32BE(offset: number): number;
436
+ readInt8(offset: number): number;
437
+ readInt16LE(offset: number): number;
438
+ readInt16BE(offset: number): number;
439
+ readInt32LE(offset: number): number;
440
+ readInt32BE(offset: number): number;
441
+ readFloatLE(offset: number): number;
442
+ readFloatBE(offset: number): number;
443
+ readDoubleLE(offset: number): number;
444
+ readDoubleBE(offset: number): number;
445
+ reverse(): this;
446
+ swap16(): Buffer;
447
+ swap32(): Buffer;
448
+ swap64(): Buffer;
449
+ writeUInt8(value: number, offset: number): number;
450
+ writeUInt16LE(value: number, offset: number): number;
451
+ writeUInt16BE(value: number, offset: number): number;
452
+ writeUInt32LE(value: number, offset: number): number;
453
+ writeUInt32BE(value: number, offset: number): number;
454
+ writeInt8(value: number, offset: number): number;
455
+ writeInt16LE(value: number, offset: number): number;
456
+ writeInt16BE(value: number, offset: number): number;
457
+ writeInt32LE(value: number, offset: number): number;
458
+ writeInt32BE(value: number, offset: number): number;
459
+ writeFloatLE(value: number, offset: number): number;
460
+ writeFloatBE(value: number, offset: number): number;
461
+ writeDoubleLE(value: number, offset: number): number;
462
+ writeDoubleBE(value: number, offset: number): number;
463
+
464
+ fill(value: string | Uint8Array | number, offset?: number, end?: number, encoding?: BufferEncoding): this;
465
+
466
+ indexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
467
+ lastIndexOf(value: string | number | Uint8Array, byteOffset?: number, encoding?: BufferEncoding): number;
468
+ entries(): IterableIterator<[number, number]>;
469
+ includes(value: string | number | Buffer, byteOffset?: number, encoding?: BufferEncoding): boolean;
470
+ keys(): IterableIterator<number>;
471
+ values(): IterableIterator<number>;
472
+ }
464
473
 
465
474
  /*----------------------------------------------*
466
475
  * *
@@ -626,17 +635,17 @@ declare namespace NodeJS {
626
635
  isPaused(): boolean;
627
636
  pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T;
628
637
  unpipe(destination?: WritableStream): this;
629
- unshift(chunk: string | Buffer | Uint8Array, encoding?: BufferEncoding): void;
638
+ unshift(chunk: string | Uint8Array, encoding?: BufferEncoding): void;
630
639
  wrap(oldStream: ReadableStream): this;
631
640
  [Symbol.asyncIterator](): AsyncIterableIterator<string | Buffer>;
632
641
  }
633
642
 
634
643
  interface WritableStream extends EventEmitter {
635
644
  writable: boolean;
636
- write(buffer: Buffer | Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
645
+ write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
637
646
  write(str: string, encoding?: string, cb?: (err?: Error | null) => void): boolean;
638
647
  end(cb?: () => void): void;
639
- end(data: string | Uint8Array | Buffer, cb?: () => void): void;
648
+ end(data: string | Uint8Array, cb?: () => void): void;
640
649
  end(str: string, encoding?: string, cb?: () => void): void;
641
650
  }
642
651
 
@@ -863,7 +872,7 @@ declare namespace NodeJS {
863
872
  emitWarning(warning: string | Error, name?: string, ctor?: Function): void;
864
873
  env: ProcessEnv;
865
874
  exit(code?: number): never;
866
- exitCode: number;
875
+ exitCode?: number;
867
876
  getgid(): number;
868
877
  setgid(id: number | string): void;
869
878
  getuid(): number;
node/http2.d.ts CHANGED
@@ -656,8 +656,8 @@ declare module "http2" {
656
656
  addTrailers(trailers: OutgoingHttpHeaders): void;
657
657
  readonly connection: net.Socket | tls.TLSSocket;
658
658
  end(callback?: () => void): void;
659
- end(data: string | Buffer | Uint8Array, callback?: () => void): void;
660
- end(data: string | Buffer | Uint8Array, encoding: string, callback?: () => void): void;
659
+ end(data: string | Uint8Array, callback?: () => void): void;
660
+ end(data: string | Uint8Array, encoding: string, callback?: () => void): void;
661
661
  readonly finished: boolean;
662
662
  getHeader(name: string): string;
663
663
  getHeaderNames(): string[];
@@ -672,8 +672,8 @@ declare module "http2" {
672
672
  statusCode: number;
673
673
  statusMessage: '';
674
674
  readonly stream: ServerHttp2Stream;
675
- write(chunk: string | Buffer | Uint8Array, callback?: (err: Error) => void): boolean;
676
- write(chunk: string | Buffer | Uint8Array, encoding: string, callback?: (err: Error) => void): boolean;
675
+ write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean;
676
+ write(chunk: string | Uint8Array, encoding: string, callback?: (err: Error) => void): boolean;
677
677
  writeContinue(): void;
678
678
  writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
679
679
  writeHead(statusCode: number, statusMessage: string, headers?: OutgoingHttpHeaders): this;
@@ -943,7 +943,7 @@ declare module "http2" {
943
943
 
944
944
  export function getDefaultSettings(): Settings;
945
945
  export function getPackedSettings(settings: Settings): Buffer;
946
- export function getUnpackedSettings(buf: Buffer | Uint8Array): Settings;
946
+ export function getUnpackedSettings(buf: Uint8Array): Settings;
947
947
 
948
948
  export function createServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server;
949
949
  export function createServer(options: ServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2Server;
node/index.d.ts CHANGED
@@ -32,7 +32,6 @@
32
32
  // Wilco Bakker <https://github.com/WilcoBakker>
33
33
  // wwwy3y3 <https://github.com/wwwy3y3>
34
34
  // Zane Hannan AU <https://github.com/ZaneHannanAU>
35
- // Jeremie Rodriguez <https://github.com/jeremiergz>
36
35
  // Samuel Ainsworth <https://github.com/samuela>
37
36
  // Kyle Uehlein <https://github.com/kuehlein>
38
37
  // Jordi Oliveras Rovira <https://github.com/j-oliveras>
node/net.d.ts CHANGED
@@ -38,8 +38,8 @@ declare module "net" {
38
38
  constructor(options?: SocketConstructorOpts);
39
39
 
40
40
  // Extended base methods
41
- write(buffer: Buffer | Uint8Array | string, cb?: (err?: Error) => void): boolean;
42
- write(str: Buffer | Uint8Array | string, encoding?: string, cb?: (err?: Error) => void): boolean;
41
+ write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
42
+ write(str: Uint8Array | string, encoding?: string, cb?: (err?: Error) => void): boolean;
43
43
 
44
44
  connect(options: SocketConnectOpts, connectionListener?: () => void): this;
45
45
  connect(port: number, host: string, connectionListener?: () => void): this;
@@ -69,8 +69,8 @@ declare module "net" {
69
69
 
70
70
  // Extended base methods
71
71
  end(cb?: () => void): void;
72
- end(buffer: Buffer | Uint8Array | string, cb?: () => void): void;
73
- end(str: Buffer | Uint8Array | string, encoding?: string, cb?: () => void): void;
72
+ end(buffer: Uint8Array | string, cb?: () => void): void;
73
+ end(str: Uint8Array | string, encoding?: string, cb?: () => void): void;
74
74
 
75
75
  /**
76
76
  * events.EventEmitter
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "12.6.4",
3
+ "version": "12.6.8",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -164,11 +164,6 @@
164
164
  "url": "https://github.com/ZaneHannanAU",
165
165
  "githubUsername": "ZaneHannanAU"
166
166
  },
167
- {
168
- "name": "Jeremie Rodriguez",
169
- "url": "https://github.com/jeremiergz",
170
- "githubUsername": "jeremiergz"
171
- },
172
167
  {
173
168
  "name": "Samuel Ainsworth",
174
169
  "url": "https://github.com/samuela",
@@ -206,6 +201,6 @@
206
201
  },
207
202
  "scripts": {},
208
203
  "dependencies": {},
209
- "typesPublisherContentHash": "55e1dd2b48fbe58beb147b8157e825fd0074b7568f51f551ca1c7ada156dc083",
204
+ "typesPublisherContentHash": "8630266379794ffe5826422974749423e8d09e4d652e641cbf6ade81782c32af",
210
205
  "typeScriptVersion": "2.0"
211
206
  }
node/string_decoder.d.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  declare module "string_decoder" {
2
- interface NodeStringDecoder {
2
+ class StringDecoder {
3
+ constructor(encoding?: string);
3
4
  write(buffer: Buffer): string;
4
5
  end(buffer?: Buffer): string;
5
6
  }
6
- const StringDecoder: {
7
- new(encoding?: string): NodeStringDecoder;
8
- };
9
7
  }
node/tls.d.ts CHANGED
@@ -245,7 +245,7 @@ declare module "tls" {
245
245
  * An array of strings or a Buffer naming possible ALPN protocols.
246
246
  * (Protocols should be ordered by their priority.)
247
247
  */
248
- ALPNProtocols?: string[] | Buffer[] | Uint8Array[] | Buffer | Uint8Array;
248
+ ALPNProtocols?: string[] | Uint8Array[] | Uint8Array;
249
249
  /**
250
250
  * SNICallback(servername, cb) <Function> A function that will be
251
251
  * called if the client supports SNI TLS extension. Two arguments
@@ -262,7 +262,7 @@ declare module "tls" {
262
262
  * effect if requestCert is true.
263
263
  * @default true
264
264
  */
265
- rejectUnauthorized?: boolean; // Defaults to true
265
+ rejectUnauthorized?: boolean;
266
266
  }
267
267
 
268
268
  interface TlsOptions extends SecureContextOptions, CommonConnectionOptions {
node/zlib.d.ts CHANGED
@@ -18,7 +18,7 @@ declare module "zlib" {
18
18
  level?: number; // compression only
19
19
  memLevel?: number; // compression only
20
20
  strategy?: number; // compression only
21
- dictionary?: Buffer | NodeJS.TypedArray | DataView | ArrayBuffer; // deflate/inflate only, empty dictionary by default
21
+ dictionary?: NodeJS.TypedArray | DataView | ArrayBuffer; // deflate/inflate only, empty dictionary by default
22
22
  }
23
23
 
24
24
  interface BrotliOptions {
@@ -79,7 +79,7 @@ declare module "zlib" {
79
79
  function createInflateRaw(options?: ZlibOptions): InflateRaw;
80
80
  function createUnzip(options?: ZlibOptions): Unzip;
81
81
 
82
- type InputType = string | Buffer | DataView | ArrayBuffer | NodeJS.TypedArray;
82
+ type InputType = string | DataView | ArrayBuffer | NodeJS.TypedArray;
83
83
 
84
84
  type CompressCallback = (error: Error | null, result: Buffer) => void;
85
85