@types/node 16.4.13 → 16.4.14

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 (4) hide show
  1. node/README.md +1 -1
  2. node/fs/promises.d.ts +8 -3
  3. node/fs.d.ts +2 -1
  4. node/package.json +2 -2
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, 06 Aug 2021 01:01:21 GMT
11
+ * Last updated: Wed, 11 Aug 2021 16:31:26 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
14
14
 
node/fs/promises.d.ts CHANGED
@@ -29,7 +29,12 @@ declare module 'fs/promises' {
29
29
  OpenMode,
30
30
  Mode,
31
31
  WatchOptions,
32
+ WatchEventType,
32
33
  } from 'node:fs';
34
+ interface FileChangeInfo<T extends (string | Buffer)> {
35
+ eventType: WatchEventType;
36
+ filename: T;
37
+ }
33
38
  interface FlagAndOpenMode {
34
39
  mode?: Mode | undefined;
35
40
  flag?: OpenMode | undefined;
@@ -951,7 +956,7 @@ declare module 'fs/promises' {
951
956
  encoding: 'buffer';
952
957
  })
953
958
  | 'buffer'
954
- ): AsyncIterable<Buffer>;
959
+ ): AsyncIterable<FileChangeInfo<Buffer>>;
955
960
  /**
956
961
  * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
957
962
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
@@ -960,7 +965,7 @@ declare module 'fs/promises' {
960
965
  * If `persistent` is not supplied, the default of `true` is used.
961
966
  * If `recursive` is not supplied, the default of `false` is used.
962
967
  */
963
- function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<string>;
968
+ function watch(filename: PathLike, options?: WatchOptions | BufferEncoding): AsyncIterable<FileChangeInfo<string>>;
964
969
  /**
965
970
  * Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
966
971
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
@@ -969,7 +974,7 @@ declare module 'fs/promises' {
969
974
  * If `persistent` is not supplied, the default of `true` is used.
970
975
  * If `recursive` is not supplied, the default of `false` is used.
971
976
  */
972
- function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<string> | AsyncIterable<Buffer>;
977
+ function watch(filename: PathLike, options: WatchOptions | string): AsyncIterable<FileChangeInfo<string>> | AsyncIterable<FileChangeInfo<Buffer>>;
973
978
  }
974
979
  declare module 'node:fs/promises' {
975
980
  export * from 'fs/promises';
node/fs.d.ts CHANGED
@@ -2791,7 +2791,8 @@ declare module 'fs' {
2791
2791
  persistent?: boolean | undefined;
2792
2792
  recursive?: boolean | undefined;
2793
2793
  }
2794
- export type WatchListener<T> = (event: 'rename' | 'change', filename: T) => void;
2794
+ export type WatchEventType = 'rename' | 'change';
2795
+ export type WatchListener<T> = (event: WatchEventType, filename: T) => void;
2795
2796
  /**
2796
2797
  * Watch for changes on `filename`, where `filename` is either a file or a
2797
2798
  * directory.
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.4.13",
3
+ "version": "16.4.14",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -237,6 +237,6 @@
237
237
  },
238
238
  "scripts": {},
239
239
  "dependencies": {},
240
- "typesPublisherContentHash": "3cc1cc7b463ea7699af2a41aa02b468332e3b95e3f6bc5418e1a3039cab60c8c",
240
+ "typesPublisherContentHash": "2df60c84f656b32ee1aebcb5ff614b05ac54ba7d4e9d096306b627d0e04207d1",
241
241
  "typeScriptVersion": "3.6"
242
242
  }