cdk-common 2.0.1351 → 2.0.1353

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 (168) hide show
  1. package/.jsii +38 -2
  2. package/API.md +36 -0
  3. package/lib/main.js +1 -1
  4. package/lib/managed-policies.d.ts +7 -1
  5. package/lib/managed-policies.js +7 -1
  6. package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
  7. package/node_modules/@types/concat-stream/node_modules/@types/node/assert/strict.d.ts +5 -11
  8. package/node_modules/@types/concat-stream/node_modules/@types/node/assert.d.ts +9 -169
  9. package/node_modules/@types/concat-stream/node_modules/@types/node/async_hooks.d.ts +8 -8
  10. package/node_modules/@types/concat-stream/node_modules/@types/node/buffer.buffer.d.ts +1 -7
  11. package/node_modules/@types/concat-stream/node_modules/@types/node/buffer.d.ts +44 -168
  12. package/node_modules/@types/concat-stream/node_modules/@types/node/child_process.d.ts +16 -64
  13. package/node_modules/@types/concat-stream/node_modules/@types/node/cluster.d.ts +240 -332
  14. package/node_modules/@types/concat-stream/node_modules/@types/node/console.d.ts +49 -351
  15. package/node_modules/@types/concat-stream/node_modules/@types/node/constants.d.ts +3 -4
  16. package/node_modules/@types/concat-stream/node_modules/@types/node/crypto.d.ts +279 -1631
  17. package/node_modules/@types/concat-stream/node_modules/@types/node/dgram.d.ts +15 -51
  18. package/node_modules/@types/concat-stream/node_modules/@types/node/diagnostics_channel.d.ts +4 -4
  19. package/node_modules/@types/concat-stream/node_modules/@types/node/dns/promises.d.ts +3 -3
  20. package/node_modules/@types/concat-stream/node_modules/@types/node/dns.d.ts +131 -132
  21. package/node_modules/@types/concat-stream/node_modules/@types/node/domain.d.ts +13 -17
  22. package/node_modules/@types/concat-stream/node_modules/@types/node/events.d.ts +869 -791
  23. package/node_modules/@types/concat-stream/node_modules/@types/node/fs/promises.d.ts +7 -8
  24. package/node_modules/@types/concat-stream/node_modules/@types/node/fs.d.ts +417 -455
  25. package/node_modules/@types/concat-stream/node_modules/@types/node/globals.d.ts +6 -26
  26. package/node_modules/@types/concat-stream/node_modules/@types/node/globals.typedarray.d.ts +60 -0
  27. package/node_modules/@types/concat-stream/node_modules/@types/node/http.d.ts +263 -254
  28. package/node_modules/@types/concat-stream/node_modules/@types/node/http2.d.ts +528 -804
  29. package/node_modules/@types/concat-stream/node_modules/@types/node/https.d.ts +59 -239
  30. package/node_modules/@types/concat-stream/node_modules/@types/node/index.d.ts +15 -1
  31. package/node_modules/@types/concat-stream/node_modules/@types/node/inspector/promises.d.ts +41 -0
  32. package/node_modules/@types/concat-stream/node_modules/@types/node/inspector.d.ts +6 -59
  33. package/node_modules/@types/concat-stream/node_modules/@types/node/inspector.generated.d.ts +3 -10
  34. package/node_modules/@types/concat-stream/node_modules/@types/node/module.d.ts +47 -122
  35. package/node_modules/@types/concat-stream/node_modules/@types/node/net.d.ts +63 -184
  36. package/node_modules/@types/concat-stream/node_modules/@types/node/os.d.ts +6 -6
  37. package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +2 -2
  38. package/node_modules/@types/concat-stream/node_modules/@types/node/path/posix.d.ts +8 -0
  39. package/node_modules/@types/concat-stream/node_modules/@types/node/path/win32.d.ts +8 -0
  40. package/node_modules/@types/concat-stream/node_modules/@types/node/path.d.ts +120 -133
  41. package/node_modules/@types/concat-stream/node_modules/@types/node/perf_hooks.d.ts +282 -643
  42. package/node_modules/@types/concat-stream/node_modules/@types/node/process.d.ts +156 -128
  43. package/node_modules/@types/concat-stream/node_modules/@types/node/punycode.d.ts +5 -5
  44. package/node_modules/@types/concat-stream/node_modules/@types/node/querystring.d.ts +4 -4
  45. package/node_modules/@types/concat-stream/node_modules/@types/node/quic.d.ts +910 -0
  46. package/node_modules/@types/concat-stream/node_modules/@types/node/readline/promises.d.ts +3 -3
  47. package/node_modules/@types/concat-stream/node_modules/@types/node/readline.d.ts +67 -120
  48. package/node_modules/@types/concat-stream/node_modules/@types/node/repl.d.ts +75 -98
  49. package/node_modules/@types/concat-stream/node_modules/@types/node/sea.d.ts +1 -1
  50. package/node_modules/@types/concat-stream/node_modules/@types/node/sqlite.d.ts +2 -2
  51. package/node_modules/@types/concat-stream/node_modules/@types/node/stream/consumers.d.ts +10 -10
  52. package/node_modules/@types/concat-stream/node_modules/@types/node/stream/promises.d.ts +136 -15
  53. package/node_modules/@types/concat-stream/node_modules/@types/node/stream/web.d.ts +176 -453
  54. package/node_modules/@types/concat-stream/node_modules/@types/node/stream.d.ts +555 -478
  55. package/node_modules/@types/concat-stream/node_modules/@types/node/string_decoder.d.ts +4 -4
  56. package/node_modules/@types/concat-stream/node_modules/@types/node/test/reporters.d.ts +96 -0
  57. package/node_modules/@types/concat-stream/node_modules/@types/node/test.d.ts +80 -180
  58. package/node_modules/@types/concat-stream/node_modules/@types/node/timers/promises.d.ts +4 -4
  59. package/node_modules/@types/concat-stream/node_modules/@types/node/timers.d.ts +4 -130
  60. package/node_modules/@types/concat-stream/node_modules/@types/node/tls.d.ts +102 -177
  61. package/node_modules/@types/concat-stream/node_modules/@types/node/trace_events.d.ts +9 -9
  62. package/node_modules/@types/concat-stream/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -7
  63. package/node_modules/@types/concat-stream/node_modules/@types/node/ts5.6/index.d.ts +15 -1
  64. package/node_modules/@types/concat-stream/node_modules/@types/node/ts5.7/index.d.ts +15 -1
  65. package/node_modules/@types/concat-stream/node_modules/@types/node/tty.d.ts +58 -16
  66. package/node_modules/@types/concat-stream/node_modules/@types/node/url.d.ts +54 -592
  67. package/node_modules/@types/concat-stream/node_modules/@types/node/util/types.d.ts +558 -0
  68. package/node_modules/@types/concat-stream/node_modules/@types/node/util.d.ts +120 -792
  69. package/node_modules/@types/concat-stream/node_modules/@types/node/v8.d.ts +32 -5
  70. package/node_modules/@types/concat-stream/node_modules/@types/node/vm.d.ts +13 -13
  71. package/node_modules/@types/concat-stream/node_modules/@types/node/wasi.d.ts +4 -4
  72. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
  73. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  74. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/console.d.ts +9 -0
  75. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/crypto.d.ts +7 -0
  76. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  77. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/events.d.ts +9 -0
  78. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/fetch.d.ts +4 -0
  79. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  80. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  81. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  82. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/streams.d.ts +93 -0
  83. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  84. package/node_modules/@types/concat-stream/node_modules/@types/node/web-globals/url.d.ts +24 -0
  85. package/node_modules/@types/concat-stream/node_modules/@types/node/worker_threads.d.ts +176 -358
  86. package/node_modules/@types/concat-stream/node_modules/@types/node/zlib.d.ts +8 -71
  87. package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
  88. package/node_modules/@types/form-data/node_modules/@types/node/assert/strict.d.ts +5 -11
  89. package/node_modules/@types/form-data/node_modules/@types/node/assert.d.ts +9 -169
  90. package/node_modules/@types/form-data/node_modules/@types/node/async_hooks.d.ts +8 -8
  91. package/node_modules/@types/form-data/node_modules/@types/node/buffer.buffer.d.ts +1 -7
  92. package/node_modules/@types/form-data/node_modules/@types/node/buffer.d.ts +44 -168
  93. package/node_modules/@types/form-data/node_modules/@types/node/child_process.d.ts +16 -64
  94. package/node_modules/@types/form-data/node_modules/@types/node/cluster.d.ts +240 -332
  95. package/node_modules/@types/form-data/node_modules/@types/node/console.d.ts +49 -351
  96. package/node_modules/@types/form-data/node_modules/@types/node/constants.d.ts +3 -4
  97. package/node_modules/@types/form-data/node_modules/@types/node/crypto.d.ts +279 -1631
  98. package/node_modules/@types/form-data/node_modules/@types/node/dgram.d.ts +15 -51
  99. package/node_modules/@types/form-data/node_modules/@types/node/diagnostics_channel.d.ts +4 -4
  100. package/node_modules/@types/form-data/node_modules/@types/node/dns/promises.d.ts +3 -3
  101. package/node_modules/@types/form-data/node_modules/@types/node/dns.d.ts +131 -132
  102. package/node_modules/@types/form-data/node_modules/@types/node/domain.d.ts +13 -17
  103. package/node_modules/@types/form-data/node_modules/@types/node/events.d.ts +869 -791
  104. package/node_modules/@types/form-data/node_modules/@types/node/fs/promises.d.ts +7 -8
  105. package/node_modules/@types/form-data/node_modules/@types/node/fs.d.ts +417 -455
  106. package/node_modules/@types/form-data/node_modules/@types/node/globals.d.ts +6 -26
  107. package/node_modules/@types/form-data/node_modules/@types/node/globals.typedarray.d.ts +60 -0
  108. package/node_modules/@types/form-data/node_modules/@types/node/http.d.ts +263 -254
  109. package/node_modules/@types/form-data/node_modules/@types/node/http2.d.ts +528 -804
  110. package/node_modules/@types/form-data/node_modules/@types/node/https.d.ts +59 -239
  111. package/node_modules/@types/form-data/node_modules/@types/node/index.d.ts +15 -1
  112. package/node_modules/@types/form-data/node_modules/@types/node/inspector/promises.d.ts +41 -0
  113. package/node_modules/@types/form-data/node_modules/@types/node/inspector.d.ts +6 -59
  114. package/node_modules/@types/form-data/node_modules/@types/node/inspector.generated.d.ts +3 -10
  115. package/node_modules/@types/form-data/node_modules/@types/node/module.d.ts +47 -122
  116. package/node_modules/@types/form-data/node_modules/@types/node/net.d.ts +63 -184
  117. package/node_modules/@types/form-data/node_modules/@types/node/os.d.ts +6 -6
  118. package/node_modules/@types/form-data/node_modules/@types/node/package.json +2 -2
  119. package/node_modules/@types/form-data/node_modules/@types/node/path/posix.d.ts +8 -0
  120. package/node_modules/@types/form-data/node_modules/@types/node/path/win32.d.ts +8 -0
  121. package/node_modules/@types/form-data/node_modules/@types/node/path.d.ts +120 -133
  122. package/node_modules/@types/form-data/node_modules/@types/node/perf_hooks.d.ts +282 -643
  123. package/node_modules/@types/form-data/node_modules/@types/node/process.d.ts +156 -128
  124. package/node_modules/@types/form-data/node_modules/@types/node/punycode.d.ts +5 -5
  125. package/node_modules/@types/form-data/node_modules/@types/node/querystring.d.ts +4 -4
  126. package/node_modules/@types/form-data/node_modules/@types/node/quic.d.ts +910 -0
  127. package/node_modules/@types/form-data/node_modules/@types/node/readline/promises.d.ts +3 -3
  128. package/node_modules/@types/form-data/node_modules/@types/node/readline.d.ts +67 -120
  129. package/node_modules/@types/form-data/node_modules/@types/node/repl.d.ts +75 -98
  130. package/node_modules/@types/form-data/node_modules/@types/node/sea.d.ts +1 -1
  131. package/node_modules/@types/form-data/node_modules/@types/node/sqlite.d.ts +2 -2
  132. package/node_modules/@types/form-data/node_modules/@types/node/stream/consumers.d.ts +10 -10
  133. package/node_modules/@types/form-data/node_modules/@types/node/stream/promises.d.ts +136 -15
  134. package/node_modules/@types/form-data/node_modules/@types/node/stream/web.d.ts +176 -453
  135. package/node_modules/@types/form-data/node_modules/@types/node/stream.d.ts +555 -478
  136. package/node_modules/@types/form-data/node_modules/@types/node/string_decoder.d.ts +4 -4
  137. package/node_modules/@types/form-data/node_modules/@types/node/test/reporters.d.ts +96 -0
  138. package/node_modules/@types/form-data/node_modules/@types/node/test.d.ts +80 -180
  139. package/node_modules/@types/form-data/node_modules/@types/node/timers/promises.d.ts +4 -4
  140. package/node_modules/@types/form-data/node_modules/@types/node/timers.d.ts +4 -130
  141. package/node_modules/@types/form-data/node_modules/@types/node/tls.d.ts +102 -177
  142. package/node_modules/@types/form-data/node_modules/@types/node/trace_events.d.ts +9 -9
  143. package/node_modules/@types/form-data/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +1 -7
  144. package/node_modules/@types/form-data/node_modules/@types/node/ts5.6/index.d.ts +15 -1
  145. package/node_modules/@types/form-data/node_modules/@types/node/ts5.7/index.d.ts +15 -1
  146. package/node_modules/@types/form-data/node_modules/@types/node/tty.d.ts +58 -16
  147. package/node_modules/@types/form-data/node_modules/@types/node/url.d.ts +54 -592
  148. package/node_modules/@types/form-data/node_modules/@types/node/util/types.d.ts +558 -0
  149. package/node_modules/@types/form-data/node_modules/@types/node/util.d.ts +120 -792
  150. package/node_modules/@types/form-data/node_modules/@types/node/v8.d.ts +32 -5
  151. package/node_modules/@types/form-data/node_modules/@types/node/vm.d.ts +13 -13
  152. package/node_modules/@types/form-data/node_modules/@types/node/wasi.d.ts +4 -4
  153. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/abortcontroller.d.ts +27 -2
  154. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  155. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/console.d.ts +9 -0
  156. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/crypto.d.ts +7 -0
  157. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  158. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/events.d.ts +9 -0
  159. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/fetch.d.ts +4 -0
  160. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  161. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  162. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  163. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/streams.d.ts +93 -0
  164. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  165. package/node_modules/@types/form-data/node_modules/@types/node/web-globals/url.d.ts +24 -0
  166. package/node_modules/@types/form-data/node_modules/@types/node/worker_threads.d.ts +176 -358
  167. package/node_modules/@types/form-data/node_modules/@types/node/zlib.d.ts +8 -71
  168. package/package.json +4 -4
