cdk-common 2.0.1179 → 2.0.1181

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 (39) hide show
  1. package/.jsii +32 -2
  2. package/API.md +30 -0
  3. package/lib/main.js +1 -1
  4. package/lib/managed-policies.d.ts +1351 -1346
  5. package/lib/managed-policies.js +6 -1
  6. package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
  7. package/node_modules/@types/concat-stream/node_modules/@types/node/cluster.d.ts +1 -1
  8. package/node_modules/@types/concat-stream/node_modules/@types/node/diagnostics_channel.d.ts +20 -1
  9. package/node_modules/@types/concat-stream/node_modules/@types/node/fs/promises.d.ts +13 -0
  10. package/node_modules/@types/concat-stream/node_modules/@types/node/fs.d.ts +86 -2
  11. package/node_modules/@types/concat-stream/node_modules/@types/node/http.d.ts +2 -1
  12. package/node_modules/@types/concat-stream/node_modules/@types/node/net.d.ts +14 -8
  13. package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +2 -2
  14. package/node_modules/@types/concat-stream/node_modules/@types/node/vm.d.ts +20 -5
  15. package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
  16. package/node_modules/@types/form-data/node_modules/@types/node/cluster.d.ts +1 -1
  17. package/node_modules/@types/form-data/node_modules/@types/node/diagnostics_channel.d.ts +20 -1
  18. package/node_modules/@types/form-data/node_modules/@types/node/fs/promises.d.ts +13 -0
  19. package/node_modules/@types/form-data/node_modules/@types/node/fs.d.ts +86 -2
  20. package/node_modules/@types/form-data/node_modules/@types/node/http.d.ts +2 -1
  21. package/node_modules/@types/form-data/node_modules/@types/node/net.d.ts +14 -8
  22. package/node_modules/@types/form-data/node_modules/@types/node/package.json +2 -2
  23. package/node_modules/@types/form-data/node_modules/@types/node/vm.d.ts +20 -5
  24. package/node_modules/@types/qs/README.md +1 -1
  25. package/node_modules/@types/qs/index.d.ts +1 -0
  26. package/node_modules/@types/qs/package.json +3 -3
  27. package/node_modules/{string_decoder → form-data}/node_modules/safe-buffer/index.js +3 -0
  28. package/node_modules/{readable-stream → form-data}/node_modules/safe-buffer/package.json +18 -4
  29. package/node_modules/safe-buffer/index.js +0 -3
  30. package/node_modules/safe-buffer/package.json +4 -18
  31. package/package.json +4 -4
  32. package/node_modules/readable-stream/node_modules/safe-buffer/index.js +0 -62
  33. package/node_modules/string_decoder/node_modules/safe-buffer/LICENSE +0 -21
  34. package/node_modules/string_decoder/node_modules/safe-buffer/README.md +0 -584
  35. package/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts +0 -187
  36. package/node_modules/string_decoder/node_modules/safe-buffer/package.json +0 -37
  37. /package/node_modules/{readable-stream → form-data}/node_modules/safe-buffer/LICENSE +0 -0
  38. /package/node_modules/{readable-stream → form-data}/node_modules/safe-buffer/README.md +0 -0
  39. /package/node_modules/{readable-stream → form-data}/node_modules/safe-buffer/index.d.ts +0 -0
