@types/node 22.15.33 → 22.18.13

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 (77) hide show
  1. node v22.18/README.md +15 -0
  2. {node v22.15 → node v22.18}/assert.d.ts +19 -0
  3. {node v22.15 → node v22.18}/buffer.buffer.d.ts +9 -0
  4. {node v22.15 → node v22.18}/buffer.d.ts +14 -6
  5. {node v22.15 → node v22.18}/child_process.d.ts +89 -162
  6. {node v22.15 → node v22.18}/cluster.d.ts +4 -5
  7. {node v22.15 → node v22.18}/crypto.d.ts +203 -167
  8. {node v22.15 → node v22.18}/dgram.d.ts +9 -8
  9. {node v22.15 → node v22.18}/dns/promises.d.ts +11 -10
  10. {node v22.15 → node v22.18}/dns.d.ts +19 -20
  11. {node v22.15 → node v22.18}/events.d.ts +80 -35
  12. {node v22.15 → node v22.18}/fs/promises.d.ts +78 -56
  13. {node v22.15 → node v22.18}/fs.d.ts +153 -129
  14. node v22.18/globals.d.ts +172 -0
  15. node v22.18/globals.typedarray.d.ts +38 -0
  16. {node v22.15 → node v22.18}/http.d.ts +112 -32
  17. {node v22.15 → node v22.18}/http2.d.ts +45 -26
  18. {node v22.15 → node v22.18}/https.d.ts +96 -62
  19. {node v22.15 → node v22.18}/index.d.ts +7 -3
  20. node v22.15/inspector.d.ts → node v22.18/inspector.generated.d.ts +219 -10
  21. {node v22.15 → node v22.18}/module.d.ts +70 -13
  22. {node v22.15 → node v22.18}/net.d.ts +12 -11
  23. {node v22.15 → node v22.18}/os.d.ts +14 -3
  24. {node v22.15 → node v22.18}/package.json +3 -83
  25. {node v22.15 → node v22.18}/perf_hooks.d.ts +6 -8
  26. {node v22.15 → node v22.18}/process.d.ts +15 -27
  27. {node v22.15 → node v22.18}/readline/promises.d.ts +1 -2
  28. {node v22.15 → node v22.18}/repl.d.ts +3 -5
  29. {node v22.15 → node v22.18}/sqlite.d.ts +212 -6
  30. {node v22.15 → node v22.18}/stream/consumers.d.ts +2 -2
  31. {node v22.15 → node v22.18}/stream/web.d.ts +8 -0
  32. {node v22.15 → node v22.18}/stream.d.ts +29 -33
  33. {node v22.15 → node v22.18}/string_decoder.d.ts +2 -2
  34. node v22.18/test.d.ts +2162 -0
  35. {node v22.15 → node v22.18}/tls.d.ts +90 -66
  36. {node v22.15 → node v22.18}/ts5.6/buffer.buffer.d.ts +10 -2
  37. node v22.18/ts5.6/globals.typedarray.d.ts +34 -0
  38. {node v22.15 → node v22.18}/ts5.6/index.d.ts +7 -3
  39. {node v22.15 → node v22.18}/url.d.ts +13 -4
  40. {node v22.15 → node v22.18}/util.d.ts +21 -6
  41. {node v22.15 → node v22.18}/v8.d.ts +33 -35
  42. {node v22.15 → node v22.18}/vm.d.ts +21 -50
  43. {node v22.15 → node v22.18}/wasi.d.ts +1 -1
  44. node v22.18/web-globals/abortcontroller.d.ts +34 -0
  45. node v22.18/web-globals/domexception.d.ts +68 -0
  46. node v22.15/dom-events.d.ts → node v22.18/web-globals/events.d.ts +49 -51
  47. node v22.18/web-globals/fetch.d.ts +46 -0
  48. node v22.18/web-globals/navigator.d.ts +22 -0
  49. node v22.18/web-globals/storage.d.ts +24 -0
  50. {node v22.15 → node v22.18}/worker_threads.d.ts +86 -67
  51. {node v22.15 → node v22.18}/zlib.d.ts +33 -26
  52. node v22.15/README.md +0 -15
  53. node v22.15/globals.d.ts +0 -364
  54. node v22.15/globals.typedarray.d.ts +0 -21
  55. node v22.15/test.d.ts +0 -2278
  56. node v22.15/ts5.6/globals.typedarray.d.ts +0 -19
  57. {node v22.15 → node v22.18}/LICENSE +0 -0
  58. {node v22.15 → node v22.18}/assert/strict.d.ts +0 -0
  59. {node v22.15 → node v22.18}/async_hooks.d.ts +1 -1
  60. {node v22.15 → node v22.18}/compatibility/disposable.d.ts +0 -0
  61. {node v22.15 → node v22.18}/compatibility/index.d.ts +0 -0
  62. {node v22.15 → node v22.18}/compatibility/indexable.d.ts +0 -0
  63. {node v22.15 → node v22.18}/compatibility/iterators.d.ts +0 -0
  64. {node v22.15 → node v22.18}/console.d.ts +0 -0
  65. {node v22.15 → node v22.18}/constants.d.ts +0 -0
  66. {node v22.15 → node v22.18}/diagnostics_channel.d.ts +0 -0
  67. {node v22.15 → node v22.18}/domain.d.ts +0 -0
  68. {node v22.15 → node v22.18}/path.d.ts +0 -0
  69. {node v22.15 → node v22.18}/punycode.d.ts +0 -0
  70. {node v22.15 → node v22.18}/querystring.d.ts +0 -0
  71. {node v22.15 → node v22.18}/readline.d.ts +0 -0
  72. {node v22.15 → node v22.18}/sea.d.ts +0 -0
  73. {node v22.15 → node v22.18}/stream/promises.d.ts +0 -0
  74. {node v22.15 → node v22.18}/timers/promises.d.ts +0 -0
  75. {node v22.15 → node v22.18}/timers.d.ts +0 -0
  76. {node v22.15 → node v22.18}/trace_events.d.ts +0 -0
  77. {node v22.15 → node v22.18}/tty.d.ts +0 -0
