@types/node 12.0.4 → 12.0.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.
Files changed (6) hide show
  1. node/README.md +1 -1
  2. node/fs.d.ts +4 -4
  3. node/globals.d.ts +18 -2
  4. node/http2.d.ts +1 -0
  5. node/package.json +2 -2
  6. node/tls.d.ts +10 -6
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, 30 May 2019 18:05:34 GMT
11
+ * Last updated: Tue, 11 Jun 2019 19:11:52 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
 
node/fs.d.ts CHANGED
@@ -858,7 +858,7 @@ declare module "fs" {
858
858
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
859
859
  * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
860
860
  */
861
- function readdir(path: PathLike, options: { withFileTypes: true }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void): void;
861
+ function readdir(path: PathLike, options: { encoding?: string | null; withFileTypes: true }, callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void): void;
862
862
 
863
863
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
864
864
  namespace readdir {
@@ -888,7 +888,7 @@ declare module "fs" {
888
888
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
889
889
  * @param options If called with `withFileTypes: true` the result data will be an array of Dirent
890
890
  */
891
- function __promisify__(path: PathLike, options: { withFileTypes: true }): Promise<Dirent[]>;
891
+ function __promisify__(path: PathLike, options: { encoding?: string | null; withFileTypes: true }): Promise<Dirent[]>;
892
892
  }
893
893
 
894
894
  /**
@@ -913,11 +913,11 @@ declare module "fs" {
913
913
  function readdirSync(path: PathLike, options?: { encoding?: string | null; withFileTypes?: false } | string | null): string[] | Buffer[];
914
914
 
915
915
  /**
916
- * Asynchronous readdir(3) - read a directory.
916
+ * Synchronous readdir(3) - read a directory.
917
917
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
918
918
  * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
919
919
  */
920
- function readdirSync(path: PathLike, options: { withFileTypes: true }): Dirent[];
920
+ function readdirSync(path: PathLike, options: { encoding?: string | null; withFileTypes: true }): Dirent[];
921
921
 
922
922
  /**
923
923
  * Asynchronous close(2) - close a file descriptor.
node/globals.d.ts CHANGED
@@ -244,8 +244,24 @@ interface Buffer extends Uint8Array {
244
244
  equals(otherBuffer: Uint8Array): boolean;
245
245
  compare(otherBuffer: Uint8Array, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;
246
246
  copy(targetBuffer: Uint8Array, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;
247
- slice(start?: number, end?: number): Buffer;
248
- subarray(begin: number, end?: number): Buffer;
247
+ /**
248
+ * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
249
+ *
250
+ * This method is incompatible with `Uint8Array#slice()`, which returns a copy of the original memory.
251
+ *
252
+ * @param begin Where the new `Buffer` will start. Default: `0`.
253
+ * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
254
+ */
255
+ slice(begin?: number, end?: number): Buffer;
256
+ /**
257
+ * Returns a new `Buffer` that references **the same memory as the original**, but offset and cropped by the start and end indices.
258
+ *
259
+ * This method is compatible with `Uint8Array#subarray()`.
260
+ *
261
+ * @param begin Where the new `Buffer` will start. Default: `0`.
262
+ * @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
263
+ */
264
+ subarray(begin?: number, end?: number): Buffer;
249
265
  writeUIntLE(value: number, offset: number, byteLength: number): number;
250
266
  writeUIntBE(value: number, offset: number, byteLength: number): number;
251
267
  writeIntLE(value: number, offset: number, byteLength: number): number;
node/http2.d.ts CHANGED
@@ -71,6 +71,7 @@ declare module "http2" {
71
71
  * indicating that no additional data should be received and the readable side of the Http2Stream will be closed.
72
72
  */
73
73
  readonly endAfterHeaders: boolean;
74
+ readonly id?: number;
74
75
  readonly pending: boolean;
75
76
  readonly rstCode: number;
76
77
  readonly sentHeaders: OutgoingHttpHeaders;
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "12.0.4",
3
+ "version": "12.0.8",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -206,6 +206,6 @@
206
206
  },
207
207
  "scripts": {},
208
208
  "dependencies": {},
209
- "typesPublisherContentHash": "a5b0261b09bc5167427b0bbb22cadf4a36404979b19ea1b42f1480b1f54d0bc4",
209
+ "typesPublisherContentHash": "b10057a9c0d44251a5a8984947e54f9f9e906169ad37310f25993c9a526df5ab",
210
210
  "typeScriptVersion": "2.0"
211
211
  }
node/tls.d.ts CHANGED
@@ -334,7 +334,7 @@ declare module "tls" {
334
334
  cleartext: TLSSocket;
335
335
  }
336
336
 
337
- type SecureVersion = 'TLSv1.2' | 'TLSv1.1' | 'TLSv1';
337
+ type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1';
338
338
 
339
339
  interface SecureContextOptions {
340
340
  pfx?: string | Buffer | Array<string | Buffer | Object>;
@@ -353,18 +353,22 @@ declare module "tls" {
353
353
  sessionIdContext?: string;
354
354
  /**
355
355
  * Optionally set the maximum TLS version to allow. One
356
- * of `TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
357
- * `secureProtocol` option, use one or the other. **Default:** `'TLSv1.2'`.
356
+ * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
357
+ * `secureProtocol` option, use one or the other.
358
+ * **Default:** `'TLSv1.3'`, unless changed using CLI options. Using
359
+ * `--tls-max-v1.2` sets the default to `'TLSv1.2'`. Using `--tls-max-v1.3` sets the default to
360
+ * `'TLSv1.3'`. If multiple of the options are provided, the highest maximum is used.
358
361
  */
359
362
  maxVersion?: SecureVersion;
360
363
  /**
361
364
  * Optionally set the minimum TLS version to allow. One
362
- * of `TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
365
+ * of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
363
366
  * `secureProtocol` option, use one or the other. It is not recommended to use
364
367
  * less than TLSv1.2, but it may be required for interoperability.
365
368
  * **Default:** `'TLSv1.2'`, unless changed using CLI options. Using
366
- * `--tls-v1.0` changes the default to `'TLSv1'`. Using `--tls-v1.1` changes
367
- * the default to `'TLSv1.1'`.
369
+ * `--tls-v1.0` sets the default to `'TLSv1'`. Using `--tls-v1.1` sets the default to
370
+ * `'TLSv1.1'`. Using `--tls-min-v1.3` sets the default to
371
+ * 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.
368
372
  */
369
373
  minVersion?: SecureVersion;
370
374
  }