@types/node 22.15.33 → 22.17.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.
Files changed (69) hide show
  1. node v22.17/README.md +15 -0
  2. {node v22.15 → node v22.17}/buffer.d.ts +5 -1
  3. {node v22.15 → node v22.17}/child_process.d.ts +25 -121
  4. {node v22.15 → node v22.17}/crypto.d.ts +17 -1
  5. {node v22.15 → node v22.17}/dns/promises.d.ts +11 -10
  6. {node v22.15 → node v22.17}/dns.d.ts +18 -19
  7. {node v22.15 → node v22.17}/events.d.ts +0 -1
  8. {node v22.15 → node v22.17}/fs/promises.d.ts +22 -11
  9. {node v22.15 → node v22.17}/fs.d.ts +41 -13
  10. {node v22.15 → node v22.17}/http.d.ts +63 -1
  11. {node v22.15 → node v22.17}/http2.d.ts +12 -1
  12. {node v22.15 → node v22.17}/inspector.d.ts +157 -4
  13. {node v22.15 → node v22.17}/module.d.ts +47 -14
  14. {node v22.15 → node v22.17}/package.json +3 -83
  15. {node v22.15 → node v22.17}/process.d.ts +0 -2
  16. {node v22.15 → node v22.17}/readline/promises.d.ts +0 -1
  17. {node v22.15 → node v22.17}/repl.d.ts +3 -5
  18. {node v22.15 → node v22.17}/sqlite.d.ts +172 -0
  19. {node v22.15 → node v22.17}/stream/web.d.ts +8 -0
  20. {node v22.15 → node v22.17}/stream.d.ts +0 -11
  21. node v22.17/test.d.ts +2183 -0
  22. {node v22.15 → node v22.17}/url.d.ts +1 -3
  23. {node v22.15 → node v22.17}/util.d.ts +19 -4
  24. {node v22.15 → node v22.17}/v8.d.ts +27 -30
  25. {node v22.15 → node v22.17}/worker_threads.d.ts +33 -17
  26. {node v22.15 → node v22.17}/zlib.d.ts +8 -2
  27. node v22.15/README.md +0 -15
  28. node v22.15/test.d.ts +0 -2278
  29. {node v22.15 → node v22.17}/LICENSE +0 -0
  30. {node v22.15 → node v22.17}/assert/strict.d.ts +0 -0
  31. {node v22.15 → node v22.17}/assert.d.ts +0 -0
  32. {node v22.15 → node v22.17}/async_hooks.d.ts +1 -1
  33. {node v22.15 → node v22.17}/buffer.buffer.d.ts +0 -0
  34. {node v22.15 → node v22.17}/cluster.d.ts +0 -0
  35. {node v22.15 → node v22.17}/compatibility/disposable.d.ts +0 -0
  36. {node v22.15 → node v22.17}/compatibility/index.d.ts +0 -0
  37. {node v22.15 → node v22.17}/compatibility/indexable.d.ts +0 -0
  38. {node v22.15 → node v22.17}/compatibility/iterators.d.ts +0 -0
  39. {node v22.15 → node v22.17}/console.d.ts +0 -0
  40. {node v22.15 → node v22.17}/constants.d.ts +0 -0
  41. {node v22.15 → node v22.17}/dgram.d.ts +0 -0
  42. {node v22.15 → node v22.17}/diagnostics_channel.d.ts +0 -0
  43. {node v22.15 → node v22.17}/dom-events.d.ts +0 -0
  44. {node v22.15 → node v22.17}/domain.d.ts +0 -0
  45. {node v22.15 → node v22.17}/globals.d.ts +0 -0
  46. {node v22.15 → node v22.17}/globals.typedarray.d.ts +0 -0
  47. {node v22.15 → node v22.17}/https.d.ts +0 -0
  48. {node v22.15 → node v22.17}/index.d.ts +0 -0
  49. {node v22.15 → node v22.17}/net.d.ts +0 -0
  50. {node v22.15 → node v22.17}/os.d.ts +0 -0
  51. {node v22.15 → node v22.17}/path.d.ts +0 -0
  52. {node v22.15 → node v22.17}/perf_hooks.d.ts +0 -0
  53. {node v22.15 → node v22.17}/punycode.d.ts +0 -0
  54. {node v22.15 → node v22.17}/querystring.d.ts +0 -0
  55. {node v22.15 → node v22.17}/readline.d.ts +0 -0
  56. {node v22.15 → node v22.17}/sea.d.ts +0 -0
  57. {node v22.15 → node v22.17}/stream/consumers.d.ts +0 -0
  58. {node v22.15 → node v22.17}/stream/promises.d.ts +0 -0
  59. {node v22.15 → node v22.17}/string_decoder.d.ts +0 -0
  60. {node v22.15 → node v22.17}/timers/promises.d.ts +0 -0
  61. {node v22.15 → node v22.17}/timers.d.ts +0 -0
  62. {node v22.15 → node v22.17}/tls.d.ts +0 -0
  63. {node v22.15 → node v22.17}/trace_events.d.ts +0 -0
  64. {node v22.15 → node v22.17}/ts5.6/buffer.buffer.d.ts +0 -0
  65. {node v22.15 → node v22.17}/ts5.6/globals.typedarray.d.ts +0 -0
  66. {node v22.15 → node v22.17}/ts5.6/index.d.ts +0 -0
  67. {node v22.15 → node v22.17}/tty.d.ts +0 -0
  68. {node v22.15 → node v22.17}/vm.d.ts +0 -0
  69. {node v22.15 → node v22.17}/wasi.d.ts +0 -0
