omegon 0.8.4 → 0.9.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 (138) hide show
  1. package/extensions/cleave/dispatcher.ts +213 -20
  2. package/extensions/cleave/rpc-child.ts +269 -0
  3. package/extensions/cleave/types.ts +52 -0
  4. package/node_modules/@types/node/README.md +3 -3
  5. package/node_modules/@types/node/assert/strict.d.ts +11 -5
  6. package/node_modules/@types/node/assert.d.ts +173 -50
  7. package/node_modules/@types/node/async_hooks.d.ts +8 -28
  8. package/node_modules/@types/node/buffer.buffer.d.ts +7 -1
  9. package/node_modules/@types/node/buffer.d.ts +168 -44
  10. package/node_modules/@types/node/child_process.d.ts +70 -27
  11. package/node_modules/@types/node/cluster.d.ts +332 -240
  12. package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
  13. package/node_modules/@types/node/compatibility/index.d.ts +9 -0
  14. package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  15. package/node_modules/@types/node/compatibility/iterators.d.ts +0 -1
  16. package/node_modules/@types/node/console.d.ts +350 -49
  17. package/node_modules/@types/node/constants.d.ts +4 -3
  18. package/node_modules/@types/node/crypto.d.ts +1110 -630
  19. package/node_modules/@types/node/dgram.d.ts +51 -15
  20. package/node_modules/@types/node/diagnostics_channel.d.ts +6 -4
  21. package/node_modules/@types/node/dns/promises.d.ts +4 -4
  22. package/node_modules/@types/node/dns.d.ts +133 -132
  23. package/node_modules/@types/node/domain.d.ts +17 -13
  24. package/node_modules/@types/node/events.d.ts +663 -734
  25. package/node_modules/@types/node/fs/promises.d.ts +9 -43
  26. package/node_modules/@types/node/fs.d.ts +411 -628
  27. package/node_modules/@types/node/globals.d.ts +30 -8
  28. package/node_modules/@types/node/globals.typedarray.d.ts +0 -63
  29. package/node_modules/@types/node/http.d.ts +265 -364
  30. package/node_modules/@types/node/http2.d.ts +715 -551
  31. package/node_modules/@types/node/https.d.ts +239 -65
  32. package/node_modules/@types/node/index.d.ts +6 -24
  33. package/node_modules/@types/node/inspector.d.ts +53 -69
  34. package/node_modules/@types/node/inspector.generated.d.ts +410 -759
  35. package/node_modules/@types/node/module.d.ts +186 -52
  36. package/node_modules/@types/node/net.d.ts +194 -70
  37. package/node_modules/@types/node/os.d.ts +11 -12
  38. package/node_modules/@types/node/package.json +3 -13
  39. package/node_modules/@types/node/path.d.ts +133 -120
  40. package/node_modules/@types/node/perf_hooks.d.ts +643 -318
  41. package/node_modules/@types/node/process.d.ts +132 -223
  42. package/node_modules/@types/node/punycode.d.ts +5 -5
  43. package/node_modules/@types/node/querystring.d.ts +4 -4
  44. package/node_modules/@types/node/readline/promises.d.ts +3 -3
  45. package/node_modules/@types/node/readline.d.ts +120 -68
  46. package/node_modules/@types/node/repl.d.ts +100 -87
  47. package/node_modules/@types/node/sea.d.ts +1 -10
  48. package/node_modules/@types/node/sqlite.d.ts +19 -363
  49. package/node_modules/@types/node/stream/consumers.d.ts +10 -10
  50. package/node_modules/@types/node/stream/promises.d.ts +15 -136
  51. package/node_modules/@types/node/stream/web.d.ts +502 -176
  52. package/node_modules/@types/node/stream.d.ts +475 -581
  53. package/node_modules/@types/node/string_decoder.d.ts +4 -4
  54. package/node_modules/@types/node/test.d.ts +196 -308
  55. package/node_modules/@types/node/timers/promises.d.ts +4 -4
  56. package/node_modules/@types/node/timers.d.ts +132 -4
  57. package/node_modules/@types/node/tls.d.ts +226 -110
  58. package/node_modules/@types/node/trace_events.d.ts +9 -9
  59. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +7 -1
  60. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +0 -2
  61. package/node_modules/@types/node/ts5.6/index.d.ts +6 -26
  62. package/node_modules/@types/node/tty.d.ts +16 -58
  63. package/node_modules/@types/node/url.d.ts +573 -130
  64. package/node_modules/@types/node/util.d.ts +1100 -181
  65. package/node_modules/@types/node/v8.d.ts +8 -76
  66. package/node_modules/@types/node/vm.d.ts +72 -280
  67. package/node_modules/@types/node/wasi.d.ts +4 -25
  68. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +2 -27
  69. package/node_modules/@types/node/web-globals/events.d.ts +0 -9
  70. package/node_modules/@types/node/web-globals/fetch.d.ts +0 -14
  71. package/node_modules/@types/node/web-globals/navigator.d.ts +0 -3
  72. package/node_modules/@types/node/worker_threads.d.ts +335 -268
  73. package/node_modules/@types/node/zlib.d.ts +74 -9
  74. package/node_modules/undici-types/agent.d.ts +12 -13
  75. package/node_modules/undici-types/api.d.ts +26 -26
  76. package/node_modules/undici-types/balanced-pool.d.ts +12 -13
  77. package/node_modules/undici-types/client.d.ts +19 -19
  78. package/node_modules/undici-types/connector.d.ts +2 -2
  79. package/node_modules/undici-types/cookies.d.ts +0 -2
  80. package/node_modules/undici-types/diagnostics-channel.d.ts +10 -18
  81. package/node_modules/undici-types/dispatcher.d.ts +103 -123
  82. package/node_modules/undici-types/env-http-proxy-agent.d.ts +3 -4
  83. package/node_modules/undici-types/errors.d.ts +54 -66
  84. package/node_modules/undici-types/eventsource.d.ts +4 -9
  85. package/node_modules/undici-types/fetch.d.ts +20 -22
  86. package/node_modules/undici-types/file.d.ts +39 -0
  87. package/node_modules/undici-types/filereader.d.ts +54 -0
  88. package/node_modules/undici-types/formdata.d.ts +7 -7
  89. package/node_modules/undici-types/global-dispatcher.d.ts +4 -4
  90. package/node_modules/undici-types/global-origin.d.ts +5 -5
  91. package/node_modules/undici-types/handlers.d.ts +8 -8
  92. package/node_modules/undici-types/header.d.ts +1 -157
  93. package/node_modules/undici-types/index.d.ts +47 -64
  94. package/node_modules/undici-types/interceptors.d.ts +8 -64
  95. package/node_modules/undici-types/mock-agent.d.ts +18 -36
  96. package/node_modules/undici-types/mock-client.d.ts +4 -6
  97. package/node_modules/undici-types/mock-errors.d.ts +3 -3
  98. package/node_modules/undici-types/mock-interceptor.d.ts +20 -21
  99. package/node_modules/undici-types/mock-pool.d.ts +4 -6
  100. package/node_modules/undici-types/package.json +1 -1
  101. package/node_modules/undici-types/patch.d.ts +4 -0
  102. package/node_modules/undici-types/pool-stats.d.ts +8 -8
  103. package/node_modules/undici-types/pool.d.ts +13 -15
  104. package/node_modules/undici-types/proxy-agent.d.ts +4 -5
  105. package/node_modules/undici-types/readable.d.ts +16 -19
  106. package/node_modules/undici-types/retry-agent.d.ts +1 -1
  107. package/node_modules/undici-types/retry-handler.d.ts +10 -19
  108. package/node_modules/undici-types/util.d.ts +3 -3
  109. package/node_modules/undici-types/webidl.d.ts +29 -142
  110. package/node_modules/undici-types/websocket.d.ts +10 -46
  111. package/package.json +2 -1
  112. package/skills/cleave/SKILL.md +62 -2
  113. package/node_modules/@types/node/inspector/promises.d.ts +0 -41
  114. package/node_modules/@types/node/path/posix.d.ts +0 -8
  115. package/node_modules/@types/node/path/win32.d.ts +0 -8
  116. package/node_modules/@types/node/quic.d.ts +0 -910
  117. package/node_modules/@types/node/test/reporters.d.ts +0 -96
  118. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +0 -71
  119. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +0 -72
  120. package/node_modules/@types/node/ts5.7/index.d.ts +0 -117
  121. package/node_modules/@types/node/util/types.d.ts +0 -558
  122. package/node_modules/@types/node/web-globals/blob.d.ts +0 -23
  123. package/node_modules/@types/node/web-globals/console.d.ts +0 -9
  124. package/node_modules/@types/node/web-globals/crypto.d.ts +0 -39
  125. package/node_modules/@types/node/web-globals/encoding.d.ts +0 -11
  126. package/node_modules/@types/node/web-globals/importmeta.d.ts +0 -13
  127. package/node_modules/@types/node/web-globals/messaging.d.ts +0 -23
  128. package/node_modules/@types/node/web-globals/performance.d.ts +0 -45
  129. package/node_modules/@types/node/web-globals/streams.d.ts +0 -115
  130. package/node_modules/@types/node/web-globals/timers.d.ts +0 -44
  131. package/node_modules/@types/node/web-globals/url.d.ts +0 -24
  132. package/node_modules/undici-types/cache-interceptor.d.ts +0 -173
  133. package/node_modules/undici-types/client-stats.d.ts +0 -15
  134. package/node_modules/undici-types/h2c-client.d.ts +0 -73
  135. package/node_modules/undici-types/mock-call-history.d.ts +0 -111
  136. package/node_modules/undici-types/round-robin-pool.d.ts +0 -41
  137. package/node_modules/undici-types/snapshot-agent.d.ts +0 -109
  138. package/node_modules/undici-types/utility.d.ts +0 -7