@@ -8,7 +8,7 @@ This package contains type definitions for node (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: Mon, 05 May 2025 23:02:37 GMT
11
+ * Last updated: Wed, 14 May 2025 04:37:31 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -266,7 +266,7 @@ declare module "cluster" {
266
266
  * @since v0.7.7
267
267
  * @return A reference to `worker`.
268
268
  */
269
- disconnect(): void;
269
+ disconnect(): this;
270
270
  /**
271
271
  * This function returns `true` if the worker is connected to its primary via its
272
272
  * IPC channel, `false` otherwise. A worker is connected to its primary after it
@@ -259,7 +259,7 @@ declare module "diagnostics_channel" {
259
259
  * @param store The store to unbind from the channel.
260
260
  * @return `true` if the store was found, `false` otherwise.
261
261
  */
262
- unbindStore(store: any): void;
262
+ unbindStore(store: AsyncLocalStorage<StoreType>): boolean;
263
263
  /**
264
264
  * Applies the given data to any AsyncLocalStorage instances bound to the channel
265
265
  * for the duration of the given function, then publishes to the channel within
@@ -547,6 +547,25 @@ declare module "diagnostics_channel" {
547
547
  thisArg?: any,
548
548
  ...args: Parameters<Fn>
549
549
  ): void;
550
+ /**
551
+ * `true` if any of the individual channels has a subscriber, `false` if not.
552
+ *
553
+ * This is a helper method available on a {@link TracingChannel} instance to check
554
+ * if any of the [TracingChannel Channels](https://nodejs.org/api/diagnostics_channel.html#tracingchannel-channels) have subscribers.
555
+ * A `true` is returned if any of them have at least one subscriber, a `false` is returned otherwise.
556
+ *
557
+ * ```js
558
+ * const diagnostics_channel = require('node:diagnostics_channel');
559
+ *
560
+ * const channels = diagnostics_channel.tracingChannel('my-channel');
561
+ *
562
+ * if (channels.hasSubscribers) {
563
+ * // Do something
564
+ * }
565
+ * ```
566
+ * @since v22.0.0, v20.13.0
567
+ */
568
+ readonly hasSubscribers: boolean;
550
569
  }
551
570
  }
552
571
  declare module "node:diagnostics_channel" {
@@ -718,6 +718,19 @@ declare module "fs/promises" {
718
718
  recursive?: boolean | undefined;
719
719
  },
720
720
  ): Promise<Dirent[]>;
721
+ /**
722
+ * Asynchronous readdir(3) - read a directory.
723
+ * @param path A path to a directory. If a URL is provided, it must use the `file:` protocol.
724
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
725
+ */
726
+ function readdir(
727
+ path: PathLike,
728
+ options: {
729
+ encoding: "buffer";
730
+ withFileTypes: true;
731
+ recursive?: boolean | undefined;
732
+ },
733
+ ): Promise<Dirent<Buffer>[]>;
721
734
  /**
722
735
  * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is
723
736
  * fulfilled with the`linkString` upon success.
@@ -198,7 +198,7 @@ declare module "fs" {
198
198
  * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s.
199
199
  * @since v10.10.0
200
200
  */
