@types/node 12.0.0 → 12.0.4

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: Fri, 03 May 2019 21:48:30 GMT
11
+ * Last updated: Thu, 30 May 2019 18:05:34 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/crypto.d.ts CHANGED
@@ -423,8 +423,8 @@ declare module "crypto" {
423
423
 
424
424
  interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
425
425
  format: T;
426
- cipher: string;
427
- passphrase: string;
426
+ cipher?: string;
427
+ passphrase?: string;
428
428
  }
429
429
 
430
430
  interface KeyPairKeyObjectResult {
node/fs.d.ts CHANGED
@@ -2056,21 +2056,28 @@ declare module "fs" {
2056
2056
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2057
2057
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
2058
2058
  */
2059
- function readdir(path: PathLike, options?: { encoding?: BufferEncoding | null } | BufferEncoding | null): Promise<string[]>;
2059
+ function readdir(path: PathLike, options?: { encoding?: BufferEncoding | null; withFileTypes?: false } | BufferEncoding | null): Promise<string[]>;
2060
2060
 
2061
2061
  /**
2062
2062
  * Asynchronous readdir(3) - read a directory.
2063
2063
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2064
2064
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
2065
2065
  */
2066
- function readdir(path: PathLike, options: { encoding: "buffer" } | "buffer"): Promise<Buffer[]>;
2066
+ function readdir(path: PathLike, options: { encoding: "buffer"; withFileTypes?: false } | "buffer"): Promise<Buffer[]>;
2067
2067
 
2068
2068
  /**
2069
2069
  * Asynchronous readdir(3) - read a directory.
2070
2070
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2071
2071
  * @param options The encoding (or an object specifying the encoding), used as the encoding of the result. If not provided, `'utf8'` is used.
2072
2072
  */
2073
- function readdir(path: PathLike, options?: { encoding?: string | null } | string | null): Promise<string[] | Buffer[]>;
2073
+ function readdir(path: PathLike, options?: { encoding?: string | null; withFileTypes?: false } | string | null): Promise<string[] | Buffer[]>;
2074
+
2075
+ /**
2076
+ * Asynchronous readdir(3) - read a directory.
2077
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2078
+ * @param options If called with `withFileTypes: true` the result data will be an array of Dirent.
2079
+ */
2080
+ function readdir(path: PathLike, options: { encoding?: string | null; withFileTypes: true }): Promise<Dirent[]>;
2074
2081
 
2075
2082
  /**
2076
2083
  * Asynchronous readlink(2) - read value of a symbolic link.
node/inspector.d.ts CHANGED
@@ -3251,7 +3251,7 @@ declare module "inspector" {
3251
3251
  function close(): void;
3252
3252
 
3253
3253
  /**
3254
- * Return the URL of the active inspector, or undefined if there is none.
3254
+ * Return the URL of the active inspector, or `undefined` if there is none.
3255
3255
  */
3256
- function url(): string;
3256
+ function url(): string | undefined;
3257
3257
  }
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "12.0.0",
3
+ "version": "12.0.4",
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": "4eca45525f4cc6529f254ae31cdb02a298b0671a32577f03dfb068fb52bd930f",
209
+ "typesPublisherContentHash": "a5b0261b09bc5167427b0bbb22cadf4a36404979b19ea1b42f1480b1f54d0bc4",
210
210
  "typeScriptVersion": "2.0"
211
211
  }
node/querystring.d.ts CHANGED
@@ -12,13 +12,21 @@ declare module "querystring" {
12
12
 
13
13
  interface ParsedUrlQueryInput {
14
14
  [key: string]:
15
- // The value type here is a "poor man's `unknown`". When these types support TypeScript
16
- // 3.0+, we can replace this with `unknown`.
17
- {} | null | undefined;
15
+ // The value type here is a "poor man's `unknown`". When these types support TypeScript
16
+ // 3.0+, we can replace this with `unknown`.
17
+ {} | null | undefined;
18
18
  }
19
19
 
20
20
  function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
21
21
  function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
22
+ /**
23
+ * The querystring.encode() function is an alias for querystring.stringify().
24
+ */
25
+ const encode: typeof stringify;
26
+ /**
27
+ * The querystring.decode() function is an alias for querystring.parse().
28
+ */
29
+ const decode: typeof parse;
22
30
  function escape(str: string): string;
23
31
  function unescape(str: string): string;
24
32
  }