@types/node 15.14.6 → 16.0.0

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 (64) hide show
  1. {node v15.14 → node}/LICENSE +0 -0
  2. node v15.14/README.md → node/README.md +3 -3
  3. node/assert/strict.d.ts +9 -0
  4. node v15.14/assert.d.ts → node/assert.d.ts +32 -27
  5. node v15.14/async_hooks.d.ts → node/async_hooks.d.ts +5 -1
  6. {node v15.14 → node}/base.d.ts +0 -0
  7. node/buffer.d.ts +357 -0
  8. node v15.14/child_process.d.ts → node/child_process.d.ts +5 -1
  9. node v15.14/cluster.d.ts → node/cluster.d.ts +25 -100
  10. node v15.14/console.d.ts → node/console.d.ts +21 -20
  11. node v15.14/constants.d.ts → node/constants.d.ts +5 -0
  12. node v15.14/crypto.d.ts → node/crypto.d.ts +21 -6
  13. node v15.14/dgram.d.ts → node/dgram.d.ts +4 -0
  14. node v15.14/diagnostic_channel.d.ts → node/diagnostic_channel.d.ts +4 -0
  15. node v15.14/dns/promises.d.ts → node/dns/promises.d.ts +4 -0
  16. node v15.14/dns.d.ts → node/dns.d.ts +4 -0
  17. node/domain.d.ts +25 -0
  18. node v15.14/events.d.ts → node/events.d.ts +5 -0
  19. node v15.14/fs/promises.d.ts → node/fs/promises.d.ts +4 -0
  20. node v15.14/fs.d.ts → node/fs.d.ts +12 -20
  21. node/globals.d.ts +274 -0
  22. node/globals.global.d.ts +1 -0
  23. node v15.14/http.d.ts → node/http.d.ts +5 -1
  24. node v15.14/http2.d.ts → node/http2.d.ts +4 -1
  25. node v15.14/https.d.ts → node/https.d.ts +4 -0
  26. node v15.14/index.d.ts → node/index.d.ts +1 -1
  27. node v15.14/inspector.d.ts → node/inspector.d.ts +4 -322
  28. node v15.14/module.d.ts → node/module.d.ts +25 -4
  29. node v15.14/net.d.ts → node/net.d.ts +4 -6
  30. node v15.14/os.d.ts → node/os.d.ts +4 -0
  31. node v15.14/package.json → node/package.json +2 -2
  32. node v15.14/path.d.ts → node/path.d.ts +5 -0
  33. node v15.14/perf_hooks.d.ts → node/perf_hooks.d.ts +66 -19
  34. node v15.14/process.d.ts → node/process.d.ts +41 -38
  35. node v15.14/punycode.d.ts → node/punycode.d.ts +4 -0
  36. node v15.14/querystring.d.ts → node/querystring.d.ts +4 -0
  37. node v15.14/readline.d.ts → node/readline.d.ts +5 -1
  38. node v15.14/repl.d.ts → node/repl.d.ts +4 -0
  39. node v15.14/stream/promises.d.ts → node/stream/promises.d.ts +4 -0
  40. node v15.14/stream.d.ts → node/stream.d.ts +5 -0
  41. node v15.14/string_decoder.d.ts → node/string_decoder.d.ts +4 -0
  42. node v15.14/timers/promises.d.ts → node/timers/promises.d.ts +4 -0
  43. node/timers.d.ts +92 -0
  44. node v15.14/tls.d.ts → node/tls.d.ts +4 -0
  45. node v15.14/trace_events.d.ts → node/trace_events.d.ts +4 -0
  46. node v15.14/ts3.6/assert.d.ts → node/ts3.6/assert.d.ts +26 -26
  47. {node v15.14 → node}/ts3.6/base.d.ts +0 -0
  48. {node v15.14 → node}/ts3.6/index.d.ts +0 -0
  49. node v15.14/tty.d.ts → node/tty.d.ts +4 -0
  50. node v15.14/url.d.ts → node/url.d.ts +4 -0
  51. node/util/types.d.ts +57 -0
  52. node v15.14/util.d.ts → node/util.d.ts +65 -19
  53. node v15.14/v8.d.ts → node/v8.d.ts +4 -0
  54. node v15.14/vm.d.ts → node/vm.d.ts +4 -0
  55. node v15.14/wasi.d.ts → node/wasi.d.ts +4 -0
  56. node v15.14/worker_threads.d.ts → node/worker_threads.d.ts +4 -0
  57. node v15.14/zlib.d.ts → node/zlib.d.ts +4 -0
  58. node v15.14/assert/strict.d.ts +0 -4
  59. node v15.14/buffer.d.ts +0 -112
  60. node v15.14/domain.d.ts +0 -24
  61. node v15.14/globals.d.ts +0 -659
  62. node v15.14/globals.global.d.ts +0 -1
  63. node v15.14/timers.d.ts +0 -27
  64. node v15.14/util/types.d.ts +0 -53
