@types/node 16.11.9 → 16.11.10

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 (3) hide show
  1. node/README.md +1 -1
  2. node/fs.d.ts +42 -6
  3. node/package.json +2 -2
node/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://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, 19 Nov 2021 08:31:10 GMT
11
+ * Last updated: Tue, 23 Nov 2021 19:31:07 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`
14
14
 
node/fs.d.ts CHANGED
@@ -260,6 +260,29 @@ declare module 'fs' {
260
260
  */
261
261
  readSync(): Dirent | null;
262
262
  }
263
+ /**
264
+ * Class: fs.StatWatcher
265
+ * @since v14.3.0, v12.20.0
266
+ * Extends `EventEmitter`
267
+ * A successful call to {@link watchFile} method will return a new fs.StatWatcher object.
268
+ */
269
+ export interface StatWatcher extends EventEmitter {
270
+ /**
271
+ * @since v14.3.0, v12.20.0
272
+ * When called, requests that the Node.js event loop not exit so long as the `fs.StatWatcher` is active.
273
+ * Calling `watcher.ref()` multiple times will have no effect.
274
+ * By default, all `fs.StatWatcher`` objects are "ref'ed", making it normally unnecessary to call `watcher.ref()`
275
+ * unless `watcher.unref()` had been called previously.
276
+ */
277
+ ref(): this;
278
+ /**
279
+ * @since v14.3.0, v12.20.0
280
+ * When called, the active `fs.StatWatcher`` object will not require the Node.js event loop to remain active.
281
+ * If there is no other activity keeping the event loop running, the process may exit before the `fs.StatWatcher`` object's callback is invoked.
282
+ * `Calling watcher.unref()` multiple times will have no effect.
283
+ */
284
+ unref(): this;
285
+ }
263
286
  export interface FSWatcher extends EventEmitter {
264
287
  /**
265
288
  * Stop watching for changes on the given `fs.FSWatcher`. Once stopped, the `fs.FSWatcher` object is no longer usable.
@@ -2784,21 +2807,34 @@ declare module 'fs' {
2784
2807
  * * the file is renamed and then renamed a second time back to its original name
2785
2808
  * @since v0.1.31
2786
2809
  */
2810
+ export interface WatchFileOptions {
2811
+ bigint?: boolean | undefined;
2812
+ persistent?: boolean | undefined;
2813
+ interval?: number | undefined;
2814
+ }
2787
2815
  export function watchFile(
2788
2816
  filename: PathLike,
2789
2817
  options:
2790
- | {
2791
- persistent?: boolean | undefined;
2792
- interval?: number | undefined;
2793
- }
2818
+ | (WatchFileOptions & {
2819
+ bigint?: false | undefined;
2820
+ })
2794
2821
  | undefined,
2795
2822
  listener: (curr: Stats, prev: Stats) => void
2796
- ): void;
2823
+ ): StatWatcher;
2824
+ export function watchFile(
2825
+ filename: PathLike,
2826
+ options:
2827
+ | (WatchFileOptions & {
2828
+ bigint: true;
2829
+ })
2830
+ | undefined,
2831
+ listener: (curr: BigIntStats, prev: BigIntStats) => void
2832
+ ): StatWatcher;
2797
2833
  /**
2798
2834
  * Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
2799
2835
  * @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
2800
2836
  */
2801
- export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): void;
2837
+ export function watchFile(filename: PathLike, listener: (curr: Stats, prev: Stats) => void): StatWatcher;
2802
2838
  /**
2803
2839
  * Stop watching for changes on `filename`. If `listener` is specified, only that
2804
2840
  * particular listener is removed. Otherwise, _all_ listeners are removed,
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "16.11.9",
3
+ "version": "16.11.10",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -225,6 +225,6 @@
225
225
  },
226
226
  "scripts": {},
227
227
  "dependencies": {},
228
- "typesPublisherContentHash": "d38d785af313406345e5384ce39a1c5750b72c1893eb022dca68dc7f95f943cf",
228
+ "typesPublisherContentHash": "b24d5d157d742f1a54b5d70ed1c014862c87e0187063c31ed2038790f909f02d",
229
229
  "typeScriptVersion": "3.8"
230
230
  }