@types/node 20.1.1 → 20.1.2
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 +1 -1
- node/fs.d.ts +7 -4
- node/package.json +2 -2
- node/ts4.8/fs.d.ts +7 -4
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:
|
|
11
|
+
* Last updated: Wed, 10 May 2023 08:02:53 GMT
|
|
12
12
|
* Dependencies: none
|
|
13
13
|
* Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
|
|
14
14
|
|
node/fs.d.ts
CHANGED
|
@@ -3020,7 +3020,7 @@ declare module 'fs' {
|
|
|
3020
3020
|
bigint?: false | undefined;
|
|
3021
3021
|
})
|
|
3022
3022
|
| undefined,
|
|
3023
|
-
listener:
|
|
3023
|
+
listener: StatsListener
|
|
3024
3024
|
): StatWatcher;
|
|
3025
3025
|
export function watchFile(
|
|
3026
3026
|
filename: PathLike,
|
|
@@ -3029,13 +3029,13 @@ declare module 'fs' {
|
|
|
3029
3029
|
bigint: true;
|
|
3030
3030
|
})
|
|
3031
3031
|
| undefined,
|
|
3032
|
-
listener:
|
|
3032
|
+
listener: BigIntStatsListener
|
|
3033
3033
|
): StatWatcher;
|
|
3034
3034
|
/**
|
|
3035
3035
|
* Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
|
|
3036
3036
|
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
|
3037
3037
|
*/
|
|
3038
|
-
export function watchFile(filename: PathLike, listener:
|
|
3038
|
+
export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher;
|
|
3039
3039
|
/**
|
|
3040
3040
|
* Stop watching for changes on `filename`. If `listener` is specified, only that
|
|
3041
3041
|
* particular listener is removed. Otherwise, _all_ listeners are removed,
|
|
@@ -3048,7 +3048,8 @@ declare module 'fs' {
|
|
|
3048
3048
|
* @since v0.1.31
|
|
3049
3049
|
* @param listener Optional, a listener previously attached using `fs.watchFile()`
|
|
3050
3050
|
*/
|
|
3051
|
-
export function unwatchFile(filename: PathLike, listener?:
|
|
3051
|
+
export function unwatchFile(filename: PathLike, listener?: StatsListener): void;
|
|
3052
|
+
export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void;
|
|
3052
3053
|
export interface WatchOptions extends Abortable {
|
|
3053
3054
|
encoding?: BufferEncoding | 'buffer' | undefined;
|
|
3054
3055
|
persistent?: boolean | undefined;
|
|
@@ -3056,6 +3057,8 @@ declare module 'fs' {
|
|
|
3056
3057
|
}
|
|
3057
3058
|
export type WatchEventType = 'rename' | 'change';
|
|
3058
3059
|
export type WatchListener<T> = (event: WatchEventType, filename: T) => void;
|
|
3060
|
+
export type StatsListener = (curr: Stats, prev: Stats) => void;
|
|
3061
|
+
export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void;
|
|
3059
3062
|
/**
|
|
3060
3063
|
* Watch for changes on `filename`, where `filename` is either a file or a
|
|
3061
3064
|
* directory.
|
node/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@types/node",
|
|
3
|
-
"version": "20.1.
|
|
3
|
+
"version": "20.1.2",
|
|
4
4
|
"description": "TypeScript definitions for Node.js",
|
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
|
6
6
|
"license": "MIT",
|
|
@@ -232,6 +232,6 @@
|
|
|
232
232
|
},
|
|
233
233
|
"scripts": {},
|
|
234
234
|
"dependencies": {},
|
|
235
|
-
"typesPublisherContentHash": "
|
|
235
|
+
"typesPublisherContentHash": "8dcc213ed756110c2b3b7a0f3a9b54ba17ba1eed24956abe206aa9f29dc5cd4d",
|
|
236
236
|
"typeScriptVersion": "4.3"
|
|
237
237
|
}
|
node/ts4.8/fs.d.ts
CHANGED
|
@@ -3020,7 +3020,7 @@ declare module 'fs' {
|
|
|
3020
3020
|
bigint?: false | undefined;
|
|
3021
3021
|
})
|
|
3022
3022
|
| undefined,
|
|
3023
|
-
listener:
|
|
3023
|
+
listener: StatsListener
|
|
3024
3024
|
): StatWatcher;
|
|
3025
3025
|
export function watchFile(
|
|
3026
3026
|
filename: PathLike,
|
|
@@ -3029,13 +3029,13 @@ declare module 'fs' {
|
|
|
3029
3029
|
bigint: true;
|
|
3030
3030
|
})
|
|
3031
3031
|
| undefined,
|
|
3032
|
-
listener:
|
|
3032
|
+
listener: BigIntStatsListener
|
|
3033
3033
|
): StatWatcher;
|
|
3034
3034
|
/**
|
|
3035
3035
|
* Watch for changes on `filename`. The callback `listener` will be called each time the file is accessed.
|
|
3036
3036
|
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
|
3037
3037
|
*/
|
|
3038
|
-
export function watchFile(filename: PathLike, listener:
|
|
3038
|
+
export function watchFile(filename: PathLike, listener: StatsListener): StatWatcher;
|
|
3039
3039
|
/**
|
|
3040
3040
|
* Stop watching for changes on `filename`. If `listener` is specified, only that
|
|
3041
3041
|
* particular listener is removed. Otherwise, _all_ listeners are removed,
|
|
@@ -3048,7 +3048,8 @@ declare module 'fs' {
|
|
|
3048
3048
|
* @since v0.1.31
|
|
3049
3049
|
* @param listener Optional, a listener previously attached using `fs.watchFile()`
|
|
3050
3050
|
*/
|
|
3051
|
-
export function unwatchFile(filename: PathLike, listener?:
|
|
3051
|
+
export function unwatchFile(filename: PathLike, listener?: StatsListener): void;
|
|
3052
|
+
export function unwatchFile(filename: PathLike, listener?: BigIntStatsListener): void;
|
|
3052
3053
|
export interface WatchOptions extends Abortable {
|
|
3053
3054
|
encoding?: BufferEncoding | 'buffer' | undefined;
|
|
3054
3055
|
persistent?: boolean | undefined;
|
|
@@ -3056,6 +3057,8 @@ declare module 'fs' {
|
|
|
3056
3057
|
}
|
|
3057
3058
|
export type WatchEventType = 'rename' | 'change';
|
|
3058
3059
|
export type WatchListener<T> = (event: WatchEventType, filename: T) => void;
|
|
3060
|
+
export type StatsListener = (curr: Stats, prev: Stats) => void;
|
|
3061
|
+
export type BigIntStatsListener = (curr: BigIntStats, prev: BigIntStats) => void;
|
|
3059
3062
|
/**
|
|
3060
3063
|
* Watch for changes on `filename`, where `filename` is either a file or a
|
|
3061
3064
|
* directory.
|