@@ -1804,100 +1804,6 @@ declare module 'inspector' {
1804
1804
  }
1805
1805
  }
1806
1806
 
1807
- namespace NodeTracing {
1808
- interface TraceConfig {
1809
- /**
1810
- * Controls how the trace buffer stores data.
1811
- */
1812
- recordMode?: string;
1813
- /**
1814
- * Included category filters.
1815
- */
1816
- includedCategories: string[];
1817
- }
1818
-
1819
- interface StartParameterType {
1820
- traceConfig: TraceConfig;
1821
- }
1822
-
1823
- interface GetCategoriesReturnType {
1824
- /**
1825
- * A list of supported tracing categories.
1826
- */
1827
- categories: string[];
1828
- }
1829
-
1830
- interface DataCollectedEventDataType {
1831
- value: Array<{}>;
1832
- }
1833
- }
1834
-
1835
- namespace NodeWorker {
1836
- type WorkerID = string;
1837
-
1838
- /**
1839
- * Unique identifier of attached debugging session.
1840
- */
1841
- type SessionID = string;
1842
-
1843
- interface WorkerInfo {
1844
- workerId: WorkerID;
1845
- type: string;
1846
- title: string;
1847
- url: string;
1848
- }
1849
-
1850
- interface SendMessageToWorkerParameterType {
1851
- message: string;
1852
- /**
1853
- * Identifier of the session.
1854
- */
1855
- sessionId: SessionID;
1856
- }
1857
-
1858
- interface EnableParameterType {
1859
- /**
1860
- * Whether to new workers should be paused until the frontend sends `Runtime.runIfWaitingForDebugger`
1861
- * message to run them.
1862
- */
1863
- waitForDebuggerOnStart: boolean;
1864
- }
1865
-
1866
- interface DetachParameterType {
1867
- sessionId: SessionID;
1868
- }
1869
-
1870
- interface AttachedToWorkerEventDataType {
1871
- /**
1872
- * Identifier assigned to the session used to send/receive messages.
1873
- */
1874
- sessionId: SessionID;
1875
- workerInfo: WorkerInfo;
1876
- waitingForDebugger: boolean;
1877
- }
1878
-
1879
- interface DetachedFromWorkerEventDataType {
1880
- /**
1881
- * Detached session identifier.
1882
- */
1883
- sessionId: SessionID;
1884
- }
1885
-
1886
- interface ReceivedMessageFromWorkerEventDataType {
1887
- /**
1888
- * Identifier of a session which sends a message.
1889
- */
1890
- sessionId: SessionID;
1891
- message: string;
1892
- }
1893
- }
1894
-
1895
- namespace NodeRuntime {
1896
- interface NotifyWhenWaitingForDisconnectParameterType {
1897
- enabled: boolean;
1898
- }
1899
- }
1900
-
1901
1807
  /**
1902
1808
  * The inspector.Session is used for dispatching messages to the V8 inspector back-end and receiving message responses and notifications.
1903
1809
  */