@@ -243,8 +243,8 @@ declare module "fs" {
243
243
  */
244
244
  name: Name;
245
245
  /**
246
- * The base path that this `fs.Dirent` object refers to.
247
- * @since v20.12.0
246
+ * The path to the parent directory of the file this `fs.Dirent` object refers to.
247
+ * @since v20.12.0, v18.20.0
248
248
  */
249
249
  parentPath: string;
250
250
  /**
@@ -328,6 +328,19 @@ declare module "fs" {
328
328
  * @since v12.12.0
329
329
  */
330
330
  readSync(): Dirent | null;
331
+ /**
332
+ * Calls `dir.close()` and returns a promise that fulfills when the
333
+ * dir is closed.
334
+ * @since v22.17.0
335
+ * @experimental
336
+ */
337
+ [Symbol.asyncDispose](): Promise<void>;
338
+ /**
339
+ * Calls `dir.closeSync()` and returns `undefined`.
340
+ * @since v22.17.0
341
+ * @experimental
342
+ */
343
+ [Symbol.dispose](): void;
331
344
  }
332
345
  /**
333
346
  * Class: fs.StatWatcher
@@ -4200,7 +4213,6 @@ declare module "fs" {
4200
4213
  * blob.stream();
4201
4214
  * ```
4202
4215
  * @since v19.8.0
4203
- * @experimental
4204
4216
  */
4205
4217
  export function openAsBlob(path: PathLike, options?: OpenAsBlobOptions): Promise<Blob>;
4206
4218
 