@@ -268,7 +268,7 @@ declare module 'inspector' {
268
268
  /**
269
269
  * Embedder-specific auxiliary data.
270
270
  */
271
- auxData?: {} | undefined;
271
+ auxData?: object | undefined;
272
272
  }
273
273
  /**
274
274
  * Detailed information about exception (or error) that was thrown during script compilation or execution.
@@ -701,7 +701,7 @@ declare module 'inspector' {
701
701
  }
702
702
  interface InspectRequestedEventDataType {
703
703
  object: RemoteObject;
704
- hints: {};
704
+ hints: object;
705
705
  }
706
706
  }
707
707
  namespace Debugger {
@@ -1173,7 +1173,7 @@ declare module 'inspector' {
1173
1173
  /**
1174
1174
  * Embedder-specific auxiliary data.
1175
1175
  */
1176
- executionContextAuxData?: {} | undefined;
1176
+ executionContextAuxData?: object | undefined;
1177
1177
  /**
1178
1178
  * True, if this script is generated as a result of the live edit operation.
1179
1179
  * @experimental
@@ -1237,7 +1237,7 @@ declare module 'inspector' {
1237
1237
  /**
1238
1238
  * Embedder-specific auxiliary data.
1239
1239
  */
1240
- executionContextAuxData?: {} | undefined;
1240
+ executionContextAuxData?: object | undefined;
1241
1241
  /**
1242
1242
  * URL of source map associated with script (if any).
1243
1243
  */
@@ -1282,7 +1282,7 @@ declare module 'inspector' {
1282
1282
  /**
1283
1283
  * Object containing break-specific auxiliary properties.
1284
1284
  */
1285
- data?: {} | undefined;
1285
+ data?: object | undefined;
1286
1286
  /**
1287
1287
  * Hit breakpoints IDs
1288
1288
  */
@@ -1649,7 +1649,7 @@ declare module 'inspector' {
1649
1649
  categories: string[];
1650
1650
  }
1651
1651
  interface DataCollectedEventDataType {
1652
- value: Array<{}>;
1652
+ value: object[];
1653
1653
  }
1654
1654
  }