@@ -2297,53 +2203,6 @@ declare module 'inspector' {
2297
2203
 
2298
2204
  post(method: "HeapProfiler.getSamplingProfile", callback?: (err: Error | null, params: HeapProfiler.GetSamplingProfileReturnType) => void): void;
2299
2205
 
2300
- /**
2301
- * Gets supported tracing categories.
2302
- */
2303
- post(method: "NodeTracing.getCategories", callback?: (err: Error | null, params: NodeTracing.GetCategoriesReturnType) => void): void;
2304
-
2305
- /**
2306
- * Start trace events collection.
2307
- */
2308
- post(method: "NodeTracing.start", params?: NodeTracing.StartParameterType, callback?: (err: Error | null) => void): void;
2309
- post(method: "NodeTracing.start", callback?: (err: Error | null) => void): void;
2310
-
2311
- /**
2312
- * Stop trace events collection. Remaining collected events will be sent as a sequence of
2313
- * dataCollected events followed by tracingComplete event.
2314
- */
2315
- post(method: "NodeTracing.stop", callback?: (err: Error | null) => void): void;
2316
-
2317
- /**
2318
- * Sends protocol message over session with given id.
2319
- */
2320
- post(method: "NodeWorker.sendMessageToWorker", params?: NodeWorker.SendMessageToWorkerParameterType, callback?: (err: Error | null) => void): void;
2321
- post(method: "NodeWorker.sendMessageToWorker", callback?: (err: Error | null) => void): void;
2322
-
2323
- /**
2324
- * Instructs the inspector to attach to running workers. Will also attach to new workers
2325
- * as they start
2326
- */
2327
- post(method: "NodeWorker.enable", params?: NodeWorker.EnableParameterType, callback?: (err: Error | null) => void): void;
2328
- post(method: "NodeWorker.enable", callback?: (err: Error | null) => void): void;
2329
-
2330
- /**
2331
- * Detaches from all running workers and disables attaching to new workers as they are started.
2332
- */
2333
- post(method: "NodeWorker.disable", callback?: (err: Error | null) => void): void;
2334
-
2335
- /**
2336
- * Detached from the worker with given sessionId.
2337
- */
2338
- post(method: "NodeWorker.detach", params?: NodeWorker.DetachParameterType, callback?: (err: Error | null) => void): void;
2339
- post(method: "NodeWorker.detach", callback?: (err: Error | null) => void): void;
2340
-
2341
- /**
2342
- * Enable the `NodeRuntime.waitingForDisconnect`.
2343
- */
2344
- post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", params?: NodeRuntime.NotifyWhenWaitingForDisconnectParameterType, callback?: (err: Error | null) => void): void;
2345
- post(method: "NodeRuntime.notifyWhenWaitingForDisconnect", callback?: (err: Error | null) => void): void;
2346
-
2347
2206
  // Events
2348
2207
 
2349
2208
  addListener(event: string, listener: (...args: any[]) => void): this;
@@ -2438,41 +2297,6 @@ declare module 'inspector' {
2438
2297
  */
2439
2298
  addListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2440
2299
 
2441
- /**
2442
- * Contains an bucket of collected trace events.
2443
- */
2444
- addListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2445
-
2446
- /**
2447
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2448
- * delivered via dataCollected events.
2449
- */
2450
- addListener(event: "NodeTracing.tracingComplete", listener: () => void): this;
2451
-
2452
- /**
2453
- * Issued when attached to a worker.
2454
- */
2455
- addListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2456
-
2457
- /**
2458
- * Issued when detached from the worker.
2459
- */
2460
- addListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2461
-
2462
- /**
2463
- * Notifies about a new protocol message received from the session
2464
- * (session ID is provided in attachedToWorker notification).
2465
- */
2466
- addListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2467
-
2468
- /**
2469
- * This event is fired instead of `Runtime.executionContextDestroyed` when
2470
- * enabled.
2471
- * It is fired when the Node process finished all code execution and is
2472
- * waiting for all frontends to disconnect.
2473
- */
2474
- addListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this;
2475
-
2476
2300
  emit(event: string | symbol, ...args: any[]): boolean;
2477
2301
  emit(event: "inspectorNotification", message: InspectorNotification<{}>): boolean;
2478
2302
  emit(event: "Runtime.executionContextCreated", message: InspectorNotification<Runtime.ExecutionContextCreatedEventDataType>): boolean;
@@ -2495,12 +2319,6 @@ declare module 'inspector' {
2495
2319
  emit(event: "HeapProfiler.reportHeapSnapshotProgress", message: InspectorNotification<HeapProfiler.ReportHeapSnapshotProgressEventDataType>): boolean;
2496
2320
  emit(event: "HeapProfiler.lastSeenObjectId", message: InspectorNotification<HeapProfiler.LastSeenObjectIdEventDataType>): boolean;
2497
2321
  emit(event: "HeapProfiler.heapStatsUpdate", message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>): boolean;
2498
- emit(event: "NodeTracing.dataCollected", message: InspectorNotification<NodeTracing.DataCollectedEventDataType>): boolean;
2499
- emit(event: "NodeTracing.tracingComplete"): boolean;
2500
- emit(event: "NodeWorker.attachedToWorker", message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>): boolean;
2501
- emit(event: "NodeWorker.detachedFromWorker", message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>): boolean;
2502
- emit(event: "NodeWorker.receivedMessageFromWorker", message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>): boolean;
2503
- emit(event: "NodeRuntime.waitingForDisconnect"): boolean;
2504
2322
 
2505
2323
  on(event: string, listener: (...args: any[]) => void): this;
2506
2324
 
@@ -2594,41 +2412,6 @@ declare module 'inspector' {
2594
2412
  */
2595
2413
  on(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2596
2414
 
2597
- /**
2598
- * Contains an bucket of collected trace events.
2599
- */
2600
- on(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2601
-
2602
- /**
2603
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2604
- * delivered via dataCollected events.
2605
- */
2606
- on(event: "NodeTracing.tracingComplete", listener: () => void): this;
2607
-
2608
- /**
2609
- * Issued when attached to a worker.
2610
- */
2611
- on(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2612
-
2613
- /**
2614
- * Issued when detached from the worker.
2615
- */
2616
- on(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2617
-
2618
- /**
2619
- * Notifies about a new protocol message received from the session
2620
- * (session ID is provided in attachedToWorker notification).
2621
- */
2622
- on(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2623
-
2624
- /**
2625
- * This event is fired instead of `Runtime.executionContextDestroyed` when
2626
- * enabled.
2627
- * It is fired when the Node process finished all code execution and is
2628
- * waiting for all frontends to disconnect.
2629
- */
2630
- on(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this;
2631
-
2632
2415
  once(event: string, listener: (...args: any[]) => void): this;
2633
2416
 
2634
2417
  /**
@@ -2721,41 +2504,6 @@ declare module 'inspector' {
2721
2504
  */
2722
2505
  once(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2723
2506
 
2724
- /**
2725
- * Contains an bucket of collected trace events.
2726
- */
2727
- once(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2728
-
2729
- /**
2730
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2731
- * delivered via dataCollected events.
2732
- */
2733
- once(event: "NodeTracing.tracingComplete", listener: () => void): this;
2734
-
2735
- /**
2736
- * Issued when attached to a worker.
2737
- */
2738
- once(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2739
-
2740
- /**
2741
- * Issued when detached from the worker.
2742
- */
2743
- once(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2744
-
2745
- /**
2746
- * Notifies about a new protocol message received from the session
2747
- * (session ID is provided in attachedToWorker notification).
2748
- */
2749
- once(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2750
-
2751
- /**
2752
- * This event is fired instead of `Runtime.executionContextDestroyed` when
2753
- * enabled.
2754
- * It is fired when the Node process finished all code execution and is
2755
- * waiting for all frontends to disconnect.
2756
- */
2757
- once(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this;
2758
-
2759
2507
  prependListener(event: string, listener: (...args: any[]) => void): this;
2760
2508
 
2761
2509
  /**
@@ -2848,41 +2596,6 @@ declare module 'inspector' {
2848
2596
  */
2849
2597
  prependListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2850
2598
 
2851
- /**
2852
- * Contains an bucket of collected trace events.
2853
- */
2854
- prependListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2855
-
2856
- /**
2857
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2858
- * delivered via dataCollected events.
2859
- */
2860
- prependListener(event: "NodeTracing.tracingComplete", listener: () => void): this;
2861
-
2862
- /**
2863
- * Issued when attached to a worker.
2864
- */
2865
- prependListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2866
-
2867
- /**
2868
- * Issued when detached from the worker.
2869
- */
2870
- prependListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2871
-
2872
- /**
2873
- * Notifies about a new protocol message received from the session
2874
- * (session ID is provided in attachedToWorker notification).
2875
- */
2876
- prependListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
2877
-
2878
- /**
2879
- * This event is fired instead of `Runtime.executionContextDestroyed` when
2880
- * enabled.
2881
- * It is fired when the Node process finished all code execution and is
2882
- * waiting for all frontends to disconnect.
2883
- */
2884
- prependListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this;
2885
-
2886
2599
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
2887
2600
 
2888
2601
  /**
@@ -2974,41 +2687,6 @@ declare module 'inspector' {
2974
2687
  * If heap objects tracking has been started then backend may send update for one or more fragments
2975
2688
  */
2976
2689
  prependOnceListener(event: "HeapProfiler.heapStatsUpdate", listener: (message: InspectorNotification<HeapProfiler.HeapStatsUpdateEventDataType>) => void): this;
2977
-
2978
- /**
2979
- * Contains an bucket of collected trace events.
2980
- */
2981
- prependOnceListener(event: "NodeTracing.dataCollected", listener: (message: InspectorNotification<NodeTracing.DataCollectedEventDataType>) => void): this;
2982
-
2983
- /**
2984
- * Signals that tracing is stopped and there is no trace buffers pending flush, all data were
2985
- * delivered via dataCollected events.
2986
- */
2987
- prependOnceListener(event: "NodeTracing.tracingComplete", listener: () => void): this;
2988
-
2989
- /**
2990
- * Issued when attached to a worker.
2991
- */
2992
- prependOnceListener(event: "NodeWorker.attachedToWorker", listener: (message: InspectorNotification<NodeWorker.AttachedToWorkerEventDataType>) => void): this;
2993
-
2994
- /**
2995
- * Issued when detached from the worker.
2996
- */
2997
- prependOnceListener(event: "NodeWorker.detachedFromWorker", listener: (message: InspectorNotification<NodeWorker.DetachedFromWorkerEventDataType>) => void): this;
2998
-
2999
- /**
3000
- * Notifies about a new protocol message received from the session
3001
- * (session ID is provided in attachedToWorker notification).
3002
- */
3003
- prependOnceListener(event: "NodeWorker.receivedMessageFromWorker", listener: (message: InspectorNotification<NodeWorker.ReceivedMessageFromWorkerEventDataType>) => void): this;
3004
-
3005
- /**
3006
- * This event is fired instead of `Runtime.executionContextDestroyed` when
3007
- * enabled.
3008
- * It is fired when the Node process finished all code execution and is
3009
- * waiting for all frontends to disconnect.
3010
- */
3011
- prependOnceListener(event: "NodeRuntime.waitingForDisconnect", listener: () => void): this;
3012
2690
  }
3013
2691
 
3014
2692
  // Top Level API
@@ -3039,3 +2717,7 @@ declare module 'inspector' {
3039
2717
  */
3040
2718
  function waitForDebugger(): void;
3041
2719
  }
2720
+
2721
+ declare module 'node:inspector' {
2722
+ export * from 'inspector';
2723
+ }
@@ -37,10 +37,6 @@ declare module 'module' {
37
37
  static runMain(): void;
38
38
  static wrap(code: string): string;
39
39
 
40
- /**
41
- * @deprecated Deprecated since: v12.2.0. Please use createRequire() instead.
42
- */
43
- static createRequireFromPath(path: string): NodeRequire;
44
40
  static createRequire(path: string | URL): NodeRequire;
45
41
  static builtinModules: string[];
46
42
 
@@ -48,5 +44,30 @@ declare module 'module' {
48
44
 
49
45
  constructor(id: string, parent?: Module);
50
46
  }
47
+
48
+ global {
49
+ interface ImportMeta {
50
+ url: string;
51
+ /**
52
+ * @experimental
53
+ * This feature is only available with the `--experimental-import-meta-resolve`
54
+ * command flag enabled.
55
+ *
56
+ * Provides a module-relative resolution function scoped to each module, returning
57
+ * the URL string.
58
+ *
59
+ * @param specified The module specifier to resolve relative to `parent`.
60
+ * @param parent The absolute parent module URL to resolve from. If none
61
+ * is specified, the value of `import.meta.url` is used as the default.
62
+ */
63
+ resolve?(specified: string, parent?: string | URL): Promise<string>;
64
+ }
65
+ }
66
+
51
67
  export = Module;
52
68
  }
69
+
70
+ declare module 'node:module' {
71
+ import module = require('module');
72
+ export = module;
73
+ }
@@ -115,7 +115,6 @@ declare module 'net' {
115
115
  addListener(event: "end", listener: () => void): this;
116
116
  addListener(event: "error", listener: (err: Error) => void): this;
117
117
  addListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
118
- addListener(event: "ready", listener: () => void): this;
119
118
  addListener(event: "timeout", listener: () => void): this;
120
119
 
121
120
  emit(event: string | symbol, ...args: any[]): boolean;
@@ -126,7 +125,6 @@ declare module 'net' {
126
125
  emit(event: "end"): boolean;
127
126
  emit(event: "error", err: Error): boolean;
128
127
  emit(event: "lookup", err: Error, address: string, family: string | number, host: string): boolean;
129
- emit(event: "ready"): boolean;
130
128
  emit(event: "timeout"): boolean;
131
129
 
132
130
  on(event: string, listener: (...args: any[]) => void): this;
@@ -137,7 +135,6 @@ declare module 'net' {
137
135
  on(event: "end", listener: () => void): this;
138
136
  on(event: "error", listener: (err: Error) => void): this;
139
137
  on(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
140
- on(event: "ready", listener: () => void): this;
141
138
  on(event: "timeout", listener: () => void): this;
142
139
 
143
140
  once(event: string, listener: (...args: any[]) => void): this;
@@ -148,7 +145,6 @@ declare module 'net' {
148
145
  once(event: "end", listener: () => void): this;
149
146
  once(event: "error", listener: (err: Error) => void): this;
150
147
  once(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
151
- once(event: "ready", listener: () => void): this;
152
148
  once(event: "timeout", listener: () => void): this;
153
149
 
154
150
  prependListener(event: string, listener: (...args: any[]) => void): this;
@@ -159,7 +155,6 @@ declare module 'net' {
159
155
  prependListener(event: "end", listener: () => void): this;
160
156
  prependListener(event: "error", listener: (err: Error) => void): this;
161
157
  prependListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
162
- prependListener(event: "ready", listener: () => void): this;
163
158
  prependListener(event: "timeout", listener: () => void): this;
164
159
 
165
160
  prependOnceListener(event: string, listener: (...args: any[]) => void): this;
@@ -170,7 +165,6 @@ declare module 'net' {
170
165
  prependOnceListener(event: "end", listener: () => void): this;
171
166
  prependOnceListener(event: "error", listener: (err: Error) => void): this;
172
167
  prependOnceListener(event: "lookup", listener: (err: Error, address: string, family: string | number, host: string) => void): this;
173
- prependOnceListener(event: "ready", listener: () => void): this;
174
168
  prependOnceListener(event: "timeout", listener: () => void): this;
175
169
  }
176
170
 
@@ -368,3 +362,7 @@ declare module 'net' {
368
362
  readonly flowlabel: number;
369
363
  }
370
364
  }
365
+
366
+ declare module 'node:net' {
367
+ export * from 'net';
368
+ }
@@ -237,3 +237,7 @@ declare module 'os' {
237
237
  */
238
238
  function setPriority(pid: number, priority: number): void;
239
239
  }
240
+
241
+ declare module 'node:os' {
242
+ export * from 'os';
243
+ }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "15.14.6",
3
+ "version": "16.0.0",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -227,6 +227,6 @@
227
227
  },
228
228
  "scripts": {},
229
229
  "dependencies": {},
230
- "typesPublisherContentHash": "13cc7e464b6fe6ced7de4bc970d47e4b88e269cf7cff39067ea2d7616166c849",
230
+ "typesPublisherContentHash": "476de4c669bddcfa79d0a72250799280b3a06de4d96f30f1e357c34f930198cc",
231
231
  "typeScriptVersion": "3.6"
232
232
  }
@@ -161,3 +161,8 @@ declare module 'path' {
161
161
  const path: path.PlatformPath;
162
162
  export = path;
163
163
  }
164
+
165
+ declare module 'node:path' {
166
+ import path = require('path');
167
+ export = path;
168
+ }
@@ -3,6 +3,22 @@ declare module 'perf_hooks' {
3
3
 
4
4
  type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http';
5
5
 
6
+ interface NodeGCPerformanceDetail {
7
+ /**
8
+ * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
9
+ * the type of garbage collection operation that occurred.
10
+ * See perf_hooks.constants for valid values.
11
+ */
12
+ readonly kind?: number;
13
+
14
+ /**
15
+ * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
16
+ * property contains additional information about garbage collection operation.
17
+ * See perf_hooks.constants for valid values.
18
+ */
19
+ readonly flags?: number;
20
+ }
21
+
6
22
  class PerformanceEntry {
7
23
  protected constructor();
8
24
  /**
@@ -27,19 +43,7 @@ declare module 'perf_hooks' {
27
43
  */
28
44
  readonly entryType: EntryType;
29
45
 
30
- /**
31
- * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
32
- * the type of garbage collection operation that occurred.
33
- * See perf_hooks.constants for valid values.
34
- */
35
- readonly kind?: number;
36
-
37
- /**
38
- * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
39
- * property contains additional information about garbage collection operation.
40
- * See perf_hooks.constants for valid values.
41
- */
42
- readonly flags?: number;
46
+ readonly details?: NodeGCPerformanceDetail | unknown; // TODO: Narrow this based on entry type.
43
47
  }
44
48
 
45
49
  class PerformanceNodeTiming extends PerformanceEntry {
@@ -94,6 +98,46 @@ declare module 'perf_hooks' {
94
98
  util2?: EventLoopUtilization,
95
99
  ) => EventLoopUtilization;
96
100
 
101
+ interface MarkOptions {
102
+ /**
103
+ * Additional optional detail to include with the mark.
104
+ */
105
+ detail?: unknown;
106
+ /**
107
+ * An optional timestamp to be used as the mark time.
108
+ * @default `performance.now()`.
109
+ */
110
+ startTime?: number;
111
+ }
112
+
113
+ interface MeasureOptions {
114
+ /**
115
+ * Additional optional detail to include with the mark.
116
+ */
117
+ detail?: unknown;
118
+ /**
119
+ * Duration between start and end times.
120
+ */
121
+ duration?: number;
122
+ /**
123
+ * Timestamp to be used as the end time, or a string identifying a previously recorded mark.
124
+ */
125
+ end?: number | string;
126
+ /**
127
+ * Timestamp to be used as the start time, or a string identifying a previously recorded mark.
128
+ */
129
+ start?: number | string;
130
+ }
131
+
132
+ interface TimerifyOptions {
133
+ /**
134
+ * A histogram object created using
135
+ * `perf_hooks.createHistogram()` that will record runtime durations in
136
+ * nanoseconds.
137
+ */
138
+ histogram?: RecordableHistogram;
139
+ }
140
+
97
141
  interface Performance {
98
142
  /**
99
143
  * If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
@@ -109,7 +153,7 @@ declare module 'perf_hooks' {
109
153
  * Performance marks are used to mark specific significant moments in the Performance Timeline.
110
154
  * @param name
111
155
  */
112
- mark(name?: string): void;
156
+ mark(name?: string, options?: MarkOptions): void;
113
157
 
114
158
  /**
115
159
  * Creates a new PerformanceMeasure entry in the Performance Timeline.
@@ -127,6 +171,7 @@ declare module 'perf_hooks' {
127
171
  * @param endMark
128
172
  */
129
173
  measure(name: string, startMark?: string, endMark?: string): void;
174
+ measure(name: string, options: MeasureOptions): void;
130
175
 
131
176
  /**
132
177
  * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
@@ -148,7 +193,7 @@ declare module 'perf_hooks' {
148
193
  * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed.
149
194
  * @param fn
150
195
  */
151
- timerify<T extends (...optionalParams: any[]) => any>(fn: T): T;
196
+ timerify<T extends (...params: any[]) => any>(fn: T, options?: TimerifyOptions): T;
152
197
 
153
198
  /**
154
199
  * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
@@ -188,12 +233,10 @@ declare module 'perf_hooks' {
188
233
  disconnect(): void;
189
234
 
190
235
  /**
191
- * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes.
236
+ * Subscribes the PerformanceObserver instance to notifications of new PerformanceEntry instances identified by options.entryTypes or options.type.
192
237
  * When options.buffered is false, the callback will be invoked once for every PerformanceEntry instance.
193
- * Property buffered defaults to false.
194
- * @param options
195
238
  */
196
- observe(options: { entryTypes: ReadonlyArray<EntryType>; buffered?: boolean }): void;
239
+ observe(options: { entryTypes: ReadonlyArray<EntryType> } | { type: EntryType }): void;
197
240
  }
198
241
 
199
242
  namespace constants {
@@ -308,3 +351,7 @@ declare module 'perf_hooks' {
308
351
 
309
352
  function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
310
353
  }
354
+
355
+ declare module 'node:perf_hooks' {
356
+ export * from 'perf_hooks';
357
+ }