201
- export class Dirent {
201
+ export class Dirent<Name extends string | Buffer = string> {
202
202
  /**
203
203
  * Returns `true` if the `fs.Dirent` object describes a regular file.
204
204
  * @since v10.10.0
@@ -241,7 +241,7 @@ declare module "fs" {
241
241
  * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}.
242
242
  * @since v10.10.0
243
243
  */
244
- name: string;
244
+ name: Name;
245
245
  /**
246
246
  * The base path that this `fs.Dirent` object refers to.
247
247
  * @since v20.12.0
@@ -2040,6 +2040,20 @@ declare module "fs" {
2040
2040
  },
2041
2041
  callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void,
2042
2042
  ): void;
2043
+ /**
2044
+ * Asynchronous readdir(3) - read a directory.
2045
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2046
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
2047
+ */
2048
+ export function readdir(
2049
+ path: PathLike,
2050
+ options: {
2051
+ encoding: "buffer";
2052
+ withFileTypes: true;
2053
+ recursive?: boolean | undefined;
2054
+ },
2055
+ callback: (err: NodeJS.ErrnoException | null, files: Dirent<Buffer>[]) => void,
2056
+ ): void;
2043
2057
  export namespace readdir {
2044
2058
  /**
2045
2059
  * Asynchronous readdir(3) - read a directory.
@@ -2099,6 +2113,19 @@ declare module "fs" {
2099
2113
  recursive?: boolean | undefined;
2100
2114
  },
2101
2115
  ): Promise<Dirent[]>;
2116
+ /**
2117
+ * Asynchronous readdir(3) - read a directory.
2118
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2119
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
2120
+ */
2121
+ function __promisify__(
2122
+ path: PathLike,
2123
+ options: {
2124
+ encoding: "buffer";
2125
+ withFileTypes: true;
2126
+ recursive?: boolean | undefined;
2127
+ },
2128
+ ): Promise<Dirent<Buffer>[]>;
2102
2129
  }
2103
2130
  /**
2104
2131
  * Reads the contents of the directory.
@@ -2166,6 +2193,19 @@ declare module "fs" {
2166
2193
  recursive?: boolean | undefined;
2167
2194
  },
2168
2195
  ): Dirent[];
2196
+ /**
2197
+ * Synchronous readdir(3) - read a directory.
2198
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2199
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
2200
+ */
2201
+ export function readdirSync(
2202
+ path: PathLike,
2203
+ options: {
2204
+ encoding: "buffer";
2205
+ withFileTypes: true;
2206
+ recursive?: boolean | undefined;
2207
+ },
2208
+ ): Dirent<Buffer>[];
2169
2209
  /**
2170
2210
  * Closes the file descriptor. No arguments other than a possible exception are
2171
2211
  * given to the completion callback.
@@ -2319,6 +2359,20 @@ declare module "fs" {
2319
2359
  * @since v0.1.96
2320
2360
  */
2321
2361
  export function fsyncSync(fd: number): void;
2362
+ export interface WriteOptions {
2363
+ /**
2364
+ * @default 0
2365
+ */
2366
+ offset?: number | undefined;
2367
+ /**
2368
+ * @default `buffer.byteLength - offset`
2369
+ */
2370
+ length?: number | undefined;
2371
+ /**
2372
+ * @default null
2373
+ */
2374
+ position?: number | undefined | null;
2375
+ }
2322
2376
  /**
2323
2377
  * Write `buffer` to the file specified by `fd`.
2324
2378
  *
@@ -2387,6 +2441,20 @@ declare module "fs" {
2387
2441
  buffer: TBuffer,
2388
2442
  callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
2389
2443
  ): void;
2444
+ /**
2445
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2446
+ * @param fd A file descriptor.
2447
+ * @param options An object with the following properties:
2448
+ * * `offset` The part of the buffer to be written. If not supplied, defaults to `0`.
2449
+ * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
2450
+ * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2451
+ */
2452
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
2453
+ fd: number,
2454
+ buffer: TBuffer,
2455
+ options: WriteOptions,
2456
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
2457
+ ): void;
2390
2458
  /**
2391
2459
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2392
2460
  * @param fd A file descriptor.
@@ -2441,6 +2509,22 @@ declare module "fs" {
2441
2509
  bytesWritten: number;
2442
2510
  buffer: TBuffer;
2443
2511
  }>;
2512
+ /**
2513
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2514
+ * @param fd A file descriptor.
2515
+ * @param options An object with the following properties:
2516
+ * * `offset` The part of the buffer to be written. If not supplied, defaults to `0`.
2517
+ * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
2518
+ * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2519
+ */
2520
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
2521
+ fd: number,
2522
+ buffer?: TBuffer,
2523
+ options?: WriteOptions,
2524
+ ): Promise<{
2525
+ bytesWritten: number;
2526
+ buffer: TBuffer;
2527
+ }>;
2444
2528
  /**
2445
2529
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2446
2530
  * @param fd A file descriptor.
@@ -48,6 +48,7 @@ declare module "http" {
48
48
  // incoming headers will never contain number
49
49
  interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
50
50
  accept?: string | undefined;
51
+ "accept-encoding"?: string | undefined;
51
52
  "accept-language"?: string | undefined;
52
53
  "accept-patch"?: string | undefined;
53
54
  "accept-ranges"?: string | undefined;
@@ -207,7 +208,7 @@ declare module "http" {
207
208
  | undefined;
208
209
  defaultPort?: number | string | undefined;
209
210
  family?: number | undefined;
210
- headers?: OutgoingHttpHeaders | undefined;
211
+ headers?: OutgoingHttpHeaders | readonly string[] | undefined;
211
212
  hints?: LookupOptions["hints"];
212
213
  host?: string | null | undefined;
213
214
  hostname?: string | null | undefined;
@@ -109,8 +109,8 @@ declare module "net" {
109
109
  * @since v0.1.90
110
110
  * @param [encoding='utf8'] Only used when data is `string`.
111
111
  */