@@ -4361,7 +4373,7 @@ declare module "fs" {
4361
4373
  * Current working directory.
4362
4374
  * @default process.cwd()
4363
4375
  */
4364
- cwd?: string | undefined;
4376
+ cwd?: string | URL | undefined;
4365
4377
  /**
4366
4378
  * `true` if the glob should return paths as `Dirent`s, `false` otherwise.
4367
4379
  * @default false
@@ -4386,13 +4398,23 @@ declare module "fs" {
4386
4398
 
4387
4399
  /**
4388
4400
  * Retrieves the files matching the specified pattern.
4401
+ *
4402
+ * ```js
4403
+ * import { glob } from 'node:fs';
4404
+ *
4405
+ * glob('*.js', (err, matches) => {
4406
+ * if (err) throw err;
4407
+ * console.log(matches);
4408
+ * });
4409
+ * ```
4410
+ * @since v22.0.0
4389
4411
  */
4390
4412
  export function glob(
4391
- pattern: string | string[],
4413
+ pattern: string | readonly string[],
4392
4414
  callback: (err: NodeJS.ErrnoException | null, matches: string[]) => void,
4393
4415
  ): void;
4394
4416
  export function glob(
4395
- pattern: string | string[],
4417
+ pattern: string | readonly string[],
4396
4418
  options: GlobOptionsWithFileTypes,
4397
4419
  callback: (
4398
4420
  err: NodeJS.ErrnoException | null,
@@ -4400,7 +4422,7 @@ declare module "fs" {
4400
4422
  ) => void,
4401
4423
  ): void;
4402
4424
  export function glob(
4403
- pattern: string | string[],
4425
+ pattern: string | readonly string[],
4404
4426
  options: GlobOptionsWithoutFileTypes,
4405
4427
  callback: (
4406
4428
  err: NodeJS.ErrnoException | null,
@@ -4408,7 +4430,7 @@ declare module "fs" {
4408
4430
  ) => void,
4409
4431
  ): void;
4410
4432
  export function glob(
4411
- pattern: string | string[],
4433
+ pattern: string | readonly string[],
4412
4434
  options: GlobOptions,
4413
4435
  callback: (
4414
4436
  err: NodeJS.ErrnoException | null,
@@ -4416,19 +4438,25 @@ declare module "fs" {
4416
4438
  ) => void,
4417
4439
  ): void;
4418
4440
  /**
4419
- * Retrieves the files matching the specified pattern.
4441
+ * ```js
4442
+ * import { globSync } from 'node:fs';
4443
+ *
4444
+ * console.log(globSync('*.js'));
4445
+ * ```
4446
+ * @since v22.0.0
4447
+ * @returns paths of files that match the pattern.
4420
4448
  */
4421
- export function globSync(pattern: string | string[]): string[];
4449
+ export function globSync(pattern: string | readonly string[]): string[];
4422
4450
  export function globSync(
4423
- pattern: string | string[],
4451
+ pattern: string | readonly string[],
4424
4452
  options: GlobOptionsWithFileTypes,
4425
4453
  ): Dirent[];
4426
4454
  export function globSync(
4427
- pattern: string | string[],
4455
+ pattern: string | readonly string[],
4428
4456
  options: GlobOptionsWithoutFileTypes,
4429
4457
  ): string[];
4430
4458
  export function globSync(
4431
- pattern: string | string[],
4459
+ pattern: string | readonly string[],
4432
4460
  options: GlobOptions,
4433
4461
  ): Dirent[] | string[];
4434
4462
  }
@@ -911,7 +911,7 @@ declare module "http" {
911
911
  * the request body should be sent.
912
912
  * @since v10.0.0
913
913
  */
914
- writeProcessing(): void;
914
+ writeProcessing(callback?: () => void): void;
915
915
  }
916
916
  interface InformationEvent {
917
917
  statusCode: number;
@@ -1570,6 +1570,68 @@ declare module "http" {
1570
1570
  * @since v0.11.4
1571
1571
  */
1572
1572
  destroy(): void;
1573
+ /**
1574
+ * Produces a socket/stream to be used for HTTP requests.
1575
+ *
1576
+ * By default, this function is the same as `net.createConnection()`. However,
1577
+ * custom agents may override this method in case greater flexibility is desired.
1578
+ *
1579
+ * A socket/stream can be supplied in one of two ways: by returning the
1580
+ * socket/stream from this function, or by passing the socket/stream to `callback`.
1581
+ *
1582
+ * This method is guaranteed to return an instance of the `net.Socket` class,
1583
+ * a subclass of `stream.Duplex`, unless the user specifies a socket
1584
+ * type other than `net.Socket`.
1585
+ *
1586
+ * `callback` has a signature of `(err, stream)`.
1587
+ * @since v0.11.4
1588
+ * @param options Options containing connection details. Check `createConnection` for the format of the options
1589
+ * @param callback Callback function that receives the created socket
1590
+ */
1591
+ createConnection(
1592
+ options: ClientRequestArgs,
1593
+ callback?: (err: Error | null, stream: stream.Duplex) => void,
1594
+ ): stream.Duplex;
1595
+ /**
1596
+ * Called when `socket` is detached from a request and could be persisted by the`Agent`. Default behavior is to:
1597
+ *
1598
+ * ```js
1599
+ * socket.setKeepAlive(true, this.keepAliveMsecs);
1600
+ * socket.unref();
1601
+ * return true;
1602
+ * ```
1603
+ *
1604
+ * This method can be overridden by a particular `Agent` subclass. If this
1605
+ * method returns a falsy value, the socket will be destroyed instead of persisting
1606
+ * it for use with the next request.
1607
+ *
1608
+ * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
1609
+ * @since v8.1.0
1610
+ */
1611
+ keepSocketAlive(socket: stream.Duplex): void;
1612
+ /**
1613
+ * Called when `socket` is attached to `request` after being persisted because of
1614
+ * the keep-alive options. Default behavior is to:
1615
+ *
1616
+ * ```js
1617
+ * socket.ref();
1618
+ * ```
1619
+ *
1620
+ * This method can be overridden by a particular `Agent` subclass.
1621
+ *
1622
+ * The `socket` argument can be an instance of `net.Socket`, a subclass of `stream.Duplex`.
1623
+ * @since v8.1.0
1624
+ */
1625
+ reuseSocket(socket: stream.Duplex, request: ClientRequest): void;
1626
+ /**
1627
+ * Get a unique name for a set of request options, to determine whether a
1628
+ * connection can be reused. For an HTTP agent, this returns`host:port:localAddress` or `host:port:localAddress:family`. For an HTTPS agent,
1629
+ * the name includes the CA, cert, ciphers, and other HTTPS/TLS-specific options
1630
+ * that determine socket reusability.
1631
+ * @since v0.11.4
1632
+ * @param options A set of options providing information for name generation
1633
+ */
1634
+ getName(options?: ClientRequestArgs): string;
1573
1635
  }
1574
1636
  const METHODS: string[];
1575
1637
  const STATUS_CODES: {
@@ -965,7 +965,10 @@ declare module "http2" {
965
965
  * * `:path` \= `/`
966
966
  * @since v8.4.0
967
967
  */
968
- request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream;
968
+ request(
969
+ headers?: OutgoingHttpHeaders | readonly string[],
970
+ options?: ClientSessionRequestOptions,
971
+ ): ClientHttp2Stream;
969
972
  addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
970
973
  addListener(event: "origin", listener: (origins: string[]) => void): this;
971
974
  addListener(
@@ -1291,6 +1294,14 @@ declare module "http2" {
1291
1294
  * @default 100000
1292
1295
  */
1293
1296
  unknownProtocolTimeout?: number | undefined;
1297
+ /**
1298
+ * If `true`, it turns on strict leading
1299
+ * and trailing whitespace validation for HTTP/2 header field names and values
1300
+ * as per [RFC-9113](https://www.rfc-editor.org/rfc/rfc9113.html#section-8.2.1).
1301
+ * @since v24.2.0
1302
+ * @default true
1303
+ */
1304
+ strictFieldWhitespaceValidation?: boolean | undefined;
1294
1305
  }
1295
1306
  export interface ClientSessionOptions extends SessionOptions {
1296
1307
  /**
@@ -1768,12 +1768,26 @@ declare module 'inspector' {
1768
1768
  status: number;
1769
1769
  statusText: string;
1770
1770
  headers: Headers;
1771
+ mimeType: string;
1772
+ charset: string;
1771
1773
  }
1772
1774
  /**
1773
1775
  * Request / response headers as keys / values of JSON object.
1774
1776
  */
1775
1777
  interface Headers {
1776
1778
  }
1779
+ interface StreamResourceContentParameterType {
1780
+ /**
1781
+ * Identifier of the request to stream.
1782
+ */
1783
+ requestId: RequestId;
1784
+ }
1785
+ interface StreamResourceContentReturnType {
1786
+ /**
1787
+ * Data that has been buffered until streaming is enabled.
1788
+ */
1789
+ bufferedData: never;
1790
+ }
1777
1791
  interface RequestWillBeSentEventDataType {
1778
1792
  /**
1779
1793
  * Request identifier.
@@ -1842,12 +1856,59 @@ declare module 'inspector' {
1842
1856
  */
1843
1857
  timestamp: MonotonicTime;
1844
1858
  }
1859
+ interface DataReceivedEventDataType {
1860
+ /**
1861
+ * Request identifier.
1862
+ */
1863
+ requestId: RequestId;
1864
+ /**
1865
+ * Timestamp.
1866
+ */
1867
+ timestamp: MonotonicTime;
1868
+ /**
1869
+ * Data chunk length.
1870
+ */
1871
+ dataLength: number;
1872
+ /**
1873
+ * Actual bytes received (might be less than dataLength for compressed encodings).
1874
+ */
1875
+ encodedDataLength: number;
1876
+ /**
1877
+ * Data that was received.
1878
+ * @experimental
1879
+ */
1880
+ data?: never | undefined;
1881
+ }
1845
1882
  }
1846
1883
  namespace NodeRuntime {
1847
1884
  interface NotifyWhenWaitingForDisconnectParameterType {
1848
1885
  enabled: boolean;
1849
1886
  }
1850
1887
  }
1888
+ namespace Target {
1889
+ type SessionID = string;
1890
+ type TargetID = string;
1891
+ interface TargetInfo {
1892
+ targetId: TargetID;
1893
+ type: string;
1894
+ title: string;
1895
+ url: string;
1896
+ attached: boolean;
1897
+ canAccessOpener: boolean;
1898
+ }
1899
+ interface SetAutoAttachParameterType {
1900
+ autoAttach: boolean;
1901
+ waitForDebuggerOnStart: boolean;
1902
+ }
1903
+ interface TargetCreatedEventDataType {
1904
+ targetInfo: TargetInfo;
1905
+ }
1906
+ interface AttachedToTargetEventDataType {
1907
+ sessionId: SessionID;
1908
+ targetInfo: TargetInfo;
1909
+ waitingForDebugger: boolean;
1910
+ }
1911
+ }
1851
1912
 
1852
1913
  /**
1853
1914
  * The `inspector.Session` is used for dispatching messages to the V8 inspector
@@ -2224,6 +2285,17 @@ declare module 'inspector' {
2224
2285
  * Enables network tracking, network events will now be delivered to the client.
2225
2286
  */
2226
2287
  post(method: 'Network.enable', callback?: (err: Error | null) => void): void;
2288
+ /**
2289
+ * Enables streaming of the response for the given requestId.
2290
+ * If enabled, the dataReceived event contains the data that was received during streaming.
2291
+ * @experimental
2292
+ */
2293
+ post(
2294
+ method: 'Network.streamResourceContent',
2295
+ params?: Network.StreamResourceContentParameterType,
2296
+ callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void
2297
+ ): void;
2298
+ post(method: 'Network.streamResourceContent', callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void): void;
2227
2299
  /**
2228
2300
  * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`.
2229
2301
  */
@@ -2237,6 +2309,8 @@ declare module 'inspector' {
2237
2309
  */
2238
2310
  post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void;
2239
2311
  post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void;
2312
+ post(method: 'Target.setAutoAttach', params?: Target.SetAutoAttachParameterType, callback?: (err: Error | null) => void): void;
2313
+ post(method: 'Target.setAutoAttach', callback?: (err: Error | null) => void): void;
2240
2314
 
2241
2315
  addListener(event: string, listener: (...args: any[]) => void): this;
2242
2316
  /**
@@ -2343,6 +2417,10 @@ declare module 'inspector' {
2343
2417
  addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2344
2418
  addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2345
2419
  addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2420
+ /**
2421
+ * Fired when data chunk was received over the network.
2422
+ */
2423
+ addListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2346
2424
  /**
2347
2425
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2348
2426
  * enabled.
@@ -2355,6 +2433,8 @@ declare module 'inspector' {
2355
2433
  * example, when inspector.waitingForDebugger is called
2356
2434
  */
2357
2435
  addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2436
+ addListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2437
+ addListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2358
2438
  emit(event: string | symbol, ...args: any[]): boolean;
2359
2439
  emit(event: 'inspectorNotification', message: InspectorNotification<object>): boolean;
2360
2440
  emit(event: 'Runtime.executionContextCreated', message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean;
@@ -2386,8 +2466,11 @@ declare module 'inspector' {
2386
2466
  emit(event: 'Network.responseReceived', message: InspectorNotification<Network.ResponseReceivedEventDataType>): boolean;
2387
2467
  emit(event: 'Network.loadingFailed', message: InspectorNotification<Network.LoadingFailedEventDataType>): boolean;
2388
2468
  emit(event: 'Network.loadingFinished', message: InspectorNotification<Network.LoadingFinishedEventDataType>): boolean;
2469
+ emit(event: 'Network.dataReceived', message: InspectorNotification<Network.DataReceivedEventDataType>): boolean;
2389
2470
  emit(event: 'NodeRuntime.waitingForDisconnect'): boolean;
2390
2471
  emit(event: 'NodeRuntime.waitingForDebugger'): boolean;
2472
+ emit(event: 'Target.targetCreated', message: InspectorNotification<Target.TargetCreatedEventDataType>): boolean;
2473
+ emit(event: 'Target.attachedToTarget', message: InspectorNotification<Target.AttachedToTargetEventDataType>): boolean;
2391
2474
  on(event: string, listener: (...args: any[]) => void): this;
2392
2475
  /**
2393
2476
  * Emitted when any notification from the V8 Inspector is received.
@@ -2493,6 +2576,10 @@ declare module 'inspector' {
2493
2576
  on(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2494
2577
  on(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2495
2578
  on(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2579
+ /**
2580
+ * Fired when data chunk was received over the network.
2581
+ */
2582
+ on(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2496
2583
  /**
2497
2584
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2498
2585
  * enabled.
@@ -2505,6 +2592,8 @@ declare module 'inspector' {
2505
2592
  * example, when inspector.waitingForDebugger is called
2506
2593
  */
2507
2594
  on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2595
+ on(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2596
+ on(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2508
2597
  once(event: string, listener: (...args: any[]) => void): this;
2509
2598
  /**
2510
2599
  * Emitted when any notification from the V8 Inspector is received.
@@ -2610,6 +2699,10 @@ declare module 'inspector' {
2610
2699
  once(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2611
2700
  once(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2612
2701
  once(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2702
+ /**
2703
+ * Fired when data chunk was received over the network.
2704
+ */
2705
+ once(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2613
2706
  /**
2614
2707
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2615
2708
  * enabled.
@@ -2622,6 +2715,8 @@ declare module 'inspector' {
2622
2715
  * example, when inspector.waitingForDebugger is called
2623
2716
  */
2624
2717
  once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2718
+ once(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2719
+ once(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2625
2720
  prependListener(event: string, listener: (...args: any[]) => void): this;
2626
2721
  /**
2627
2722
  * Emitted when any notification from the V8 Inspector is received.
@@ -2727,6 +2822,10 @@ declare module 'inspector' {
2727
2822
  prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2728
2823
  prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2729
2824
  prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2825
+ /**
2826
+ * Fired when data chunk was received over the network.
2827
+ */
2828
+ prependListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2730
2829
  /**
2731
2830
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2732
2831
  * enabled.
@@ -2739,6 +2838,8 @@ declare module 'inspector' {
2739
2838
  * example, when inspector.waitingForDebugger is called
2740
2839
  */
2741
2840
  prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2841
+ prependListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2842
+ prependListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2742
2843
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
2743
2844
  /**
2744
2845
  * Emitted when any notification from the V8 Inspector is received.
@@ -2844,6 +2945,10 @@ declare module 'inspector' {
2844
2945
  prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2845
2946
  prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2846
2947
  prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2948
+ /**
2949
+ * Fired when data chunk was received over the network.
2950
+ */
2951
+ prependOnceListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2847
2952
  /**
2848
2953
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2849
2954
  * enabled.
@@ -2856,6 +2961,8 @@ declare module 'inspector' {
2856
2961
  * example, when inspector.waitingForDebugger is called
2857
2962
  */
2858
2963
  prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2964
+ prependOnceListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2965
+ prependOnceListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2859
2966
  }
2860
2967
 
2861
2968
  /**
@@ -2942,13 +3049,20 @@ declare module 'inspector' {
2942
3049
 
2943
3050
  // DevTools protocol event broadcast methods
2944
3051
  namespace Network {
3052
+ /**
3053
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
3054
+ *
3055
+ * Broadcasts the `Network.dataReceived` event to connected frontends, or buffers the data if
3056
+ * `Network.streamResourceContent` command was not invoked for the given request yet.
3057
+ * @since v22.17.0
3058
+ */
3059
+ function dataReceived(params: DataReceivedEventDataType): void;
2945
3060
  /**
2946
3061
  * This feature is only available with the `--experimental-network-inspection` flag enabled.
2947
3062
  *
2948
3063
  * Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that
2949
3064
  * the application is about to send an HTTP request.
2950
3065
  * @since v22.6.0
2951
- * @experimental
2952
3066
  */
2953
3067
  function requestWillBeSent(params: RequestWillBeSentEventDataType): void;
2954
3068
  /**
@@ -2957,7 +3071,6 @@ declare module 'inspector' {
2957
3071
  * Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that
2958
3072
  * HTTP response is available.
2959
3073
  * @since v22.6.0
2960
- * @experimental
2961
3074
  */
2962
3075
  function responseReceived(params: ResponseReceivedEventDataType): void;
2963
3076
  /**
@@ -2966,7 +3079,6 @@ declare module 'inspector' {
2966
3079
  * Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that
2967
3080
  * HTTP request has finished loading.
2968
3081
  * @since v22.6.0
2969
- * @experimental
2970
3082
  */
2971
3083
  function loadingFinished(params: LoadingFinishedEventDataType): void;
2972
3084
  /**
@@ -2975,7 +3087,6 @@ declare module 'inspector' {
2975
3087
  * Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that
2976
3088
  * HTTP request has failed to load.
2977
3089
  * @since v22.7.0
2978
- * @experimental
2979
3090
  */
2980
3091
  function loadingFailed(params: LoadingFailedEventDataType): void;
2981
3092
  }
@@ -3014,6 +3125,7 @@ declare module 'inspector/promises' {
3014
3125
  NodeWorker,
3015
3126
  Network,
3016
3127
  NodeRuntime,
3128
+ Target,
3017
3129
  } from 'inspector';
3018
3130
 
3019
3131
  /**
@@ -3338,6 +3450,12 @@ declare module 'inspector/promises' {
3338
3450
  * Enables network tracking, network events will now be delivered to the client.
3339
3451
  */
3340
3452
  post(method: 'Network.enable'): Promise<void>;
3453
+ /**
3454
+ * Enables streaming of the response for the given requestId.
3455
+ * If enabled, the dataReceived event contains the data that was received during streaming.
3456
+ * @experimental
3457
+ */
3458
+ post(method: 'Network.streamResourceContent', params?: Network.StreamResourceContentParameterType): Promise<Network.StreamResourceContentReturnType>;
3341
3459
  /**
3342
3460
  * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`.
3343
3461
  */
@@ -3350,6 +3468,7 @@ declare module 'inspector/promises' {
3350
3468
  * Enable the `NodeRuntime.waitingForDisconnect`.
3351
3469
  */
3352
3470
  post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType): Promise<void>;
3471
+ post(method: 'Target.setAutoAttach', params?: Target.SetAutoAttachParameterType): Promise<void>;
3353
3472
 
3354
3473
  addListener(event: string, listener: (...args: any[]) => void): this;
3355
3474
  /**
@@ -3456,6 +3575,10 @@ declare module 'inspector/promises' {
3456
3575
  addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3457
3576
  addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3458
3577
  addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
3578
+ /**
3579
+ * Fired when data chunk was received over the network.
3580
+ */
3581
+ addListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3459
3582
  /**
3460
3583
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3461
3584
  * enabled.
@@ -3468,6 +3591,8 @@ declare module 'inspector/promises' {
3468
3591
  * example, when inspector.waitingForDebugger is called
3469
3592
  */
3470
3593
  addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
3594
+ addListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
3595
+ addListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3471
3596
  emit(event: string | symbol, ...args: any[]): boolean;
3472
3597
  emit(event: 'inspectorNotification', message: InspectorNotification<object>): boolean;
3473
3598
  emit(event: 'Runtime.executionContextCreated', message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean;
@@ -3499,8 +3624,11 @@ declare module 'inspector/promises' {
3499
3624
  emit(event: 'Network.responseReceived', message: InspectorNotification<Network.ResponseReceivedEventDataType>): boolean;
3500
3625
  emit(event: 'Network.loadingFailed', message: InspectorNotification<Network.LoadingFailedEventDataType>): boolean;
3501
3626
  emit(event: 'Network.loadingFinished', message: InspectorNotification<Network.LoadingFinishedEventDataType>): boolean;
3627
+ emit(event: 'Network.dataReceived', message: InspectorNotification<Network.DataReceivedEventDataType>): boolean;
3502
3628
  emit(event: 'NodeRuntime.waitingForDisconnect'): boolean;
3503
3629
  emit(event: 'NodeRuntime.waitingForDebugger'): boolean;
3630
+ emit(event: 'Target.targetCreated', message: InspectorNotification<Target.TargetCreatedEventDataType>): boolean;
3631
+ emit(event: 'Target.attachedToTarget', message: InspectorNotification<Target.AttachedToTargetEventDataType>): boolean;
3504
3632
  on(event: string, listener: (...args: any[]) => void): this;
3505
3633
  /**
3506
3634
  * Emitted when any notification from the V8 Inspector is received.
@@ -3606,6 +3734,10 @@ declare module 'inspector/promises' {
3606
3734
  on(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3607
3735
  on(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3608
3736
  on(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
3737
+ /**
3738
+ * Fired when data chunk was received over the network.
3739
+ */
3740
+ on(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3609
3741
  /**
3610
3742
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3611
3743
  * enabled.
@@ -3618,6 +3750,8 @@ declare module 'inspector/promises' {
3618
3750
  * example, when inspector.waitingForDebugger is called
3619
3751
  */
3620
3752
  on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
3753
+ on(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
3754
+ on(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3621
3755
  once(event: string, listener: (...args: any[]) => void): this;
3622
3756
  /**
3623
3757
  * Emitted when any notification from the V8 Inspector is received.
@@ -3723,6 +3857,10 @@ declare module 'inspector/promises' {
3723
3857
  once(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3724
3858
  once(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3725
3859
  once(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
3860
+ /**
3861
+ * Fired when data chunk was received over the network.
3862
+ */
3863
+ once(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3726
3864
  /**
3727
3865
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3728
3866
  * enabled.
@@ -3735,6 +3873,8 @@ declare module 'inspector/promises' {
3735
3873
  * example, when inspector.waitingForDebugger is called
3736
3874
  */
3737
3875
  once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
3876
+ once(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
3877
+ once(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3738
3878
  prependListener(event: string, listener: (...args: any[]) => void): this;
3739
3879
  /**
3740
3880
  * Emitted when any notification from the V8 Inspector is received.
@@ -3840,6 +3980,10 @@ declare module 'inspector/promises' {
3840
3980
  prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3841
3981
  prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3842
3982
  prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
3983
+ /**
3984
+ * Fired when data chunk was received over the network.
3985
+ */
3986
+ prependListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3843
3987
  /**
3844
3988
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3845
3989
  * enabled.
@@ -3852,6 +3996,8 @@ declare module 'inspector/promises' {
3852
3996
  * example, when inspector.waitingForDebugger is called
3853
3997
  */
3854
3998
  prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
3999
+ prependListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
4000
+ prependListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3855
4001
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
3856
4002
  /**
3857
4003
  * Emitted when any notification from the V8 Inspector is received.
@@ -3957,6 +4103,10 @@ declare module 'inspector/promises' {
3957
4103
  prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3958
4104
  prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3959
4105
  prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
4106
+ /**
4107
+ * Fired when data chunk was received over the network.
4108
+ */
4109
+ prependOnceListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3960
4110
  /**
3961
4111
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3962
4112
  * enabled.
@@ -3969,6 +4119,8 @@ declare module 'inspector/promises' {
3969
4119
  * example, when inspector.waitingForDebugger is called
3970
4120
  */
3971
4121
  prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
4122
+ prependOnceListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
4123
+ prependOnceListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3972
4124
  }
3973
4125
 
3974
4126
  export {
@@ -3989,6 +4141,7 @@ declare module 'inspector/promises' {
3989
4141
  NodeWorker,
3990
4142
  Network,
3991
4143
  NodeRuntime,
4144
+ Target,
3992
4145
  };
3993
4146
  }
3994
4147