@@ -27,10 +27,11 @@
27
27
  * performance.measure('A to B', 'A', 'B');
28
28
  * });
29
29
  * ```
30
- * @see [source](https://github.com/nodejs/node/blob/v24.x/lib/perf_hooks.js)
30
+ * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/perf_hooks.js)
31
31
  */
32
- declare module "perf_hooks" {
33
- import { AsyncResource } from "node:async_hooks";
32
+ declare module "node:perf_hooks" {
33
+ import { InternalEventTargetEventProperties } from "node:events";
34
+ // #region web types
34
35
  type EntryType =
35
36
  | "dns" // Node.js only
36
37
  | "function" // Node.js only
@@ -42,76 +43,291 @@ declare module "perf_hooks" {
42
43
  | "net" // Node.js only
43
44
  | "node" // Node.js only
44
45
  | "resource"; // available on the Web
45
- interface NodeGCPerformanceDetail {
46
- /**
47
- * When `performanceEntry.entryType` is equal to 'gc', the `performance.kind` property identifies
48
- * the type of garbage collection operation that occurred.
49
- * See perf_hooks.constants for valid values.
50
- */
51
- readonly kind: number;
52
- /**
53
- * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
54
- * property contains additional information about garbage collection operation.
55
- * See perf_hooks.constants for valid values.
56
- */
57
- readonly flags: number;
46
+ interface EventLoopUtilization {
47
+ idle: number;
48
+ active: number;
49
+ utilization: number;
58
50
  }
59
- /**
60
- * The constructor of this class is not exposed to users directly.
61
- * @since v8.5.0
62
- */
63
- class PerformanceEntry {
64
- protected constructor();
65
- /**
66
- * The total number of milliseconds elapsed for this entry. This value will not
67
- * be meaningful for all Performance Entry types.
68
- * @since v8.5.0
69
- */
70
- readonly duration: number;
71
- /**
72
- * The name of the performance entry.
73
- * @since v8.5.0
74
- */
75
- readonly name: string;
51
+ interface ConnectionTimingInfo {
52
+ domainLookupStartTime: number;
53
+ domainLookupEndTime: number;
54
+ connectionStartTime: number;
55
+ connectionEndTime: number;
56
+ secureConnectionStartTime: number;
57
+ ALPNNegotiatedProtocol: string;
58
+ }
59
+ interface FetchTimingInfo {
60
+ startTime: number;
61
+ redirectStartTime: number;
62
+ redirectEndTime: number;
63
+ postRedirectStartTime: number;
64
+ finalServiceWorkerStartTime: number;
65
+ finalNetworkRequestStartTime: number;
66
+ finalNetworkResponseStartTime: number;
67
+ endTime: number;
68
+ finalConnectionTimingInfo: ConnectionTimingInfo | null;
69
+ encodedBodySize: number;
70
+ decodedBodySize: number;
71
+ }
72
+ type PerformanceEntryList = PerformanceEntry[];
73
+ interface PerformanceMarkOptions {
74
+ detail?: any;
75
+ startTime?: number;
76
+ }
77
+ interface PerformanceMeasureOptions {
78
+ detail?: any;
79
+ duration?: number;
80
+ end?: string | number;
81
+ start?: string | number;
82
+ }
83
+ interface PerformanceObserverCallback {
84
+ (entries: PerformanceObserverEntryList, observer: PerformanceObserver): void;
85
+ }
86
+ interface PerformanceObserverInit {
87
+ buffered?: boolean;
88
+ entryTypes?: EntryType[];
89
+ type?: EntryType;
90
+ }
91
+ interface PerformanceEventMap {
92
+ "resourcetimingbufferfull": Event;
93
+ }
94
+ interface Performance extends EventTarget, InternalEventTargetEventProperties<PerformanceEventMap> {
95
+ readonly nodeTiming: PerformanceNodeTiming;
96
+ readonly timeOrigin: number;
97
+ clearMarks(markName?: string): void;
98
+ clearMeasures(measureName?: string): void;
99
+ clearResourceTimings(resourceTimingName?: string): void;
100
+ getEntries(): PerformanceEntryList;
101
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntryList;
102
+ getEntriesByType(type: EntryType): PerformanceEntryList;
103
+ mark(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
104
+ markResourceTiming(
105
+ timingInfo: FetchTimingInfo,
106
+ requestedUrl: string,
107
+ initiatorType: string,
108
+ global: unknown,
109
+ cacheMode: string,
110
+ bodyInfo: unknown,
111
+ responseStatus: number,
112
+ deliveryType?: string,
113
+ ): PerformanceResourceTiming;
114
+ measure(measureName: string, startMark?: string, endMark?: string): PerformanceMeasure;
115
+ measure(measureName: string, options: PerformanceMeasureOptions, endMark?: string): PerformanceMeasure;
116
+ now(): number;
117
+ setResourceTimingBufferSize(maxSize: number): void;
118
+ toJSON(): any;
119
+ addEventListener<K extends keyof PerformanceEventMap>(
120
+ type: K,
121
+ listener: (ev: PerformanceEventMap[K]) => void,
122
+ options?: AddEventListenerOptions | boolean,
123
+ ): void;
124
+ addEventListener(
125
+ type: string,
126
+ listener: EventListener | EventListenerObject,
127
+ options?: AddEventListenerOptions | boolean,
128
+ ): void;
129
+ removeEventListener<K extends keyof PerformanceEventMap>(
130
+ type: K,
131
+ listener: (ev: PerformanceEventMap[K]) => void,
132
+ options?: EventListenerOptions | boolean,
133
+ ): void;
134
+ removeEventListener(
135
+ type: string,
136
+ listener: EventListener | EventListenerObject,
137
+ options?: EventListenerOptions | boolean,
138
+ ): void;
76
139
  /**
77
- * The high resolution millisecond timestamp marking the starting time of the
78
- * Performance Entry.
79
- * @since v8.5.0
140
+ * The `eventLoopUtilization()` method returns an object that contains the
141
+ * cumulative duration of time the event loop has been both idle and active as a
142
+ * high resolution milliseconds timer. The `utilization` value is the calculated
143
+ * Event Loop Utilization (ELU).
144
+ *
145
+ * If bootstrapping has not yet finished on the main thread the properties have
146
+ * the value of `0`. The ELU is immediately available on [Worker threads](https://nodejs.org/docs/latest-v25.x/api/worker_threads.html#worker-threads) since
147
+ * bootstrap happens within the event loop.
148
+ *
149
+ * Both `utilization1` and `utilization2` are optional parameters.
150
+ *
151
+ * If `utilization1` is passed, then the delta between the current call's `active`
152
+ * and `idle` times, as well as the corresponding `utilization` value are
153
+ * calculated and returned (similar to `process.hrtime()`).
154
+ *
155
+ * If `utilization1` and `utilization2` are both passed, then the delta is
156
+ * calculated between the two arguments. This is a convenience option because,
157
+ * unlike `process.hrtime()`, calculating the ELU is more complex than a
158
+ * single subtraction.
159
+ *
160
+ * ELU is similar to CPU utilization, except that it only measures event loop
161
+ * statistics and not CPU usage. It represents the percentage of time the event
162
+ * loop has spent outside the event loop's event provider (e.g. `epoll_wait`).
163
+ * No other CPU idle time is taken into consideration. The following is an example
164
+ * of how a mostly idle process will have a high ELU.
165
+ *
166
+ * ```js
167
+ * import { eventLoopUtilization } from 'node:perf_hooks';
168
+ * import { spawnSync } from 'node:child_process';
169
+ *
170
+ * setImmediate(() => {
171
+ * const elu = eventLoopUtilization();
172
+ * spawnSync('sleep', ['5']);
173
+ * console.log(eventLoopUtilization(elu).utilization);
174
+ * });
175
+ * ```
176
+ *
177
+ * Although the CPU is mostly idle while running this script, the value of
178
+ * `utilization` is `1`. This is because the call to
179
+ * `child_process.spawnSync()` blocks the event loop from proceeding.
180
+ *
181
+ * Passing in a user-defined object instead of the result of a previous call to
182
+ * `eventLoopUtilization()` will lead to undefined behavior. The return values
183
+ * are not guaranteed to reflect any correct state of the event loop.
184
+ * @since v14.10.0, v12.19.0
185
+ * @param utilization1 The result of a previous call to
186
+ * `eventLoopUtilization()`.
187
+ * @param utilization2 The result of a previous call to
188
+ * `eventLoopUtilization()` prior to `utilization1`.
80
189
  */
81
- readonly startTime: number;
190
+ eventLoopUtilization(
191
+ utilization1?: EventLoopUtilization,
192
+ utilization2?: EventLoopUtilization,
193
+ ): EventLoopUtilization;
82
194
  /**
83
- * The type of the performance entry. It may be one of:
195
+ * _This property is an extension by Node.js. It is not available in Web browsers._
84
196
  *
85
- * * `'node'` (Node.js only)
86
- * * `'mark'` (available on the Web)
87
- * * `'measure'` (available on the Web)
88
- * * `'gc'` (Node.js only)
89
- * * `'function'` (Node.js only)
90
- * * `'http2'` (Node.js only)
91
- * * `'http'` (Node.js only)
197
+ * Wraps a function within a new function that measures the running time of the
198
+ * wrapped function. A `PerformanceObserver` must be subscribed to the `'function'`
199
+ * event type in order for the timing details to be accessed.
200
+ *
201
+ * ```js
202
+ * import { performance, PerformanceObserver } from 'node:perf_hooks';
203
+ *
204
+ * function someFunction() {
205
+ * console.log('hello world');
206
+ * }
207
+ *
208
+ * const wrapped = performance.timerify(someFunction);
209
+ *
210
+ * const obs = new PerformanceObserver((list) => {
211
+ * console.log(list.getEntries()[0].duration);
212
+ *
213
+ * performance.clearMarks();
214
+ * performance.clearMeasures();
215
+ * obs.disconnect();
216
+ * });
217
+ * obs.observe({ entryTypes: ['function'] });
218
+ *
219
+ * // A performance timeline entry will be created
220
+ * wrapped();
221
+ * ```
222
+ *
223
+ * If the wrapped function returns a promise, a finally handler will be attached
224
+ * to the promise and the duration will be reported once the finally handler is
225
+ * invoked.
92
226
  * @since v8.5.0
93
227
  */
228
+ timerify<T extends (...args: any[]) => any>(fn: T, options?: PerformanceTimerifyOptions): T;
229
+ }
230
+ var Performance: {
231
+ prototype: Performance;
232
+ new(): Performance;
233
+ };
234
+ interface PerformanceEntry {
235
+ readonly duration: number;
94
236
  readonly entryType: EntryType;
237
+ readonly name: string;
238
+ readonly startTime: number;
95
239
  toJSON(): any;
96
240
  }
97
- /**
98
- * Exposes marks created via the `Performance.mark()` method.
99
- * @since v18.2.0, v16.17.0
100
- */
101
- class PerformanceMark extends PerformanceEntry {
241
+ var PerformanceEntry: {
242
+ prototype: PerformanceEntry;
243
+ new(): PerformanceEntry;
244
+ };
245
+ interface PerformanceMark extends PerformanceEntry {
102
246
  readonly detail: any;
103
- readonly duration: 0;
104
247
  readonly entryType: "mark";
105
248
  }
249
+ var PerformanceMark: {
250
+ prototype: PerformanceMark;
251
+ new(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
252
+ };
253
+ interface PerformanceMeasure extends PerformanceEntry {
254
+ readonly detail: any;
255
+ readonly entryType: "measure";
256
+ }
257
+ var PerformanceMeasure: {
258
+ prototype: PerformanceMeasure;
259
+ new(): PerformanceMeasure;
260
+ };
261
+ interface PerformanceObserver {
262
+ disconnect(): void;
263
+ observe(options: PerformanceObserverInit): void;
264
+ takeRecords(): PerformanceEntryList;
265
+ }
266
+ var PerformanceObserver: {
267
+ prototype: PerformanceObserver;
268
+ new(callback: PerformanceObserverCallback): PerformanceObserver;
269
+ readonly supportedEntryTypes: readonly EntryType[];
270
+ };
271
+ interface PerformanceObserverEntryList {
272
+ getEntries(): PerformanceEntryList;
273
+ getEntriesByName(name: string, type?: EntryType): PerformanceEntryList;
274
+ getEntriesByType(type: EntryType): PerformanceEntryList;
275
+ }
276
+ var PerformanceObserverEntryList: {
277
+ prototype: PerformanceObserverEntryList;
278
+ new(): PerformanceObserverEntryList;
279
+ };
280
+ interface PerformanceResourceTiming extends PerformanceEntry {
281
+ readonly connectEnd: number;
282
+ readonly connectStart: number;
283
+ readonly decodedBodySize: number;
284
+ readonly domainLookupEnd: number;
285
+ readonly domainLookupStart: number;
286
+ readonly encodedBodySize: number;
287
+ readonly entryType: "resource";
288
+ readonly fetchStart: number;
289
+ readonly initiatorType: string;
290
+ readonly nextHopProtocol: string;
291
+ readonly redirectEnd: number;
292
+ readonly redirectStart: number;
293
+ readonly requestStart: number;
294
+ readonly responseEnd: number;
295
+ readonly responseStart: number;
296
+ readonly responseStatus: number;
297
+ readonly secureConnectionStart: number;
298
+ readonly transferSize: number;
299
+ readonly workerStart: number;
300
+ toJSON(): any;
301
+ }
302
+ var PerformanceResourceTiming: {
303
+ prototype: PerformanceResourceTiming;
304
+ new(): PerformanceResourceTiming;
305
+ };
306
+ var performance: Performance;
307
+ // #endregion
308
+ interface PerformanceTimerifyOptions {
309
+ /**
310
+ * A histogram object created using
311
+ * `perf_hooks.createHistogram()` that will record runtime durations in
312
+ * nanoseconds.
313
+ */
314
+ histogram?: RecordableHistogram | undefined;
315
+ }
106
316
  /**
107
- * Exposes measures created via the `Performance.measure()` method.
317
+ * _This class is an extension by Node.js. It is not available in Web browsers._
318
+ *
319
+ * Provides detailed Node.js timing data.
108
320
  *
109
321
  * The constructor of this class is not exposed to users directly.
110
- * @since v18.2.0, v16.17.0
322
+ * @since v19.0.0
111
323
  */
112
- class PerformanceMeasure extends PerformanceEntry {
324
+ class PerformanceNodeEntry extends PerformanceEntry {
325
+ /**
326
+ * Additional detail specific to the `entryType`.
327
+ * @since v16.0.0
328
+ */
113
329
  readonly detail: any;
114
- readonly entryType: "measure";
330
+ readonly entryType: "dns" | "function" | "gc" | "http2" | "http" | "net" | "node";
115
331
  }
116
332
  interface UVMetrics {
117
333
  /**
@@ -127,7 +343,6 @@ declare module "perf_hooks" {
127
343
  */
128
344
  readonly eventsWaiting: number;
129
345
  }
130
- // TODO: PerformanceNodeEntry is missing
131
346
  /**
132
347
  * _This property is an extension by Node.js. It is not available in Web browsers._
133
348
  *
@@ -135,8 +350,7 @@ declare module "perf_hooks" {
135
350
  * is not exposed to users.
136
351
  * @since v8.5.0
137
352
  */
138
- class PerformanceNodeTiming extends PerformanceEntry {
139
- readonly entryType: "node";
353
+ interface PerformanceNodeTiming extends PerformanceEntry {
140
354
  /**
141
355
  * The high resolution millisecond timestamp at which the Node.js process
142
356
  * completed bootstrapping. If bootstrapping has not yet finished, the property
@@ -144,6 +358,7 @@ declare module "perf_hooks" {
144
358
  * @since v8.5.0
145
359
  */
146
360
  readonly bootstrapComplete: number;
361
+ readonly entryType: "node";
147
362
  /**
148
363
  * The high resolution millisecond timestamp at which the Node.js environment was
149
364
  * initialized.
@@ -195,507 +410,6 @@ declare module "perf_hooks" {
195
410
  */
196
411
  readonly v8Start: number;
197
412
  }
198
- interface EventLoopUtilization {
199
- idle: number;
200
- active: number;
201
- utilization: number;
202
- }
203
- /**
204
- * @param utilization1 The result of a previous call to `eventLoopUtilization()`.
205
- * @param utilization2 The result of a previous call to `eventLoopUtilization()` prior to `utilization1`.
206
- */
207
- type EventLoopUtilityFunction = (
208
- utilization1?: EventLoopUtilization,
209
- utilization2?: EventLoopUtilization,
210
- ) => EventLoopUtilization;
211
- interface MarkOptions {
212
- /**
213
- * Additional optional detail to include with the mark.
214
- */
215
- detail?: unknown | undefined;
216
- /**
217
- * An optional timestamp to be used as the mark time.
218
- * @default `performance.now()`
219
- */
220
- startTime?: number | undefined;
221
- }
222
- interface MeasureOptions {
223
- /**
224
- * Additional optional detail to include with the mark.
225
- */
226
- detail?: unknown;
227
- /**
228
- * Duration between start and end times.
229
- */
230
- duration?: number | undefined;
231
- /**
232
- * Timestamp to be used as the end time, or a string identifying a previously recorded mark.
233
- */
234
- end?: number | string | undefined;
235
- /**
236
- * Timestamp to be used as the start time, or a string identifying a previously recorded mark.
237
- */
238
- start?: number | string | undefined;
239
- }
240
- interface TimerifyOptions {
241
- /**
242
- * A histogram object created using `perf_hooks.createHistogram()` that will record runtime
243
- * durations in nanoseconds.
244
- */
245
- histogram?: RecordableHistogram | undefined;
246
- }
247
- interface Performance {
248
- /**
249
- * If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline.
250
- * If `name` is provided, removes only the named mark.
251
- * @since v8.5.0
252
- */
253
- clearMarks(name?: string): void;
254
- /**
255
- * If `name` is not provided, removes all `PerformanceMeasure` objects from the Performance Timeline.
256
- * If `name` is provided, removes only the named measure.
257
- * @since v16.7.0
258
- */
259
- clearMeasures(name?: string): void;
260
- /**
261
- * If `name` is not provided, removes all `PerformanceResourceTiming` objects from the Resource Timeline.
262
- * If `name` is provided, removes only the named resource.
263
- * @since v18.2.0, v16.17.0
264
- */
265
- clearResourceTimings(name?: string): void;
266
- /**
267
- * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
268
- * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait).
269
- * No other CPU idle time is taken into consideration.
270
- */
271
- eventLoopUtilization: EventLoopUtilityFunction;
272
- /**
273
- * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`.
274
- * If you are only interested in performance entries of certain types or that have certain names, see
275
- * `performance.getEntriesByType()` and `performance.getEntriesByName()`.
276
- * @since v16.7.0
277
- */
278
- getEntries(): PerformanceEntry[];
279
- /**
280
- * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
281
- * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`.
282
- * @param name
283
- * @param type
284
- * @since v16.7.0
285
- */
286
- getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
287
- /**
288
- * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
289
- * whose `performanceEntry.entryType` is equal to `type`.
290
- * @param type
291
- * @since v16.7.0
292
- */
293
- getEntriesByType(type: EntryType): PerformanceEntry[];
294
- /**
295
- * Creates a new `PerformanceMark` entry in the Performance Timeline.
296
- * A `PerformanceMark` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'mark'`,
297
- * and whose `performanceEntry.duration` is always `0`.
298
- * Performance marks are used to mark specific significant moments in the Performance Timeline.
299
- *
300
- * The created `PerformanceMark` entry is put in the global Performance Timeline and can be queried with
301
- * `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is
302
- * performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMarks`.
303
- * @param name
304
- */
305
- mark(name: string, options?: MarkOptions): PerformanceMark;
306
- /**
307
- * Creates a new `PerformanceResourceTiming` entry in the Resource Timeline.
308
- * A `PerformanceResourceTiming` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'resource'`.
309
- * Performance resources are used to mark moments in the Resource Timeline.
310
- * @param timingInfo [Fetch Timing Info](https://fetch.spec.whatwg.org/#fetch-timing-info)
311
- * @param requestedUrl The resource url
312
- * @param initiatorType The initiator name, e.g: 'fetch'
313
- * @param global
314
- * @param cacheMode The cache mode must be an empty string ('') or 'local'
315
- * @param bodyInfo [Fetch Response Body Info](https://fetch.spec.whatwg.org/#response-body-info)
316
- * @param responseStatus The response's status code
317
- * @param deliveryType The delivery type. Default: ''.
318
- * @since v18.2.0, v16.17.0
319
- */
320
- markResourceTiming(
321
- timingInfo: object,
322
- requestedUrl: string,
323
- initiatorType: string,
324
- global: object,
325
- cacheMode: "" | "local",
326
- bodyInfo: object,
327
- responseStatus: number,
328
- deliveryType?: string,
329
- ): PerformanceResourceTiming;
330
- /**
331
- * Creates a new PerformanceMeasure entry in the Performance Timeline.
332
- * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
333
- * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark.
334
- *
335
- * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify
336
- * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist,
337
- * then startMark is set to timeOrigin by default.
338
- *
339
- * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp
340
- * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown.
341
- * @param name
342
- * @param startMark
343
- * @param endMark
344
- * @return The PerformanceMeasure entry that was created
345
- */
346
- measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure;
347
- measure(name: string, options: MeasureOptions): PerformanceMeasure;
348
- /**
349
- * _This property is an extension by Node.js. It is not available in Web browsers._
350
- *
351
- * An instance of the `PerformanceNodeTiming` class that provides performance metrics for specific Node.js operational milestones.
352
- * @since v8.5.0
353
- */
354
- readonly nodeTiming: PerformanceNodeTiming;
355
- /**
356
- * Returns the current high resolution millisecond timestamp, where 0 represents the start of the current `node` process.
357
- * @since v8.5.0
358
- */
359
- now(): number;
360
- /**
361
- * Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects.
362
- *
363
- * By default the max buffer size is set to 250.
364
- * @since v18.8.0
365
- */
366
- setResourceTimingBufferSize(maxSize: number): void;
367
- /**
368
- * The [`timeOrigin`](https://w3c.github.io/hr-time/#dom-performance-timeorigin) specifies the high resolution millisecond timestamp
369
- * at which the current `node` process began, measured in Unix time.
370
- * @since v8.5.0
371
- */
372
- readonly timeOrigin: number;
373
- /**
374
- * _This property is an extension by Node.js. It is not available in Web browsers._
375
- *
376
- * Wraps a function within a new function that measures the running time of the wrapped function.
377
- * A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed.
378
- *
379
- * ```js
380
- * import {
381
- * performance,
382
- * PerformanceObserver,
383
- * } from 'node:perf_hooks';
384
- *
385
- * function someFunction() {
386
- * console.log('hello world');
387
- * }
388
- *
389
- * const wrapped = performance.timerify(someFunction);
390
- *
391
- * const obs = new PerformanceObserver((list) => {
392
- * console.log(list.getEntries()[0].duration);
393
- *
394
- * performance.clearMarks();
395
- * performance.clearMeasures();
396
- * obs.disconnect();
397
- * });
398
- * obs.observe({ entryTypes: ['function'] });
399
- *
400
- * // A performance timeline entry will be created
401
- * wrapped();
402
- * ```
403
- *
404
- * If the wrapped function returns a promise, a finally handler will be attached to the promise and the duration will be reported
405
- * once the finally handler is invoked.
406
- * @param fn
407
- */
408
- timerify<T extends (...params: any[]) => any>(fn: T, options?: TimerifyOptions): T;
409
- /**
410
- * An object which is JSON representation of the performance object. It is similar to
411
- * [`window.performance.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON) in browsers.
412
- * @since v16.1.0
413
- */
414
- toJSON(): any;
415
- }
416
- class PerformanceObserverEntryList {
417
- /**
418
- * Returns a list of `PerformanceEntry` objects in chronological order
419
- * with respect to `performanceEntry.startTime`.
420
- *
421
- * ```js
422
- * import {
423
- * performance,
424
- * PerformanceObserver,
425
- * } from 'node:perf_hooks';
426
- *
427
- * const obs = new PerformanceObserver((perfObserverList, observer) => {
428
- * console.log(perfObserverList.getEntries());
429
- *
430
- * * [
431
- * * PerformanceEntry {
432
- * * name: 'test',
433
- * * entryType: 'mark',
434
- * * startTime: 81.465639,
435
- * * duration: 0,
436
- * * detail: null
437
- * * },
438
- * * PerformanceEntry {
439
- * * name: 'meow',
440
- * * entryType: 'mark',
441
- * * startTime: 81.860064,
442
- * * duration: 0,
443
- * * detail: null
444
- * * }
445
- * * ]
446
- *
447
- * performance.clearMarks();
448
- * performance.clearMeasures();
449
- * observer.disconnect();
450
- * });
451
- * obs.observe({ type: 'mark' });
452
- *
453
- * performance.mark('test');
454
- * performance.mark('meow');
455
- * ```
456
- * @since v8.5.0
457
- */
458
- getEntries(): PerformanceEntry[];
459
- /**
460
- * Returns a list of `PerformanceEntry` objects in chronological order
461
- * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
462
- * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`.
463
- *
464
- * ```js
465
- * import {
466
- * performance,
467
- * PerformanceObserver,
468
- * } from 'node:perf_hooks';
469
- *
470
- * const obs = new PerformanceObserver((perfObserverList, observer) => {
471
- * console.log(perfObserverList.getEntriesByName('meow'));
472
- *
473
- * * [
474
- * * PerformanceEntry {
475
- * * name: 'meow',
476
- * * entryType: 'mark',
477
- * * startTime: 98.545991,
478
- * * duration: 0,
479
- * * detail: null
480
- * * }
481
- * * ]
482
- *
483
- * console.log(perfObserverList.getEntriesByName('nope')); // []
484
- *
485
- * console.log(perfObserverList.getEntriesByName('test', 'mark'));
486
- *
487
- * * [
488
- * * PerformanceEntry {
489
- * * name: 'test',
490
- * * entryType: 'mark',
491
- * * startTime: 63.518931,
492
- * * duration: 0,
493
- * * detail: null
494
- * * }
495
- * * ]
496
- *
497
- * console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
498
- *
499
- * performance.clearMarks();
500
- * performance.clearMeasures();
501
- * observer.disconnect();
502
- * });
503
- * obs.observe({ entryTypes: ['mark', 'measure'] });
504
- *
505
- * performance.mark('test');
506
- * performance.mark('meow');
507
- * ```
508
- * @since v8.5.0
509
- */
510
- getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
511
- /**
512
- * Returns a list of `PerformanceEntry` objects in chronological order
513
- * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType` is equal to `type`.
514
- *
515
- * ```js
516
- * import {
517
- * performance,
518
- * PerformanceObserver,
519
- * } from 'node:perf_hooks';
520
- *
521
- * const obs = new PerformanceObserver((perfObserverList, observer) => {
522
- * console.log(perfObserverList.getEntriesByType('mark'));
523
- *
524
- * * [
525
- * * PerformanceEntry {
526
- * * name: 'test',
527
- * * entryType: 'mark',
528
- * * startTime: 55.897834,
529
- * * duration: 0,
530
- * * detail: null
531
- * * },
532
- * * PerformanceEntry {
533
- * * name: 'meow',
534
- * * entryType: 'mark',
535
- * * startTime: 56.350146,
536
- * * duration: 0,
537
- * * detail: null
538
- * * }
539
- * * ]
540
- *
541
- * performance.clearMarks();
542
- * performance.clearMeasures();
543
- * observer.disconnect();
544
- * });
545
- * obs.observe({ type: 'mark' });
546
- *
547
- * performance.mark('test');
548
- * performance.mark('meow');
549
- * ```
550
- * @since v8.5.0
551
- */
552
- getEntriesByType(type: EntryType): PerformanceEntry[];
553
- }
554
- type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
555
- /**
556
- * @since v8.5.0
557
- */
558
- class PerformanceObserver extends AsyncResource {
559
- constructor(callback: PerformanceObserverCallback);
560
- /**
561
- * Disconnects the `PerformanceObserver` instance from all notifications.
562
- * @since v8.5.0
563
- */
564
- disconnect(): void;
565
- /**
566
- * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes` or `options.type`:
567
- *
568
- * ```js
569
- * import {
570
- * performance,
571
- * PerformanceObserver,
572
- * } from 'node:perf_hooks';
573
- *
574
- * const obs = new PerformanceObserver((list, observer) => {
575
- * // Called once asynchronously. `list` contains three items.
576
- * });
577
- * obs.observe({ type: 'mark' });
578
- *
579
- * for (let n = 0; n < 3; n++)
580
- * performance.mark(`test${n}`);
581
- * ```
582
- * @since v8.5.0
583
- */
584
- observe(
585
- options:
586
- | {
587
- entryTypes: readonly EntryType[];
588
- buffered?: boolean | undefined;
589
- }
590
- | {
591
- type: EntryType;
592
- buffered?: boolean | undefined;
593
- },
594
- ): void;
595
- /**
596
- * @since v16.0.0
597
- * @returns Current list of entries stored in the performance observer, emptying it out.
598
- */
599
- takeRecords(): PerformanceEntry[];
600
- }
601
- /**
602
- * Provides detailed network timing data regarding the loading of an application's resources.
603
- *
604
- * The constructor of this class is not exposed to users directly.
605
- * @since v18.2.0, v16.17.0
606
- */
607
- class PerformanceResourceTiming extends PerformanceEntry {
608
- readonly entryType: "resource";
609
- protected constructor();
610
- /**
611
- * The high resolution millisecond timestamp at immediately before dispatching the `fetch`
612
- * request. If the resource is not intercepted by a worker the property will always return 0.
613
- * @since v18.2.0, v16.17.0
614
- */
615
- readonly workerStart: number;
616
- /**
617
- * The high resolution millisecond timestamp that represents the start time of the fetch which
618
- * initiates the redirect.
619
- * @since v18.2.0, v16.17.0
620
- */
621
- readonly redirectStart: number;
622
- /**
623
- * The high resolution millisecond timestamp that will be created immediately after receiving
624
- * the last byte of the response of the last redirect.
625
- * @since v18.2.0, v16.17.0
626
- */
627
- readonly redirectEnd: number;
628
- /**
629
- * The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource.
630
- * @since v18.2.0, v16.17.0
631
- */
632
- readonly fetchStart: number;
633
- /**
634
- * The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup
635
- * for the resource.
636
- * @since v18.2.0, v16.17.0
637
- */
638
- readonly domainLookupStart: number;
639
- /**
640
- * The high resolution millisecond timestamp representing the time immediately after the Node.js finished
641
- * the domain name lookup for the resource.
642
- * @since v18.2.0, v16.17.0
643
- */
644
- readonly domainLookupEnd: number;
645
- /**
646
- * The high resolution millisecond timestamp representing the time immediately before Node.js starts to
647
- * establish the connection to the server to retrieve the resource.
648
- * @since v18.2.0, v16.17.0
649
- */
650
- readonly connectStart: number;
651
- /**
652
- * The high resolution millisecond timestamp representing the time immediately after Node.js finishes
653
- * establishing the connection to the server to retrieve the resource.
654
- * @since v18.2.0, v16.17.0
655
- */
656
- readonly connectEnd: number;
657
- /**
658
- * The high resolution millisecond timestamp representing the time immediately before Node.js starts the
659
- * handshake process to secure the current connection.
660
- * @since v18.2.0, v16.17.0
661
- */
662
- readonly secureConnectionStart: number;
663
- /**
664
- * The high resolution millisecond timestamp representing the time immediately before Node.js receives the
665
- * first byte of the response from the server.
666
- * @since v18.2.0, v16.17.0
667
- */
668
- readonly requestStart: number;
669
- /**
670
- * The high resolution millisecond timestamp representing the time immediately after Node.js receives the
671
- * last byte of the resource or immediately before the transport connection is closed, whichever comes first.
672
- * @since v18.2.0, v16.17.0
673
- */
674
- readonly responseEnd: number;
675
- /**
676
- * A number representing the size (in octets) of the fetched resource. The size includes the response header
677
- * fields plus the response payload body.
678
- * @since v18.2.0, v16.17.0
679
- */
680
- readonly transferSize: number;
681
- /**
682
- * A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before
683
- * removing any applied content-codings.
684
- * @since v18.2.0, v16.17.0
685
- */
686
- readonly encodedBodySize: number;
687
- /**
688
- * A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after
689
- * removing any applied content-codings.
690
- * @since v18.2.0, v16.17.0
691
- */
692
- readonly decodedBodySize: number;
693
- /**
694
- * Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object
695
- * @since v18.2.0, v16.17.0
696
- */
697
- toJSON(): any;
698
- }
699
413
  namespace constants {
700
414
  const NODE_PERFORMANCE_GC_MAJOR: number;
701
415
  const NODE_PERFORMANCE_GC_MINOR: number;
@@ -709,7 +423,6 @@ declare module "perf_hooks" {
709
423
  const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
710
424
  const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
711
425
  }
712
- const performance: Performance;
713
426
  interface EventLoopMonitorOptions {
714
427
  /**
715
428
  * The sampling rate in milliseconds.
@@ -895,88 +608,14 @@ declare module "perf_hooks" {
895
608
  * @since v15.9.0, v14.18.0
896
609
  */
897
610
  function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
898
- import {
899
- performance as _performance,
900
- PerformanceEntry as _PerformanceEntry,
901
- PerformanceMark as _PerformanceMark,
902
- PerformanceMeasure as _PerformanceMeasure,
903
- PerformanceObserver as _PerformanceObserver,
904
- PerformanceObserverEntryList as _PerformanceObserverEntryList,
905
- PerformanceResourceTiming as _PerformanceResourceTiming,
906
- } from "perf_hooks";
907
- global {
908
- /**
909
- * `PerformanceEntry` is a global reference for `import { PerformanceEntry } from 'node:perf_hooks'`
910
- * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceentry
911
- * @since v19.0.0
912
- */
913
- var PerformanceEntry: typeof globalThis extends {
914
- onmessage: any;
915
- PerformanceEntry: infer T;
916
- } ? T
917
- : typeof _PerformanceEntry;
918
- /**
919
- * `PerformanceMark` is a global reference for `import { PerformanceMark } from 'node:perf_hooks'`
920
- * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performancemark
921
- * @since v19.0.0
922
- */
923
- var PerformanceMark: typeof globalThis extends {
924
- onmessage: any;
925
- PerformanceMark: infer T;
926
- } ? T
927
- : typeof _PerformanceMark;
928
- /**
929
- * `PerformanceMeasure` is a global reference for `import { PerformanceMeasure } from 'node:perf_hooks'`
930
- * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performancemeasure
931
- * @since v19.0.0
932
- */
933
- var PerformanceMeasure: typeof globalThis extends {
934
- onmessage: any;
935
- PerformanceMeasure: infer T;
936
- } ? T
937
- : typeof _PerformanceMeasure;
938
- /**
939
- * `PerformanceObserver` is a global reference for `import { PerformanceObserver } from 'node:perf_hooks'`
940
- * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceobserver
941
- * @since v19.0.0
942
- */
943
- var PerformanceObserver: typeof globalThis extends {
944
- onmessage: any;
945
- PerformanceObserver: infer T;
946
- } ? T
947
- : typeof _PerformanceObserver;
948
- /**
949
- * `PerformanceObserverEntryList` is a global reference for `import { PerformanceObserverEntryList } from 'node:perf_hooks'`
950
- * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceobserverentrylist
951
- * @since v19.0.0
952
- */
953
- var PerformanceObserverEntryList: typeof globalThis extends {
954
- onmessage: any;
955
- PerformanceObserverEntryList: infer T;
956
- } ? T
957
- : typeof _PerformanceObserverEntryList;
958
- /**
959
- * `PerformanceResourceTiming` is a global reference for `import { PerformanceResourceTiming } from 'node:perf_hooks'`
960
- * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performanceresourcetiming
961
- * @since v19.0.0
962
- */
963
- var PerformanceResourceTiming: typeof globalThis extends {
964
- onmessage: any;
965
- PerformanceResourceTiming: infer T;
966
- } ? T
967
- : typeof _PerformanceResourceTiming;
968
- /**
969
- * `performance` is a global reference for `import { performance } from 'node:perf_hooks'`
970
- * @see https://nodejs.org/docs/latest-v24.x/api/globals.html#performance
971
- * @since v16.0.0
972
- */
973
- var performance: typeof globalThis extends {
974
- onmessage: any;
975
- performance: infer T;
976
- } ? T
977
- : typeof _performance;
978
- }
611
+ // TODO: remove these in a future major
612
+ /** @deprecated Use the canonical `PerformanceMarkOptions` instead. */
613
+ interface MarkOptions extends PerformanceMarkOptions {}
614
+ /** @deprecated Use the canonical `PerformanceMeasureOptions` instead. */
615
+ interface MeasureOptions extends PerformanceMeasureOptions {}
616
+ /** @deprecated Use `PerformanceTimerifyOptions` instead. */
617
+ interface TimerifyOptions extends PerformanceTimerifyOptions {}
979
618
  }
980
- declare module "node:perf_hooks" {
981
- export * from "perf_hooks";
619
+ declare module "perf_hooks" {
620
+ export * from "node:perf_hooks";
982
621
  }