@@ -27,11 +27,10 @@
27
27
  * performance.measure('A to B', 'A', 'B');
28
28
  * });
29
29
  * ```
30
- * @see [source](https://github.com/nodejs/node/blob/v25.x/lib/perf_hooks.js)
30
+ * @see [source](https://github.com/nodejs/node/blob/v22.x/lib/perf_hooks.js)
31
31
  */
32
- declare module "node:perf_hooks" {
33
- import { InternalEventTargetEventProperties } from "node:events";
34
- // #region web types
32
+ declare module "perf_hooks" {
33
+ import { AsyncResource } from "node:async_hooks";
35
34
  type EntryType =
36
35
  | "dns" // Node.js only
37
36
  | "function" // Node.js only
@@ -43,212 +42,76 @@ declare module "node:perf_hooks" {
43
42
  | "net" // Node.js only
44
43
  | "node" // Node.js only
45
44
  | "resource"; // available on the Web
46
- interface ConnectionTimingInfo {
47
- domainLookupStartTime: number;
48
- domainLookupEndTime: number;
49
- connectionStartTime: number;
50
- connectionEndTime: number;
51
- secureConnectionStartTime: number;
52
- ALPNNegotiatedProtocol: string;
53
- }
54
- interface FetchTimingInfo {
55
- startTime: number;
56
- redirectStartTime: number;
57
- redirectEndTime: number;
58
- postRedirectStartTime: number;
59
- finalServiceWorkerStartTime: number;
60
- finalNetworkRequestStartTime: number;
61
- finalNetworkResponseStartTime: number;
62
- endTime: number;
63
- finalConnectionTimingInfo: ConnectionTimingInfo | null;
64
- encodedBodySize: number;
65
- decodedBodySize: number;
66
- }
67
- type PerformanceEntryList = PerformanceEntry[];
68
- interface PerformanceMarkOptions {
69
- detail?: any;
70
- startTime?: number;
71
- }
72
- interface PerformanceMeasureOptions {
73
- detail?: any;
74
- duration?: number;
75
- end?: string | number;
76
- start?: string | number;
77
- }
78
- interface PerformanceObserverCallback {
79
- (entries: PerformanceObserverEntryList, observer: PerformanceObserver): void;
80
- }
81
- interface PerformanceObserverInit {
82
- buffered?: boolean;
83
- entryTypes?: EntryType[];
84
- type?: EntryType;
85
- }
86
- // TODO: remove in next major
87
- /** @deprecated Use `TimerifyOptions` instead. */
88
- interface PerformanceTimerifyOptions extends TimerifyOptions {}
89
- interface PerformanceEventMap {
90
- "resourcetimingbufferfull": Event;
91
- }
92
- interface Performance extends EventTarget, InternalEventTargetEventProperties<PerformanceEventMap> {
93
- readonly nodeTiming: PerformanceNodeTiming;
94
- readonly timeOrigin: number;
95
- clearMarks(markName?: string): void;
96
- clearMeasures(measureName?: string): void;
97
- clearResourceTimings(resourceTimingName?: string): void;
98
- getEntries(): PerformanceEntryList;
99
- getEntriesByName(name: string, type?: EntryType): PerformanceEntryList;
100
- getEntriesByType(type: EntryType): PerformanceEntryList;
101
- mark(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
102
- markResourceTiming(
103
- timingInfo: FetchTimingInfo,
104
- requestedUrl: string,
105
- initiatorType: string,
106
- global: unknown,
107
- cacheMode: string,
108
- bodyInfo: unknown,
109
- responseStatus: number,
110
- deliveryType?: string,
111
- ): PerformanceResourceTiming;
112
- measure(measureName: string, startMark?: string, endMark?: string): PerformanceMeasure;
113
- measure(measureName: string, options: PerformanceMeasureOptions, endMark?: string): PerformanceMeasure;
114
- now(): number;
115
- setResourceTimingBufferSize(maxSize: number): void;
116
- toJSON(): any;
117
- addEventListener<K extends keyof PerformanceEventMap>(
118
- type: K,
119
- listener: (ev: PerformanceEventMap[K]) => void,
120
- options?: AddEventListenerOptions | boolean,
121
- ): void;
122
- addEventListener(
123
- type: string,
124
- listener: EventListener | EventListenerObject,
125
- options?: AddEventListenerOptions | boolean,
126
- ): void;
127
- removeEventListener<K extends keyof PerformanceEventMap>(
128
- type: K,
129
- listener: (ev: PerformanceEventMap[K]) => void,
130
- options?: EventListenerOptions | boolean,
131
- ): void;
132
- removeEventListener(
133
- type: string,
134
- listener: EventListener | EventListenerObject,
135
- options?: EventListenerOptions | boolean,
136
- ): void;
45
+ interface NodeGCPerformanceDetail {
137
46
  /**
138
- * This is an alias of `perf_hooks.eventLoopUtilization()`.
139
- *
140
- * _This property is an extension by Node.js. It is not available in Web browsers._
141
- * @since v14.10.0, v12.19.0
142
- * @param utilization1 The result of a previous call to
143
- * `eventLoopUtilization()`.
144
- * @param utilization2 The result of a previous call to
145
- * `eventLoopUtilization()` prior to `utilization1`.
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.
146
50
  */
147
- eventLoopUtilization(
148
- utilization1?: EventLoopUtilization,
149
- utilization2?: EventLoopUtilization,
150
- ): EventLoopUtilization;
51
+ readonly kind: number;
151
52
  /**
152
- * This is an alias of `perf_hooks.timerify()`.
153
- *
154
- * _This property is an extension by Node.js. It is not available in Web browsers._
155
- * @since v8.5.0
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.
156
56
  */
157
- timerify<T extends (...args: any[]) => any>(fn: T, options?: TimerifyOptions): T;
57
+ readonly flags: number;
158
58
  }
159
- var Performance: {
160
- prototype: Performance;
161
- new(): Performance;
162
- };
163
- interface PerformanceEntry {
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
+ */
164
70
  readonly duration: number;
165
- readonly entryType: EntryType;
71
+ /**
72
+ * The name of the performance entry.
73
+ * @since v8.5.0
74
+ */
166
75
  readonly name: string;
76
+ /**
77
+ * The high resolution millisecond timestamp marking the starting time of the
78
+ * Performance Entry.
79
+ * @since v8.5.0
80
+ */
167
81
  readonly startTime: number;
82
+ /**
83
+ * The type of the performance entry. It may be one of:
84
+ *
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)
92
+ * @since v8.5.0
93
+ */
94
+ readonly entryType: EntryType;
168
95
  toJSON(): any;
169
96
  }
170
- var PerformanceEntry: {
171
- prototype: PerformanceEntry;
172
- new(): PerformanceEntry;
173
- };
174
- interface PerformanceMark extends PerformanceEntry {
97
+ /**
98
+ * Exposes marks created via the `Performance.mark()` method.
99
+ * @since v18.2.0, v16.17.0
100
+ */
101
+ class PerformanceMark extends PerformanceEntry {
175
102
  readonly detail: any;
103
+ readonly duration: 0;
176
104
  readonly entryType: "mark";
177
105
  }
178
- var PerformanceMark: {
179
- prototype: PerformanceMark;
180
- new(markName: string, markOptions?: PerformanceMarkOptions): PerformanceMark;
181
- };
182
- interface PerformanceMeasure extends PerformanceEntry {
183
- readonly detail: any;
184
- readonly entryType: "measure";
185
- }
186
- var PerformanceMeasure: {
187
- prototype: PerformanceMeasure;
188
- new(): PerformanceMeasure;
189
- };
190
- interface PerformanceObserver {
191
- disconnect(): void;
192
- observe(options: PerformanceObserverInit): void;
193
- takeRecords(): PerformanceEntryList;
194
- }
195
- var PerformanceObserver: {
196
- prototype: PerformanceObserver;
197
- new(callback: PerformanceObserverCallback): PerformanceObserver;
198
- readonly supportedEntryTypes: readonly EntryType[];
199
- };
200
- interface PerformanceObserverEntryList {
201
- getEntries(): PerformanceEntryList;
202
- getEntriesByName(name: string, type?: EntryType): PerformanceEntryList;
203
- getEntriesByType(type: EntryType): PerformanceEntryList;
204
- }
205
- var PerformanceObserverEntryList: {
206
- prototype: PerformanceObserverEntryList;
207
- new(): PerformanceObserverEntryList;
208
- };
209
- interface PerformanceResourceTiming extends PerformanceEntry {
210
- readonly connectEnd: number;
211
- readonly connectStart: number;
212
- readonly decodedBodySize: number;
213
- readonly domainLookupEnd: number;
214
- readonly domainLookupStart: number;
215
- readonly encodedBodySize: number;
216
- readonly entryType: "resource";
217
- readonly fetchStart: number;
218
- readonly initiatorType: string;
219
- readonly nextHopProtocol: string;
220
- readonly redirectEnd: number;
221
- readonly redirectStart: number;
222
- readonly requestStart: number;
223
- readonly responseEnd: number;
224
- readonly responseStart: number;
225
- readonly responseStatus: number;
226
- readonly secureConnectionStart: number;
227
- readonly transferSize: number;
228
- readonly workerStart: number;
229
- toJSON(): any;
230
- }
231
- var PerformanceResourceTiming: {
232
- prototype: PerformanceResourceTiming;
233
- new(): PerformanceResourceTiming;
234
- };
235
- var performance: Performance;
236
- // #endregion
237
106
  /**
238
- * _This class is an extension by Node.js. It is not available in Web browsers._
239
- *
240
- * Provides detailed Node.js timing data.
107
+ * Exposes measures created via the `Performance.measure()` method.
241
108
  *
242
109
  * The constructor of this class is not exposed to users directly.
243
- * @since v19.0.0
110
+ * @since v18.2.0, v16.17.0
244
111
  */
245
- class PerformanceNodeEntry extends PerformanceEntry {
246
- /**
247
- * Additional detail specific to the `entryType`.
248
- * @since v16.0.0
249
- */
112
+ class PerformanceMeasure extends PerformanceEntry {
250
113
  readonly detail: any;
251
- readonly entryType: "dns" | "function" | "gc" | "http2" | "http" | "net" | "node";
114
+ readonly entryType: "measure";
252
115
  }
253
116
  interface UVMetrics {
254
117
  /**
@@ -264,6 +127,7 @@ declare module "node:perf_hooks" {
264
127
  */
265
128
  readonly eventsWaiting: number;
266
129
  }
130
+ // TODO: PerformanceNodeEntry is missing
267
131
  /**
268
132
  * _This property is an extension by Node.js. It is not available in Web browsers._
269
133
  *
@@ -271,7 +135,8 @@ declare module "node:perf_hooks" {
271
135
  * is not exposed to users.
272
136
  * @since v8.5.0
273
137
  */
274
- interface PerformanceNodeTiming extends PerformanceEntry {
138
+ class PerformanceNodeTiming extends PerformanceEntry {
139
+ readonly entryType: "node";
275
140
  /**
276
141
  * The high resolution millisecond timestamp at which the Node.js process
277
142
  * completed bootstrapping. If bootstrapping has not yet finished, the property
@@ -279,7 +144,6 @@ declare module "node:perf_hooks" {
279
144
  * @since v8.5.0
280
145
  */
281
146
  readonly bootstrapComplete: number;
282
- readonly entryType: "node";
283
147
  /**
284
148
  * The high resolution millisecond timestamp at which the Node.js environment was
285
149
  * initialized.
@@ -331,6 +195,507 @@ declare module "node:perf_hooks" {
331
195
  */
332
196
  readonly v8Start: number;
333
197
  }
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
+ }
334
699
  namespace constants {
335
700
  const NODE_PERFORMANCE_GC_MAJOR: number;
336
701
  const NODE_PERFORMANCE_GC_MINOR: number;
@@ -344,6 +709,7 @@ declare module "node:perf_hooks" {
344
709
  const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
345
710
  const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
346
711
  }
712
+ const performance: Performance;
347
713
  interface EventLoopMonitorOptions {
348
714
  /**
349
715
  * The sampling rate in milliseconds.
@@ -445,20 +811,6 @@ declare module "node:perf_hooks" {
445
811
  * @since v11.10.0
446
812
  */
447
813
  disable(): boolean;
448
- /**
449
- * Disables the update interval timer when the histogram is disposed.
450
- *
451
- * ```js
452
- * const { monitorEventLoopDelay } = require('node:perf_hooks');
453
- * {
454
- * using hist = monitorEventLoopDelay({ resolution: 20 });
455
- * hist.enable();
456
- * // The histogram will be disabled when the block is exited.
457
- * }
458
- * ```
459
- * @since v24.2.0
460
- */
461
- [Symbol.dispose](): void;
462
814
  }
463
815
  interface RecordableHistogram extends Histogram {
464
816
  /**
@@ -478,66 +830,6 @@ declare module "node:perf_hooks" {
478
830
  */
479
831
  add(other: RecordableHistogram): void;
480
832
  }
481
- interface EventLoopUtilization {
482
- idle: number;
483
- active: number;
484
- utilization: number;
485
- }
486
- /**
487
- * The `eventLoopUtilization()` function returns an object that contains the
488
- * cumulative duration of time the event loop has been both idle and active as a
489
- * high resolution milliseconds timer. The `utilization` value is the calculated
490
- * Event Loop Utilization (ELU).
491
- *
492
- * If bootstrapping has not yet finished on the main thread the properties have
493
- * 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
494
- * bootstrap happens within the event loop.
495
- *
496
- * Both `utilization1` and `utilization2` are optional parameters.
497
- *
498
- * If `utilization1` is passed, then the delta between the current call's `active`
499
- * and `idle` times, as well as the corresponding `utilization` value are
500
- * calculated and returned (similar to `process.hrtime()`).
501
- *
502
- * If `utilization1` and `utilization2` are both passed, then the delta is
503
- * calculated between the two arguments. This is a convenience option because,
504
- * unlike `process.hrtime()`, calculating the ELU is more complex than a
505
- * single subtraction.
506
- *
507
- * ELU is similar to CPU utilization, except that it only measures event loop
508
- * statistics and not CPU usage. It represents the percentage of time the event
509
- * loop has spent outside the event loop's event provider (e.g. `epoll_wait`).
510
- * No other CPU idle time is taken into consideration. The following is an example
511
- * of how a mostly idle process will have a high ELU.
512
- *
513
- * ```js
514
- * import { eventLoopUtilization } from 'node:perf_hooks';
515
- * import { spawnSync } from 'node:child_process';
516
- *
517
- * setImmediate(() => {
518
- * const elu = eventLoopUtilization();
519
- * spawnSync('sleep', ['5']);
520
- * console.log(eventLoopUtilization(elu).utilization);
521
- * });
522
- * ```
523
- *
524
- * Although the CPU is mostly idle while running this script, the value of
525
- * `utilization` is `1`. This is because the call to
526
- * `child_process.spawnSync()` blocks the event loop from proceeding.
527
- *
528
- * Passing in a user-defined object instead of the result of a previous call to
529
- * `eventLoopUtilization()` will lead to undefined behavior. The return values
530
- * are not guaranteed to reflect any correct state of the event loop.
531
- * @since v25.2.0
532
- * @param utilization1 The result of a previous call to
533
- * `eventLoopUtilization()`.
534
- * @param utilization2 The result of a previous call to
535
- * `eventLoopUtilization()` prior to `utilization1`.
536
- */
537
- function eventLoopUtilization(
538
- utilization1?: EventLoopUtilization,
539
- utilization2?: EventLoopUtilization,
540
- ): EventLoopUtilization;
541
833
  /**
542
834
  * _This property is an extension by Node.js. It is not available in Web browsers._
543
835
  *
@@ -567,49 +859,6 @@ declare module "node:perf_hooks" {
567
859
  * @since v11.10.0
568
860
  */
569
861
  function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram;
570
- interface TimerifyOptions {
571
- /**
572
- * A histogram object created using
573
- * `perf_hooks.createHistogram()` that will record runtime durations in
574
- * nanoseconds.
575
- */
576
- histogram?: RecordableHistogram | undefined;
577
- }
578
- /**
579
- * _This property is an extension by Node.js. It is not available in Web browsers._
580
- *
581
- * Wraps a function within a new function that measures the running time of the
582
- * wrapped function. A `PerformanceObserver` must be subscribed to the `'function'`
583
- * event type in order for the timing details to be accessed.
584
- *
585
- * ```js
586
- * import { timerify, performance, PerformanceObserver } from 'node:perf_hooks';
587
- *
588
- * function someFunction() {
589
- * console.log('hello world');
590
- * }
591
- *
592
- * const wrapped = timerify(someFunction);
593
- *
594
- * const obs = new PerformanceObserver((list) => {
595
- * console.log(list.getEntries()[0].duration);
596
- *
597
- * performance.clearMarks();
598
- * performance.clearMeasures();
599
- * obs.disconnect();
600
- * });
601
- * obs.observe({ entryTypes: ['function'] });
602
- *
603
- * // A performance timeline entry will be created
604
- * wrapped();
605
- * ```
606
- *
607
- * If the wrapped function returns a promise, a finally handler will be attached
608
- * to the promise and the duration will be reported once the finally handler is
609
- * invoked.
610
- * @since v25.2.0
611
- */
612
- function timerify<T extends (...args: any[]) => any>(fn: T, options?: TimerifyOptions): T;
613
862
  interface CreateHistogramOptions {
614
863
  /**
615
864
  * The minimum recordable value. Must be an integer value greater than 0.
@@ -632,12 +881,88 @@ declare module "node:perf_hooks" {
632
881
  * @since v15.9.0, v14.18.0
633
882
  */
634
883
  function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
635
- // TODO: remove these in a future major
636
- /** @deprecated Use the canonical `PerformanceMarkOptions` instead. */
637
- interface MarkOptions extends PerformanceMarkOptions {}
638
- /** @deprecated Use the canonical `PerformanceMeasureOptions` instead. */
639
- interface MeasureOptions extends PerformanceMeasureOptions {}
884
+ import {
885
+ performance as _performance,
886
+ PerformanceEntry as _PerformanceEntry,
887
+ PerformanceMark as _PerformanceMark,
888
+ PerformanceMeasure as _PerformanceMeasure,
889
+ PerformanceObserver as _PerformanceObserver,
890
+ PerformanceObserverEntryList as _PerformanceObserverEntryList,
891
+ PerformanceResourceTiming as _PerformanceResourceTiming,
892
+ } from "perf_hooks";
893
+ global {
894
+ /**
895
+ * `PerformanceEntry` is a global reference for `import { PerformanceEntry } from 'node:perf_hooks'`
896
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceentry
897
+ * @since v19.0.0
898
+ */
899
+ var PerformanceEntry: typeof globalThis extends {
900
+ onmessage: any;
901
+ PerformanceEntry: infer T;
902
+ } ? T
903
+ : typeof _PerformanceEntry;
904
+ /**
905
+ * `PerformanceMark` is a global reference for `import { PerformanceMark } from 'node:perf_hooks'`
906
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performancemark
907
+ * @since v19.0.0
908
+ */
909
+ var PerformanceMark: typeof globalThis extends {
910
+ onmessage: any;
911
+ PerformanceMark: infer T;
912
+ } ? T
913
+ : typeof _PerformanceMark;
914
+ /**
915
+ * `PerformanceMeasure` is a global reference for `import { PerformanceMeasure } from 'node:perf_hooks'`
916
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performancemeasure
917
+ * @since v19.0.0
918
+ */
919
+ var PerformanceMeasure: typeof globalThis extends {
920
+ onmessage: any;
921
+ PerformanceMeasure: infer T;
922
+ } ? T
923
+ : typeof _PerformanceMeasure;
924
+ /**
925
+ * `PerformanceObserver` is a global reference for `import { PerformanceObserver } from 'node:perf_hooks'`
926
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceobserver
927
+ * @since v19.0.0
928
+ */
929
+ var PerformanceObserver: typeof globalThis extends {
930
+ onmessage: any;
931
+ PerformanceObserver: infer T;
932
+ } ? T
933
+ : typeof _PerformanceObserver;
934
+ /**
935
+ * `PerformanceObserverEntryList` is a global reference for `import { PerformanceObserverEntryList } from 'node:perf_hooks'`
936
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceobserverentrylist
937
+ * @since v19.0.0
938
+ */
939
+ var PerformanceObserverEntryList: typeof globalThis extends {
940
+ onmessage: any;
941
+ PerformanceObserverEntryList: infer T;
942
+ } ? T
943
+ : typeof _PerformanceObserverEntryList;
944
+ /**
945
+ * `PerformanceResourceTiming` is a global reference for `import { PerformanceResourceTiming } from 'node:perf_hooks'`
946
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performanceresourcetiming
947
+ * @since v19.0.0
948
+ */
949
+ var PerformanceResourceTiming: typeof globalThis extends {
950
+ onmessage: any;
951
+ PerformanceResourceTiming: infer T;
952
+ } ? T
953
+ : typeof _PerformanceResourceTiming;
954
+ /**
955
+ * `performance` is a global reference for `import { performance } from 'node:perf_hooks'`
956
+ * @see https://nodejs.org/docs/latest-v22.x/api/globals.html#performance
957
+ * @since v16.0.0
958
+ */
959
+ var performance: typeof globalThis extends {
960
+ onmessage: any;
961
+ performance: infer T;
962
+ } ? T
963
+ : typeof _performance;
964
+ }
640
965
  }
641
- declare module "perf_hooks" {
642
- export * from "node:perf_hooks";
966
+ declare module "node:perf_hooks" {
967
+ export * from "perf_hooks";
643
968
  }