112
- write(buffer: Uint8Array | string, cb?: (err?: Error) => void): boolean;
113
- write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error) => void): boolean;
112
+ write(buffer: Uint8Array | string, cb?: (err?: Error | null) => void): boolean;
113
+ write(str: Uint8Array | string, encoding?: BufferEncoding, cb?: (err?: Error | null) => void): boolean;
114
114
  /**
115
115
  * Initiate a connection on a given socket.
116
116
  *
@@ -377,7 +377,7 @@ declare module "net" {
377
377
  addListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
378
378
  addListener(
379
379
  event: "connectionAttemptFailed",
380
- listener: (ip: string, port: number, family: number) => void,
380
+ listener: (ip: string, port: number, family: number, error: Error) => void,
381
381
  ): this;
382
382
  addListener(
383
383
  event: "connectionAttemptTimeout",
@@ -397,7 +397,7 @@ declare module "net" {
397
397
  emit(event: "close", hadError: boolean): boolean;
398
398
  emit(event: "connect"): boolean;
399
399
  emit(event: "connectionAttempt", ip: string, port: number, family: number): boolean;
400
- emit(event: "connectionAttemptFailed", ip: string, port: number, family: number): boolean;
400
+ emit(event: "connectionAttemptFailed", ip: string, port: number, family: number, error: Error): boolean;
401
401
  emit(event: "connectionAttemptTimeout", ip: string, port: number, family: number): boolean;
402
402
  emit(event: "data", data: Buffer): boolean;
403
403
  emit(event: "drain"): boolean;
@@ -410,7 +410,10 @@ declare module "net" {
410
410
  on(event: "close", listener: (hadError: boolean) => void): this;
411
411
  on(event: "connect", listener: () => void): this;
412
412
  on(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
413
- on(event: "connectionAttemptFailed", listener: (ip: string, port: number, family: number) => void): this;
413
+ on(
414
+ event: "connectionAttemptFailed",
415
+ listener: (ip: string, port: number, family: number, error: Error) => void,
416
+ ): this;
414
417
  on(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
415
418
  on(event: "data", listener: (data: Buffer) => void): this;
416
419
  on(event: "drain", listener: () => void): this;
@@ -425,7 +428,10 @@ declare module "net" {
425
428
  once(event: string, listener: (...args: any[]) => void): this;
426
429
  once(event: "close", listener: (hadError: boolean) => void): this;
427
430
  once(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
428
- once(event: "connectionAttemptFailed", listener: (ip: string, port: number, family: number) => void): this;
431
+ once(
432
+ event: "connectionAttemptFailed",
433
+ listener: (ip: string, port: number, family: number, error: Error) => void,
434
+ ): this;
429
435
  once(event: "connectionAttemptTimeout", listener: (ip: string, port: number, family: number) => void): this;
430
436
  once(event: "connect", listener: () => void): this;
431
437
  once(event: "data", listener: (data: Buffer) => void): this;
@@ -444,7 +450,7 @@ declare module "net" {
444
450
  prependListener(event: "connectionAttempt", listener: (ip: string, port: number, family: number) => void): this;
445
451
  prependListener(
446
452
  event: "connectionAttemptFailed",
447
- listener: (ip: string, port: number, family: number) => void,
453
+ listener: (ip: string, port: number, family: number, error: Error) => void,
448
454
  ): this;
449
455
  prependListener(
450
456
  event: "connectionAttemptTimeout",
@@ -469,7 +475,7 @@ declare module "net" {
469
475
  ): this;
470
476
  prependOnceListener(
471
477
  event: "connectionAttemptFailed",
472
- listener: (ip: string, port: number, family: number) => void,
478
+ listener: (ip: string, port: number, family: number, error: Error) => void,
473
479
  ): this;
474
480
  prependOnceListener(
475
481
  event: "connectionAttemptTimeout",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "22.15.9",
3
+ "version": "22.15.18",
4
4
  "description": "TypeScript definitions for node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  "undici-types": "~6.21.0"
221
221
  },
222
222
  "peerDependencies": {},
223
- "typesPublisherContentHash": "6720be548d81d07c3915ff0ebadbd30c285033cb6e37cad29fb87a1a782ae142",
223
+ "typesPublisherContentHash": "2b90948f1fb3116c8907f2beaa3f3e5508eb0101dc27013c967a068001011e3e",
224
224
  "typeScriptVersion": "5.1"
225
225
  }
@@ -58,7 +58,7 @@ declare module "vm" {
58
58
  }
59
59
  interface ScriptOptions extends BaseOptions {
60
60
  /**
61
- * V8's code cache data for the supplied source.
61
+ * Provides an optional data with V8's code cache data for the supplied source.
62
62
  */
