@types/node 14.11.11 → 14.14.0

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: Tue, 20 Oct 2020 06:54:48 GMT
11
+ * Last updated: Tue, 20 Oct 2020 12:08:55 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/fs/promises.d.ts CHANGED
@@ -4,7 +4,8 @@ declare module 'fs/promises' {
4
4
  WriteVResult,
5
5
  ReadVResult,
6
6
  PathLike,
7
- RmDirAsyncOptions,
7
+ RmDirOptions,
8
+ RmOptions,
8
9
  MakeDirectoryOptions,
9
10
  Dirent,
10
11
  OpenDirOptions,
@@ -255,7 +256,12 @@ declare module 'fs/promises' {
255
256
  * Asynchronous rmdir(2) - delete a directory.
256
257
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
257
258
  */
258
- function rmdir(path: PathLike, options?: RmDirAsyncOptions): Promise<void>;
259
+ function rmdir(path: PathLike, options?: RmDirOptions): Promise<void>;
260
+
261
+ /**
262
+ * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility).
263
+ */
264
+ function rm(path: PathLike, options?: RmOptions): Promise<void>;
259
265
 
260
266
  /**
261
267
  * Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
node/fs.d.ts CHANGED
@@ -821,31 +821,32 @@ declare module "fs" {
821
821
 
822
822
  export interface RmDirOptions {
823
823
  /**
824
+ * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
825
+ * `EPERM` error is encountered, Node.js will retry the operation with a linear
826
+ * backoff wait of `retryDelay` ms longer on each try. This option represents the
827
+ * number of retries. This option is ignored if the `recursive` option is not
828
+ * `true`.
829
+ * @default 0
830
+ */
831
+ maxRetries?: number;
832
+ /**
833
+ * @deprecated since v14.14.0 In future versions of Node.js,
834
+ * `fs.rmdir(path, { recursive: true })` will throw on nonexistent
835
+ * paths, or when given a file as a target.
836
+ * Use `fs.rm(path, { recursive: true, force: true })` instead.
837
+ *
824
838
  * If `true`, perform a recursive directory removal. In
825
839
  * recursive mode, errors are not reported if `path` does not exist, and
826
840
  * operations are retried on failure.
827
- * @experimental
828
841
  * @default false
829
842
  */
830
843
  recursive?: boolean;
831
- }
832
-
833
- export interface RmDirAsyncOptions extends RmDirOptions {
834
844
  /**
835
845
  * The amount of time in milliseconds to wait between retries.
836
846
  * This option is ignored if the `recursive` option is not `true`.
837
847
  * @default 100
838
848
  */
839
849
  retryDelay?: number;
840
- /**
841
- * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
842
- * `EPERM` error is encountered, Node.js will retry the operation with a linear
843
- * backoff wait of `retryDelay` ms longer on each try. This option represents the
844
- * number of retries. This option is ignored if the `recursive` option is not
845
- * `true`.
846
- * @default 0
847
- */
848
- maxRetries?: number;
849
850
  }
850
851
 
851
852
  /**
@@ -853,7 +854,7 @@ declare module "fs" {
853
854
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
854
855
  */
855
856
  export function rmdir(path: PathLike, callback: NoParamCallback): void;
856
- export function rmdir(path: PathLike, options: RmDirAsyncOptions, callback: NoParamCallback): void;
857
+ export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void;
857
858
 
858
859
  // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
859
860
  export namespace rmdir {
@@ -861,7 +862,7 @@ declare module "fs" {
861
862
  * Asynchronous rmdir(2) - delete a directory.
862
863
  * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
863
864
  */
864
- function __promisify__(path: PathLike, options?: RmDirAsyncOptions): Promise<void>;
865
+ function __promisify__(path: PathLike, options?: RmDirOptions): Promise<void>;
865
866
  }
866
867
 
867
868
  /**
@@ -870,6 +871,55 @@ declare module "fs" {
870
871
  */
871
872
  export function rmdirSync(path: PathLike, options?: RmDirOptions): void;
872
873
 
874
+ export interface RmOptions {
875
+ /**
876
+ * When `true`, exceptions will be ignored if `path` does not exist.
877
+ * @default false
878
+ */
879
+ force?: boolean;
880
+ /**
881
+ * If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
882
+ * `EPERM` error is encountered, Node.js will retry the operation with a linear
883
+ * backoff wait of `retryDelay` ms longer on each try. This option represents the
884
+ * number of retries. This option is ignored if the `recursive` option is not
885
+ * `true`.
886
+ * @default 0
887
+ */
888
+ maxRetries?: number;
889
+ /**
890
+ * If `true`, perform a recursive directory removal. In
891
+ * recursive mode, errors are not reported if `path` does not exist, and
892
+ * operations are retried on failure.
893
+ * @default false
894
+ */
895
+ recursive?: boolean;
896
+ /**
897
+ * The amount of time in milliseconds to wait between retries.
898
+ * This option is ignored if the `recursive` option is not `true`.
899
+ * @default 100
900
+ */
901
+ retryDelay?: number;
902
+ }
903
+
904
+ /**
905
+ * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility).
906
+ */
907
+ export function rm(path: PathLike, callback: NoParamCallback): void;
908
+ export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void;
909
+
910
+ // NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
911
+ export namespace rm {
912
+ /**
913
+ * Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility).
914
+ */
915
+ function __promisify__(path: PathLike, options?: RmOptions): Promise<void>;
916
+ }
917
+
918
+ /**
919
+ * Synchronously removes files and directories (modeled on the standard POSIX `rm` utility).
920
+ */
921
+ export function rmSync(path: PathLike, options?: RmOptions): void;
922
+
873
923
  export interface MakeDirectoryOptions {
874
924
  /**
875
925
  * Indicates whether parent folders should be created.
node/http.d.ts CHANGED
@@ -65,7 +65,9 @@ declare module "http" {
65
65
  }
66
66
 
67
67
  // outgoing headers allows numbers (as they are converted internally to strings)
68
- interface OutgoingHttpHeaders extends NodeJS.Dict<number | string | string[]> {
68
+ type OutgoingHttpHeader = number | string | string[];
69
+
70
+ interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {
69
71
  }
70
72
 
71
73
  interface ClientRequestArgs {
@@ -188,8 +190,8 @@ declare module "http" {
188
190
  // https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53
189
191
  // no args in writeContinue callback
190
192
  writeContinue(callback?: () => void): void;
191
- writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): this;
192
- writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
193
+ writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
194
+ writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
193
195
  writeProcessing(): void;
194
196
  }
195
197
 
node/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for non-npm package Node.js 14.11
1
+ // Type definitions for non-npm package Node.js 14.14
2
2
  // Project: http://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.11.11",
3
+ "version": "14.14.0",
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": "c2b0b558a90b2111443786aacee9bd00dccbb5b39a303db22beb1f851fd91469",
249
+ "typesPublisherContentHash": "9f0797a503e4430cde61fedb34a29cd62ee2c4d3eec48cd21ec8d58cf09b3e79",
250
250
  "typeScriptVersion": "3.2"
251
251
  }