1655
1655
  namespace NodeWorker {
@@ -1759,6 +1759,7 @@ declare module 'inspector' {
1759
1759
  url: string;
1760
1760
  method: string;
1761
1761
  headers: Headers;
1762
+ hasPostData: boolean;
1762
1763
  }
1763
1764
  /**
1764
1765
  * HTTP response data.
@@ -1768,12 +1769,54 @@ declare module 'inspector' {
1768
1769
  status: number;
1769
1770
  statusText: string;
1770
1771
  headers: Headers;
1772
+ mimeType: string;
1773
+ charset: string;
1771
1774
  }
1772
1775
  /**
1773
1776
  * Request / response headers as keys / values of JSON object.
1774
1777
  */
1775
1778
  interface Headers {
1776
1779
  }
1780
+ interface GetRequestPostDataParameterType {
1781
+ /**
1782
+ * Identifier of the network request to get content for.
1783
+ */
1784
+ requestId: RequestId;
1785
+ }
1786
+ interface GetResponseBodyParameterType {
1787
+ /**
1788
+ * Identifier of the network request to get content for.
1789
+ */
1790
+ requestId: RequestId;
1791
+ }
1792
+ interface StreamResourceContentParameterType {
1793
+ /**
1794
+ * Identifier of the request to stream.
1795
+ */
1796
+ requestId: RequestId;
1797
+ }
1798
+ interface GetRequestPostDataReturnType {
1799
+ /**
1800
+ * Request body string, omitting files from multipart requests
1801
+ */
1802
+ postData: string;
1803
+ }
1804
+ interface GetResponseBodyReturnType {
1805
+ /**
1806
+ * Response body.
1807
+ */
1808
+ body: string;
1809
+ /**
1810
+ * True, if content was sent as base64.
1811
+ */
1812
+ base64Encoded: boolean;
1813
+ }
1814
+ interface StreamResourceContentReturnType {
1815
+ /**
1816
+ * Data that has been buffered until streaming is enabled.
1817
+ */
1818
+ bufferedData: string;
1819
+ }
1777
1820
  interface RequestWillBeSentEventDataType {
1778
1821
  /**
1779
1822
  * Request identifier.
@@ -1842,12 +1885,59 @@ declare module 'inspector' {
1842
1885
  */
1843
1886
  timestamp: MonotonicTime;
1844
1887
  }
1888
+ interface DataReceivedEventDataType {
1889
+ /**
1890
+ * Request identifier.
1891
+ */
1892
+ requestId: RequestId;
1893
+ /**
1894
+ * Timestamp.
1895
+ */
1896
+ timestamp: MonotonicTime;
1897
+ /**
1898
+ * Data chunk length.
1899
+ */
1900
+ dataLength: number;
1901
+ /**
1902
+ * Actual bytes received (might be less than dataLength for compressed encodings).
1903
+ */
1904
+ encodedDataLength: number;
1905
+ /**
1906
+ * Data that was received.
1907
+ * @experimental
1908
+ */
1909
+ data?: string | undefined;
1910
+ }
1845
1911
  }
1846
1912
  namespace NodeRuntime {
1847
1913
  interface NotifyWhenWaitingForDisconnectParameterType {
1848
1914
  enabled: boolean;
1849
1915
  }
1850
1916
  }
1917
+ namespace Target {
1918
+ type SessionID = string;
1919
+ type TargetID = string;
1920
+ interface TargetInfo {
1921
+ targetId: TargetID;
1922
+ type: string;
1923
+ title: string;
1924
+ url: string;
1925
+ attached: boolean;
1926
+ canAccessOpener: boolean;
1927
+ }
1928
+ interface SetAutoAttachParameterType {
1929
+ autoAttach: boolean;
1930
+ waitForDebuggerOnStart: boolean;
1931
+ }
1932
+ interface TargetCreatedEventDataType {
1933
+ targetInfo: TargetInfo;
1934
+ }
1935
+ interface AttachedToTargetEventDataType {
1936
+ sessionId: SessionID;
1937
+ targetInfo: TargetInfo;
1938
+ waitingForDebugger: boolean;
1939
+ }
1940
+ }
1851
1941
 
1852
1942
  /**
1853
1943
  * The `inspector.Session` is used for dispatching messages to the V8 inspector
@@ -2224,6 +2314,27 @@ declare module 'inspector' {
2224
2314
  * Enables network tracking, network events will now be delivered to the client.
2225
2315
  */
2226
2316
  post(method: 'Network.enable', callback?: (err: Error | null) => void): void;