63
63
  cachedData?: Buffer | NodeJS.ArrayBufferView | undefined;
64
64
  /** @deprecated in favor of `script.createCachedData()` */
@@ -110,18 +110,24 @@ declare module "vm" {
110
110
  microtaskMode?: CreateContextOptions["microtaskMode"];
111
111
  }
112
112
  interface RunningCodeOptions extends RunningScriptOptions {
113
- cachedData?: ScriptOptions["cachedData"];
113
+ /**
114
+ * Provides an optional data with V8's code cache data for the supplied source.
115
+ */
116
+ cachedData?: ScriptOptions["cachedData"] | undefined;
114
117
  importModuleDynamically?: ScriptOptions["importModuleDynamically"];
115
118
  }
116
119
  interface RunningCodeInNewContextOptions extends RunningScriptInNewContextOptions {
117
- cachedData?: ScriptOptions["cachedData"];
120
+ /**
121
+ * Provides an optional data with V8's code cache data for the supplied source.
122
+ */
123
+ cachedData?: ScriptOptions["cachedData"] | undefined;
118
124
  importModuleDynamically?: ScriptOptions["importModuleDynamically"];
119
125
  }
120
126
  interface CompileFunctionOptions extends BaseOptions {
121
127
  /**
122
128
  * Provides an optional data with V8's code cache data for the supplied source.
123
129
  */
124
- cachedData?: Buffer | undefined;
130
+ cachedData?: ScriptOptions["cachedData"] | undefined;
125
131
  /**
126
132
  * Specifies whether to produce new cache data.
127
133
  * @default false
@@ -848,6 +854,9 @@ declare module "vm" {
848
854
  * @default 'vm:module(i)' where i is a context-specific ascending index.
849
855
  */
850
856
  identifier?: string | undefined;
857
+ /**
858
+ * Provides an optional data with V8's code cache data for the supplied source.
859
+ */
851
860
  cachedData?: ScriptOptions["cachedData"] | undefined;
852
861
  context?: Context | undefined;
853
862
  lineOffset?: BaseOptions["lineOffset"] | undefined;
@@ -856,7 +865,13 @@ declare module "vm" {
856
865
  * Called during evaluation of this module to initialize the `import.meta`.
857
866
  */
858
867
  initializeImportMeta?: ((meta: ImportMeta, module: SourceTextModule) => void) | undefined;
859
- importModuleDynamically?: ScriptOptions["importModuleDynamically"] | undefined;
868
+ importModuleDynamically?:
869
+ | ((
870
+ specifier: string,
871
+ referrer: SourceTextModule,
872
+ importAttributes: ImportAttributes,
873
+ ) => Module | Promise<Module>)
874
+ | undefined;
860
875
  }
861
876
  /**
862
877
  * This feature is only available with the `--experimental-vm-modules` command
@@ -8,7 +8,7 @@ This package contains type definitions for node (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: Mon, 05 May 2025 23:02:37 GMT
11
+ * Last updated: Wed, 14 May 2025 04:37:31 GMT
12
12
  * Dependencies: [undici-types](https://npmjs.com/package/undici-types)
13
13
 
14
14
  # Credits
@@ -266,7 +266,7 @@ declare module "cluster" {
266
266
  * @since v0.7.7
267
267
  * @return A reference to `worker`.
268
268
  */
269
- disconnect(): void;
269
+ disconnect(): this;
270
270
  /**
271
271
  * This function returns `true` if the worker is connected to its primary via its
272
272
  * IPC channel, `false` otherwise. A worker is connected to its primary after it
@@ -259,7 +259,7 @@ declare module "diagnostics_channel" {
259
259
  * @param store The store to unbind from the channel.
260
260
  * @return `true` if the store was found, `false` otherwise.
261
261
  */
262
- unbindStore(store: any): void;
262
+ unbindStore(store: AsyncLocalStorage<StoreType>): boolean;
263
263
  /**
264
264
  * Applies the given data to any AsyncLocalStorage instances bound to the channel
265
265
  * for the duration of the given function, then publishes to the channel within
@@ -547,6 +547,25 @@ declare module "diagnostics_channel" {
547
547
  thisArg?: any,
548
548
  ...args: Parameters<Fn>
549
549
  ): void;
550
+ /**
551
+ * `true` if any of the individual channels has a subscriber, `false` if not.
552
+ *
553
+ * This is a helper method available on a {@link TracingChannel} instance to check
554
+ * if any of the [TracingChannel Channels](https://nodejs.org/api/diagnostics_channel.html#tracingchannel-channels) have subscribers.
555
+ * A `true` is returned if any of them have at least one subscriber, a `false` is returned otherwise.
556
+ *
557
+ * ```js
558
+ * const diagnostics_channel = require('node:diagnostics_channel');
559
+ *
560
+ * const channels = diagnostics_channel.tracingChannel('my-channel');
561
+ *
562
+ * if (channels.hasSubscribers) {
563
+ * // Do something
564
+ * }
565
+ * ```
566
+ * @since v22.0.0, v20.13.0
567
+ */
568
+ readonly hasSubscribers: boolean;
550
569
  }
