@types/node 20.1.0 → 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 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, 05 May 2023 21:32:43 GMT
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/child_process.d.ts CHANGED
@@ -980,7 +980,10 @@ declare module 'child_process' {
980
980
  interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
981
981
  encoding: BufferEncoding;
982
982
  }
983
- type ExecFileException = ExecException & NodeJS.ErrnoException;
983
+ type ExecFileException =
984
+ & Omit<ExecException, 'code'>
985
+ & Omit<NodeJS.ErrnoException, 'code'>
986
+ & { code?: string | number | undefined | null };
984
987
  /**
985
988
  * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
986
989
  * executable `file` is spawned directly as a new process making it slightly more
node/fs.d.ts CHANGED
@@ -3020,7 +3020,7 @@ declare module 'fs' {
3020
3020
  bigint?: false | undefined;
3021
3021
  })
3022
3022
  | undefined,
3023
- listener: (curr: Stats, prev: Stats) => void
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: (curr: BigIntStats, prev: BigIntStats) => void
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: (curr: Stats, prev: Stats) => void): StatWatcher;
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?: (curr: Stats, prev: Stats) => void): void;
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.0",
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": "46c088277e9ada8db2c3c0efb4456e3995588c028063600e77389338cb57861b",
235
+ "typesPublisherContentHash": "8dcc213ed756110c2b3b7a0f3a9b54ba17ba1eed24956abe206aa9f29dc5cd4d",
236
236
  "typeScriptVersion": "4.3"
237
237
  }
@@ -980,7 +980,10 @@ declare module 'child_process' {
980
980
  interface ExecFileOptionsWithOtherEncoding extends ExecFileOptions {
981
981
  encoding: BufferEncoding;
982
982
  }
983
- type ExecFileException = ExecException & NodeJS.ErrnoException;
983
+ type ExecFileException =
984
+ & Omit<ExecException, 'code'>
985
+ & Omit<NodeJS.ErrnoException, 'code'>
986
+ & { code?: string | number | undefined | null };
984
987
  /**
985
988
  * The `child_process.execFile()` function is similar to {@link exec} except that it does not spawn a shell by default. Rather, the specified
986
989
  * executable `file` is spawned directly as a new process making it slightly more
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: (curr: Stats, prev: Stats) => void
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: (curr: BigIntStats, prev: BigIntStats) => void
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: (curr: Stats, prev: Stats) => void): StatWatcher;
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?: (curr: Stats, prev: Stats) => void): void;
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.