2317
+ /**
2318
+ * Returns post data sent with the request. Returns an error when no data was sent with the request.
2319
+ */
2320
+ post(method: 'Network.getRequestPostData', params?: Network.GetRequestPostDataParameterType, callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void;
2321
+ post(method: 'Network.getRequestPostData', callback?: (err: Error | null, params: Network.GetRequestPostDataReturnType) => void): void;
2322
+ /**
2323
+ * Returns content served for the given request.
2324
+ */
2325
+ post(method: 'Network.getResponseBody', params?: Network.GetResponseBodyParameterType, callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void;
2326
+ post(method: 'Network.getResponseBody', callback?: (err: Error | null, params: Network.GetResponseBodyReturnType) => void): void;
2327
+ /**
2328
+ * Enables streaming of the response for the given requestId.
2329
+ * If enabled, the dataReceived event contains the data that was received during streaming.
2330
+ * @experimental
2331
+ */
2332
+ post(
2333
+ method: 'Network.streamResourceContent',
2334
+ params?: Network.StreamResourceContentParameterType,
2335
+ callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void
2336
+ ): void;
2337
+ post(method: 'Network.streamResourceContent', callback?: (err: Error | null, params: Network.StreamResourceContentReturnType) => void): void;
2227
2338
  /**
2228
2339
  * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`.
2229
2340
  */
@@ -2237,6 +2348,8 @@ declare module 'inspector' {
2237
2348
  */
2238
2349
  post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void;
2239
2350
  post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', callback?: (err: Error | null) => void): void;
2351
+ post(method: 'Target.setAutoAttach', params?: Target.SetAutoAttachParameterType, callback?: (err: Error | null) => void): void;
2352
+ post(method: 'Target.setAutoAttach', callback?: (err: Error | null) => void): void;
2240
2353
 
2241
2354
  addListener(event: string, listener: (...args: any[]) => void): this;
2242
2355
  /**
@@ -2343,6 +2456,10 @@ declare module 'inspector' {
2343
2456
  addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2344
2457
  addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2345
2458
  addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2459
+ /**
2460
+ * Fired when data chunk was received over the network.
2461
+ */
2462
+ addListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2346
2463
  /**
2347
2464
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2348
2465
  * enabled.
@@ -2355,6 +2472,8 @@ declare module 'inspector' {
2355
2472
  * example, when inspector.waitingForDebugger is called
2356
2473
  */
2357
2474
  addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2475
+ addListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2476
+ addListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2358
2477
  emit(event: string | symbol, ...args: any[]): boolean;
2359
2478
  emit(event: 'inspectorNotification', message: InspectorNotification<object>): boolean;
2360
2479
  emit(event: 'Runtime.executionContextCreated', message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean;
@@ -2386,8 +2505,11 @@ declare module 'inspector' {
2386
2505
  emit(event: 'Network.responseReceived', message: InspectorNotification<Network.ResponseReceivedEventDataType>): boolean;
2387
2506
  emit(event: 'Network.loadingFailed', message: InspectorNotification<Network.LoadingFailedEventDataType>): boolean;
2388
2507
  emit(event: 'Network.loadingFinished', message: InspectorNotification<Network.LoadingFinishedEventDataType>): boolean;
2508
+ emit(event: 'Network.dataReceived', message: InspectorNotification<Network.DataReceivedEventDataType>): boolean;
2389
2509
  emit(event: 'NodeRuntime.waitingForDisconnect'): boolean;
2390
2510
  emit(event: 'NodeRuntime.waitingForDebugger'): boolean;
2511
+ emit(event: 'Target.targetCreated', message: InspectorNotification<Target.TargetCreatedEventDataType>): boolean;
2512
+ emit(event: 'Target.attachedToTarget', message: InspectorNotification<Target.AttachedToTargetEventDataType>): boolean;
2391
2513
  on(event: string, listener: (...args: any[]) => void): this;
2392
2514
  /**
2393
2515
  * Emitted when any notification from the V8 Inspector is received.
@@ -2493,6 +2615,10 @@ declare module 'inspector' {
2493
2615
  on(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2494
2616
  on(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2495
2617
  on(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2618
+ /**
2619
+ * Fired when data chunk was received over the network.
2620
+ */
2621
+ on(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2496
2622
  /**
2497
2623
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2498
2624
  * enabled.
@@ -2505,6 +2631,8 @@ declare module 'inspector' {
2505
2631
  * example, when inspector.waitingForDebugger is called
2506
2632
  */
2507
2633
  on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2634
+ on(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2635
+ on(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2508
2636
  once(event: string, listener: (...args: any[]) => void): this;
2509
2637
  /**
2510
2638
  * Emitted when any notification from the V8 Inspector is received.
@@ -2610,6 +2738,10 @@ declare module 'inspector' {
2610
2738
  once(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2611
2739
  once(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2612
2740
  once(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2741
+ /**
2742
+ * Fired when data chunk was received over the network.
2743
+ */
2744
+ once(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2613
2745
  /**
2614
2746
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2615
2747
  * enabled.
@@ -2622,6 +2754,8 @@ declare module 'inspector' {
2622
2754
  * example, when inspector.waitingForDebugger is called
2623
2755
  */
2624
2756
  once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2757
+ once(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2758
+ once(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2625
2759
  prependListener(event: string, listener: (...args: any[]) => void): this;
2626
2760
  /**
2627
2761
  * Emitted when any notification from the V8 Inspector is received.
@@ -2727,6 +2861,10 @@ declare module 'inspector' {
2727
2861
  prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2728
2862
  prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2729
2863
  prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2864
+ /**
2865
+ * Fired when data chunk was received over the network.
2866
+ */
2867
+ prependListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2730
2868
  /**
2731
2869
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2732
2870
  * enabled.
@@ -2739,6 +2877,8 @@ declare module 'inspector' {
2739
2877
  * example, when inspector.waitingForDebugger is called
2740
2878
  */
2741
2879
  prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
2880
+ prependListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
2881
+ prependListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2742
2882
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
2743
2883
  /**
2744
2884
  * Emitted when any notification from the V8 Inspector is received.
@@ -2844,6 +2984,10 @@ declare module 'inspector' {
2844
2984
  prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
2845
2985
  prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
2846
2986
  prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
2987
+ /**
2988
+ * Fired when data chunk was received over the network.
2989
+ */
2990
+ prependOnceListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
2847
2991
  /**
2848
2992
  * This event is fired instead of `Runtime.executionContextDestroyed` when
2849
2993
  * enabled.
@@ -2856,6 +3000,8 @@ declare module 'inspector' {
2856
3000
  * example, when inspector.waitingForDebugger is called
2857
3001
  */
2858
3002
  prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
3003
+ prependOnceListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
3004
+ prependOnceListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
2859
3005
  }
2860
3006
 
2861
3007
  /**
@@ -2948,16 +3094,31 @@ declare module 'inspector' {
2948
3094
  * Broadcasts the `Network.requestWillBeSent` event to connected frontends. This event indicates that
2949
3095
  * the application is about to send an HTTP request.
2950
3096
  * @since v22.6.0
2951
- * @experimental
2952
3097
  */
2953
3098
  function requestWillBeSent(params: RequestWillBeSentEventDataType): void;
3099
+ /**
3100
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
3101
+ *
3102
+ * Broadcasts the `Network.dataReceived` event to connected frontends, or buffers the data if
3103
+ * `Network.streamResourceContent` command was not invoked for the given request yet.
3104
+ *
3105
+ * Also enables `Network.getResponseBody` command to retrieve the response data.
3106
+ * @since v22.17.0
3107
+ */
3108
+ function dataReceived(params: DataReceivedEventDataType): void;
3109
+ /**
3110
+ * This feature is only available with the `--experimental-network-inspection` flag enabled.
3111
+ *
3112
+ * Enables `Network.getRequestPostData` command to retrieve the request data.
3113
+ * @since v22.18.0
3114
+ */
3115
+ function dataSent(params: unknown): void;
2954
3116
  /**
2955
3117
  * This feature is only available with the `--experimental-network-inspection` flag enabled.
2956
3118
  *
2957
3119
  * Broadcasts the `Network.responseReceived` event to connected frontends. This event indicates that
2958
3120
  * HTTP response is available.
2959
3121
  * @since v22.6.0
2960
- * @experimental
2961
3122
  */
2962
3123
  function responseReceived(params: ResponseReceivedEventDataType): void;
2963
3124
  /**
@@ -2966,7 +3127,6 @@ declare module 'inspector' {
2966
3127
  * Broadcasts the `Network.loadingFinished` event to connected frontends. This event indicates that
2967
3128
  * HTTP request has finished loading.
2968
3129
  * @since v22.6.0
2969
- * @experimental
2970
3130
  */
2971
3131
  function loadingFinished(params: LoadingFinishedEventDataType): void;
2972
3132
  /**
@@ -2975,7 +3135,6 @@ declare module 'inspector' {
2975
3135
  * Broadcasts the `Network.loadingFailed` event to connected frontends. This event indicates that
2976
3136
  * HTTP request has failed to load.
2977
3137
  * @since v22.7.0
2978
- * @experimental
2979
3138
  */
2980
3139
  function loadingFailed(params: LoadingFailedEventDataType): void;
2981
3140
  }
@@ -3014,6 +3173,7 @@ declare module 'inspector/promises' {
3014
3173
  NodeWorker,
3015
3174
  Network,
3016
3175
  NodeRuntime,
3176
+ Target,
3017
3177
  } from 'inspector';
3018
3178
 
3019
3179
  /**
@@ -3338,6 +3498,20 @@ declare module 'inspector/promises' {
3338
3498
  * Enables network tracking, network events will now be delivered to the client.
3339
3499
  */
3340
3500
  post(method: 'Network.enable'): Promise<void>;
3501
+ /**
3502
+ * Returns post data sent with the request. Returns an error when no data was sent with the request.
3503
+ */
3504
+ post(method: 'Network.getRequestPostData', params?: Network.GetRequestPostDataParameterType): Promise<Network.GetRequestPostDataReturnType>;
3505
+ /**
3506
+ * Returns content served for the given request.
3507
+ */
3508
+ post(method: 'Network.getResponseBody', params?: Network.GetResponseBodyParameterType): Promise<Network.GetResponseBodyReturnType>;
3509
+ /**
3510
+ * Enables streaming of the response for the given requestId.
3511
+ * If enabled, the dataReceived event contains the data that was received during streaming.
3512
+ * @experimental
3513
+ */
3514
+ post(method: 'Network.streamResourceContent', params?: Network.StreamResourceContentParameterType): Promise<Network.StreamResourceContentReturnType>;
3341
3515
  /**
3342
3516
  * Enable the NodeRuntime events except by `NodeRuntime.waitingForDisconnect`.
3343
3517
  */
@@ -3350,6 +3524,7 @@ declare module 'inspector/promises' {
3350
3524
  * Enable the `NodeRuntime.waitingForDisconnect`.
3351
3525
  */
3352
3526
  post(method: 'NodeRuntime.notifyWhenWaitingForDisconnect', params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType): Promise<void>;
3527
+ post(method: 'Target.setAutoAttach', params?: Target.SetAutoAttachParameterType): Promise<void>;
3353
3528
 
3354
3529
  addListener(event: string, listener: (...args: any[]) => void): this;
3355
3530
  /**
@@ -3456,6 +3631,10 @@ declare module 'inspector/promises' {
3456
3631
  addListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3457
3632
  addListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3458
3633
  addListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
3634
+ /**
3635
+ * Fired when data chunk was received over the network.
3636
+ */
3637
+ addListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3459
3638
  /**
3460
3639
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3461
3640
  * enabled.
@@ -3468,6 +3647,8 @@ declare module 'inspector/promises' {
3468
3647
  * example, when inspector.waitingForDebugger is called
3469
3648
  */
3470
3649
  addListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
3650
+ addListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
3651
+ addListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3471
3652
  emit(event: string | symbol, ...args: any[]): boolean;
3472
3653
  emit(event: 'inspectorNotification', message: InspectorNotification<object>): boolean;
3473
3654
  emit(event: 'Runtime.executionContextCreated', message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean;
@@ -3499,8 +3680,11 @@ declare module 'inspector/promises' {
3499
3680
  emit(event: 'Network.responseReceived', message: InspectorNotification<Network.ResponseReceivedEventDataType>): boolean;
3500
3681
  emit(event: 'Network.loadingFailed', message: InspectorNotification<Network.LoadingFailedEventDataType>): boolean;
3501
3682
  emit(event: 'Network.loadingFinished', message: InspectorNotification<Network.LoadingFinishedEventDataType>): boolean;
3683
+ emit(event: 'Network.dataReceived', message: InspectorNotification<Network.DataReceivedEventDataType>): boolean;
3502
3684
  emit(event: 'NodeRuntime.waitingForDisconnect'): boolean;
3503
3685
  emit(event: 'NodeRuntime.waitingForDebugger'): boolean;
3686
+ emit(event: 'Target.targetCreated', message: InspectorNotification<Target.TargetCreatedEventDataType>): boolean;
3687
+ emit(event: 'Target.attachedToTarget', message: InspectorNotification<Target.AttachedToTargetEventDataType>): boolean;
3504
3688
  on(event: string, listener: (...args: any[]) => void): this;
3505
3689
  /**
3506
3690
  * Emitted when any notification from the V8 Inspector is received.
@@ -3606,6 +3790,10 @@ declare module 'inspector/promises' {
3606
3790
  on(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3607
3791
  on(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3608
3792
  on(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
3793
+ /**
3794
+ * Fired when data chunk was received over the network.
3795
+ */
3796
+ on(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3609
3797
  /**
3610
3798
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3611
3799
  * enabled.
@@ -3618,6 +3806,8 @@ declare module 'inspector/promises' {
3618
3806
  * example, when inspector.waitingForDebugger is called
3619
3807
  */
3620
3808
  on(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
3809
+ on(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
3810
+ on(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3621
3811
  once(event: string, listener: (...args: any[]) => void): this;
3622
3812
  /**
3623
3813
  * Emitted when any notification from the V8 Inspector is received.
@@ -3723,6 +3913,10 @@ declare module 'inspector/promises' {
3723
3913
  once(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3724
3914
  once(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3725
3915
  once(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
3916
+ /**
3917
+ * Fired when data chunk was received over the network.
3918
+ */
3919
+ once(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3726
3920
  /**
3727
3921
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3728
3922
  * enabled.
@@ -3735,6 +3929,8 @@ declare module 'inspector/promises' {
3735
3929
  * example, when inspector.waitingForDebugger is called
3736
3930
  */
3737
3931
  once(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
3932
+ once(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
3933
+ once(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3738
3934
  prependListener(event: string, listener: (...args: any[]) => void): this;
3739
3935
  /**
3740
3936
  * Emitted when any notification from the V8 Inspector is received.
@@ -3840,6 +4036,10 @@ declare module 'inspector/promises' {
3840
4036
  prependListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3841
4037
  prependListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3842
4038
  prependListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
4039
+ /**
4040
+ * Fired when data chunk was received over the network.
4041
+ */
4042
+ prependListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3843
4043
  /**
3844
4044
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3845
4045
  * enabled.
@@ -3852,6 +4052,8 @@ declare module 'inspector/promises' {
3852
4052
  * example, when inspector.waitingForDebugger is called
3853
4053
  */
3854
4054
  prependListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
4055
+ prependListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
4056
+ prependListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3855
4057
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
3856
4058
  /**
3857
4059
  * Emitted when any notification from the V8 Inspector is received.
@@ -3957,6 +4159,10 @@ declare module 'inspector/promises' {
3957
4159
  prependOnceListener(event: 'Network.responseReceived', listener: (message: InspectorNotification<Network.ResponseReceivedEventDataType>) => void): this;
3958
4160
  prependOnceListener(event: 'Network.loadingFailed', listener: (message: InspectorNotification<Network.LoadingFailedEventDataType>) => void): this;
3959
4161
  prependOnceListener(event: 'Network.loadingFinished', listener: (message: InspectorNotification<Network.LoadingFinishedEventDataType>) => void): this;
4162
+ /**
4163
+ * Fired when data chunk was received over the network.
4164
+ */
4165
+ prependOnceListener(event: 'Network.dataReceived', listener: (message: InspectorNotification<Network.DataReceivedEventDataType>) => void): this;
3960
4166
  /**
3961
4167
  * This event is fired instead of `Runtime.executionContextDestroyed` when
3962
4168
  * enabled.
@@ -3969,6 +4175,8 @@ declare module 'inspector/promises' {
3969
4175
  * example, when inspector.waitingForDebugger is called
3970
4176
  */
3971
4177
  prependOnceListener(event: 'NodeRuntime.waitingForDebugger', listener: () => void): this;
4178
+ prependOnceListener(event: 'Target.targetCreated', listener: (message: InspectorNotification<Target.TargetCreatedEventDataType>) => void): this;
4179
+ prependOnceListener(event: 'Target.attachedToTarget', listener: (message: InspectorNotification<Target.AttachedToTargetEventDataType>) => void): this;
3972
4180
  }
3973
4181
 
3974
4182
  export {
@@ -3989,6 +4197,7 @@ declare module 'inspector/promises' {
3989
4197
  NodeWorker,
3990
4198
  Network,
3991
4199
  NodeRuntime,
4200
+ Target,
3992
4201
  };
3993
4202
  }
3994
4203
 
@@ -623,34 +623,91 @@ declare module "module" {
623
623
  global {
624
624
  interface ImportMeta {
625
625
  /**
626
- * The directory name of the current module. This is the same as the `path.dirname()` of the `import.meta.filename`.
627
- * **Caveat:** only present on `file:` modules.
626
+ * The directory name of the current module.
627
+ *
628
+ * This is the same as the `path.dirname()` of the `import.meta.filename`.
629
+ *
630
+ * > **Caveat**: only present on `file:` modules.
631
+ * @since v21.2.0, v20.11.0
628
632
  */
629
633
  dirname: string;
630
634
  /**
631
- * The full absolute path and filename of the current module, with symlinks resolved.
635
+ * The full absolute path and filename of the current module, with
636
+ * symlinks resolved.
637
+ *
632
638
  * This is the same as the `url.fileURLToPath()` of the `import.meta.url`.
633
- * **Caveat:** only local modules support this property. Modules not using the `file:` protocol will not provide it.
639
+ *
640
+ * > **Caveat** only local modules support this property. Modules not using the
641
+ * > `file:` protocol will not provide it.
642
+ * @since v21.2.0, v20.11.0
634
643
  */
635
644
  filename: string;
636
645
  /**
637
646
  * The absolute `file:` URL of the module.
647
+ *
648
+ * This is defined exactly the same as it is in browsers providing the URL of the
649
+ * current module file.
650
+ *
651
+ * This enables useful patterns such as relative file loading:
652
+ *
653
+ * ```js
654
+ * import { readFileSync } from 'node:fs';
655
+ * const buffer = readFileSync(new URL('./data.proto', import.meta.url));
656
+ * ```
638
657
  */
639
658
  url: string;
640
659
  /**
641
- * Provides a module-relative resolution function scoped to each module, returning
642
- * the URL string.
660
+ * `import.meta.resolve` is a module-relative resolution function scoped to
661
+ * each module, returning the URL string.
662
+ *
663
+ * ```js
664
+ * const dependencyAsset = import.meta.resolve('component-lib/asset.css');
665
+ * // file:///app/node_modules/component-lib/asset.css
666
+ * import.meta.resolve('./dep.js');
667
+ * // file:///app/dep.js
668
+ * ```
669
+ *
670
+ * All features of the Node.js module resolution are supported. Dependency
671
+ * resolutions are subject to the permitted exports resolutions within the package.
672
+ *
673
+ * **Caveats**:
674
+ *
675
+ * * This can result in synchronous file-system operations, which
676
+ * can impact performance similarly to `require.resolve`.
677
+ * * This feature is not available within custom loaders (it would
678
+ * create a deadlock).
679
+ * @since v13.9.0, v12.16.0
680
+ * @param specifier The module specifier to resolve relative to the
681
+ * current module.
682
+ * @param parent An optional absolute parent module URL to resolve from.
683
+ * **Default:** `import.meta.url`
684
+ * @returns The absolute URL string that the specifier would resolve to.
685
+ */
686
+ resolve(specifier: string, parent?: string | URL): string;
687
+ /**
688
+ * `true` when the current module is the entry point of the current process; `false` otherwise.
689
+ *
690
+ * Equivalent to `require.main === module` in CommonJS.
691
+ *
692
+ * Analogous to Python's `__name__ == "__main__"`.
643
693
  *
644
- * Second `parent` parameter is only used when the `--experimental-import-meta-resolve`
645
- * command flag enabled.
694
+ * ```js
695
+ * export function foo() {
696
+ * return 'Hello, world';
697
+ * }
646
698
  *
647
- * @since v20.6.0
699
+ * function main() {
700
+ * const message = foo();
701
+ * console.log(message);
702
+ * }
648
703
  *
649
- * @param specifier The module specifier to resolve relative to `parent`.
650
- * @param parent The absolute parent module URL to resolve from.
651
- * @returns The absolute (`file:`) URL string for the resolved module.
704
+ * if (import.meta.main) main();
705
+ * // `foo` can be imported from another module without possible side-effects from `main`
706
+ * ```
707
+ * @since v22.18.0
708
+ * @experimental
652
709
  */
653
- resolve(specifier: string, parent?: string | URL | undefined): string;
710
+ main: boolean;
654
711
  }
655
712
  namespace NodeJS {
656
713
  interface Module {