551
570
  }
552
571
  declare module "node:diagnostics_channel" {
@@ -718,6 +718,19 @@ declare module "fs/promises" {
718
718
  recursive?: boolean | undefined;
719
719
  },
720
720
  ): Promise<Dirent[]>;
721
+ /**
722
+ * Asynchronous readdir(3) - read a directory.
723
+ * @param path A path to a directory. If a URL is provided, it must use the `file:` protocol.
724
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
725
+ */
726
+ function readdir(
727
+ path: PathLike,
728
+ options: {
729
+ encoding: "buffer";
730
+ withFileTypes: true;
731
+ recursive?: boolean | undefined;
732
+ },
733
+ ): Promise<Dirent<Buffer>[]>;
721
734
  /**
722
735
  * Reads the contents of the symbolic link referred to by `path`. See the POSIX [`readlink(2)`](http://man7.org/linux/man-pages/man2/readlink.2.html) documentation for more detail. The promise is
723
736
  * fulfilled with the`linkString` upon success.
@@ -198,7 +198,7 @@ declare module "fs" {
198
198
  * the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s.
199
199
  * @since v10.10.0
200
200
  */
201
- export class Dirent {
201
+ export class Dirent<Name extends string | Buffer = string> {
202
202
  /**
203
203
  * Returns `true` if the `fs.Dirent` object describes a regular file.
204
204
  * @since v10.10.0
@@ -241,7 +241,7 @@ declare module "fs" {
241
241
  * value is determined by the `options.encoding` passed to {@link readdir} or {@link readdirSync}.
242
242
  * @since v10.10.0
243
243
  */
244
- name: string;
244
+ name: Name;
245
245
  /**
246
246
  * The base path that this `fs.Dirent` object refers to.
247
247
  * @since v20.12.0
@@ -2040,6 +2040,20 @@ declare module "fs" {
2040
2040
  },
2041
2041
  callback: (err: NodeJS.ErrnoException | null, files: Dirent[]) => void,
2042
2042
  ): void;
2043
+ /**
2044
+ * Asynchronous readdir(3) - read a directory.
2045
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2046
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
2047
+ */
2048
+ export function readdir(
2049
+ path: PathLike,
2050
+ options: {
2051
+ encoding: "buffer";
2052
+ withFileTypes: true;
2053
+ recursive?: boolean | undefined;
2054
+ },
2055
+ callback: (err: NodeJS.ErrnoException | null, files: Dirent<Buffer>[]) => void,
2056
+ ): void;
2043
2057
  export namespace readdir {
2044
2058
  /**
2045
2059
  * Asynchronous readdir(3) - read a directory.
@@ -2099,6 +2113,19 @@ declare module "fs" {
2099
2113
  recursive?: boolean | undefined;
2100
2114
  },
2101
2115
  ): Promise<Dirent[]>;
2116
+ /**
2117
+ * Asynchronous readdir(3) - read a directory.
2118
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2119
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
2120
+ */
2121
+ function __promisify__(
2122
+ path: PathLike,
2123
+ options: {
2124
+ encoding: "buffer";
2125
+ withFileTypes: true;
2126
+ recursive?: boolean | undefined;
2127
+ },
2128
+ ): Promise<Dirent<Buffer>[]>;
2102
2129
  }
2103
2130
  /**
2104
2131
  * Reads the contents of the directory.
@@ -2166,6 +2193,19 @@ declare module "fs" {
2166
2193
  recursive?: boolean | undefined;
2167
2194
  },
2168
2195
  ): Dirent[];
2196
+ /**
2197
+ * Synchronous readdir(3) - read a directory.
2198
+ * @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
2199
+ * @param options Must include `withFileTypes: true` and `encoding: 'buffer'`.
2200
+ */
2201
+ export function readdirSync(
2202
+ path: PathLike,
2203
+ options: {
2204
+ encoding: "buffer";
2205
+ withFileTypes: true;
2206
+ recursive?: boolean | undefined;
2207
+ },
2208
+ ): Dirent<Buffer>[];
2169
2209
  /**
2170
2210
  * Closes the file descriptor. No arguments other than a possible exception are
2171
2211
  * given to the completion callback.
@@ -2319,6 +2359,20 @@ declare module "fs" {
2319
2359
  * @since v0.1.96
2320
2360
  */
2321
2361
  export function fsyncSync(fd: number): void;
2362
+ export interface WriteOptions {
2363
+ /**
2364
+ * @default 0
2365
+ */
2366
+ offset?: number | undefined;
2367
+ /**
2368
+ * @default `buffer.byteLength - offset`
2369
+ */
2370
+ length?: number | undefined;
2371
+ /**
2372
+ * @default null
2373
+ */
2374
+ position?: number | undefined | null;
2375
+ }
2322
2376
  /**
2323
2377
  * Write `buffer` to the file specified by `fd`.
2324
2378
  *
@@ -2387,6 +2441,20 @@ declare module "fs" {
2387
2441
  buffer: TBuffer,
2388
2442
  callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
2389
2443
  ): void;
2444
+ /**
2445
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2446
+ * @param fd A file descriptor.
2447
+ * @param options An object with the following properties:
2448
+ * * `offset` The part of the buffer to be written. If not supplied, defaults to `0`.
2449
+ * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
2450
+ * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2451
+ */
2452
+ export function write<TBuffer extends NodeJS.ArrayBufferView>(
2453
+ fd: number,
2454
+ buffer: TBuffer,
2455
+ options: WriteOptions,
2456
+ callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void,
2457
+ ): void;
2390
2458
  /**
2391
2459
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2392
2460
  * @param fd A file descriptor.
@@ -2441,6 +2509,22 @@ declare module "fs" {
2441
2509
  bytesWritten: number;
2442
2510
  buffer: TBuffer;
2443
2511
  }>;
2512
+ /**
2513
+ * Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
2514
+ * @param fd A file descriptor.
2515
+ * @param options An object with the following properties:
2516
+ * * `offset` The part of the buffer to be written. If not supplied, defaults to `0`.
2517
+ * * `length` The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
2518
+ * * `position` The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
2519
+ */
2520
+ function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
2521
+ fd: number,
2522
+ buffer?: TBuffer,
2523
+ options?: WriteOptions,
2524
+ ): Promise<{
2525
+ bytesWritten: number;
2526
+ buffer: TBuffer;
2527
+ }>;
2444
2528
  /**
2445
2529
  * Asynchronously writes `string` to the file referenced by the supplied file descriptor.
2446
2530
  * @param fd A file descriptor.
@@ -48,6 +48,7 @@ declare module "http" {
48
48
  // incoming headers will never contain number
49
49
  interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
50
50
  accept?: string | undefined;
51
+ "accept-encoding"?: string | undefined;
51
52
  "accept-language"?: string | undefined;
52
53
  "accept-patch"?: string | undefined;
53
54
  "accept-ranges"?: string | undefined;
@@ -207,7 +208,7 @@ declare module "http" {
207
208
  | undefined;
208
209
  defaultPort?: number | string | undefined;
209
210
  family?: number | undefined;
210
- headers?: OutgoingHttpHeaders | undefined;
211
+ headers?: OutgoingHttpHeaders | readonly string[] | undefined;
211
212
  hints?: LookupOptions["hints"];
212
213
  host?: string | null | undefined;
213
214
  hostname?: string | null | undefined;