@types/node 18.19.21 → 18.19.23

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 (56) hide show
  1. node v18.19/README.md +2 -2
  2. node v18.19/package.json +3 -15
  3. node v18.19/ts4.8/assert/strict.d.ts +0 -8
  4. node v18.19/ts4.8/assert.d.ts +0 -985
  5. node v18.19/ts4.8/async_hooks.d.ts +0 -522
  6. node v18.19/ts4.8/buffer.d.ts +0 -2353
  7. node v18.19/ts4.8/child_process.d.ts +0 -1544
  8. node v18.19/ts4.8/cluster.d.ts +0 -432
  9. node v18.19/ts4.8/console.d.ts +0 -412
  10. node v18.19/ts4.8/constants.d.ts +0 -19
  11. node v18.19/ts4.8/crypto.d.ts +0 -4457
  12. node v18.19/ts4.8/dgram.d.ts +0 -596
  13. node v18.19/ts4.8/diagnostics_channel.d.ts +0 -546
  14. node v18.19/ts4.8/dns/promises.d.ts +0 -381
  15. node v18.19/ts4.8/dns.d.ts +0 -809
  16. node v18.19/ts4.8/dom-events.d.ts +0 -122
  17. node v18.19/ts4.8/domain.d.ts +0 -170
  18. node v18.19/ts4.8/events.d.ts +0 -819
  19. node v18.19/ts4.8/fs/promises.d.ts +0 -1205
  20. node v18.19/ts4.8/fs.d.ts +0 -4231
  21. node v18.19/ts4.8/globals.d.ts +0 -377
  22. node v18.19/ts4.8/globals.global.d.ts +0 -1
  23. node v18.19/ts4.8/http.d.ts +0 -1803
  24. node v18.19/ts4.8/http2.d.ts +0 -2386
  25. node v18.19/ts4.8/https.d.ts +0 -544
  26. node v18.19/ts4.8/index.d.ts +0 -88
  27. node v18.19/ts4.8/inspector.d.ts +0 -2739
  28. node v18.19/ts4.8/module.d.ts +0 -298
  29. node v18.19/ts4.8/net.d.ts +0 -918
  30. node v18.19/ts4.8/os.d.ts +0 -473
  31. node v18.19/ts4.8/path.d.ts +0 -191
  32. node v18.19/ts4.8/perf_hooks.d.ts +0 -626
  33. node v18.19/ts4.8/process.d.ts +0 -1548
  34. node v18.19/ts4.8/punycode.d.ts +0 -117
  35. node v18.19/ts4.8/querystring.d.ts +0 -141
  36. node v18.19/ts4.8/readline/promises.d.ts +0 -143
  37. node v18.19/ts4.8/readline.d.ts +0 -666
  38. node v18.19/ts4.8/repl.d.ts +0 -430
  39. node v18.19/ts4.8/stream/consumers.d.ts +0 -12
  40. node v18.19/ts4.8/stream/promises.d.ts +0 -83
  41. node v18.19/ts4.8/stream/web.d.ts +0 -352
  42. node v18.19/ts4.8/stream.d.ts +0 -1731
  43. node v18.19/ts4.8/string_decoder.d.ts +0 -67
  44. node v18.19/ts4.8/test.d.ts +0 -1113
  45. node v18.19/ts4.8/timers/promises.d.ts +0 -93
  46. node v18.19/ts4.8/timers.d.ts +0 -126
  47. node v18.19/ts4.8/tls.d.ts +0 -1203
  48. node v18.19/ts4.8/trace_events.d.ts +0 -171
  49. node v18.19/ts4.8/tty.d.ts +0 -206
  50. node v18.19/ts4.8/url.d.ts +0 -954
  51. node v18.19/ts4.8/util.d.ts +0 -2075
  52. node v18.19/ts4.8/v8.d.ts +0 -753
  53. node v18.19/ts4.8/vm.d.ts +0 -667
  54. node v18.19/ts4.8/wasi.d.ts +0 -158
  55. node v18.19/ts4.8/worker_threads.d.ts +0 -692
  56. node v18.19/ts4.8/zlib.d.ts +0 -517
@@ -1,626 +0,0 @@
1
- /**
2
- * This module provides an implementation of a subset of the W3C [Web Performance APIs](https://w3c.github.io/perf-timing-primer/) as well as additional APIs for
3
- * Node.js-specific performance measurements.
4
- *
5
- * Node.js supports the following [Web Performance APIs](https://w3c.github.io/perf-timing-primer/):
6
- *
7
- * * [High Resolution Time](https://www.w3.org/TR/hr-time-2)
8
- * * [Performance Timeline](https://w3c.github.io/performance-timeline/)
9
- * * [User Timing](https://www.w3.org/TR/user-timing/)
10
- *
11
- * ```js
12
- * const { PerformanceObserver, performance } = require('perf_hooks');
13
- *
14
- * const obs = new PerformanceObserver((items) => {
15
- * console.log(items.getEntries()[0].duration);
16
- * performance.clearMarks();
17
- * });
18
- * obs.observe({ type: 'measure' });
19
- * performance.measure('Start to Now');
20
- *
21
- * performance.mark('A');
22
- * doSomeLongRunningProcess(() => {
23
- * performance.measure('A to Now', 'A');
24
- *
25
- * performance.mark('B');
26
- * performance.measure('A to B', 'A', 'B');
27
- * });
28
- * ```
29
- * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/perf_hooks.js)
30
- */
31
- declare module "perf_hooks" {
32
- import { AsyncResource } from "node:async_hooks";
33
- type EntryType = "node" | "mark" | "measure" | "gc" | "function" | "http2" | "http" | "dns";
34
- interface NodeGCPerformanceDetail {
35
- /**
36
- * When `performanceEntry.entryType` is equal to 'gc', `the performance.kind` property identifies
37
- * the type of garbage collection operation that occurred.
38
- * See perf_hooks.constants for valid values.
39
- */
40
- readonly kind?: number | undefined;
41
- /**
42
- * When `performanceEntry.entryType` is equal to 'gc', the `performance.flags`
43
- * property contains additional information about garbage collection operation.
44
- * See perf_hooks.constants for valid values.
45
- */
46
- readonly flags?: number | undefined;
47
- }
48
- /**
49
- * @since v8.5.0
50
- */
51
- class PerformanceEntry {
52
- protected constructor();
53
- /**
54
- * The total number of milliseconds elapsed for this entry. This value will not
55
- * be meaningful for all Performance Entry types.
56
- * @since v8.5.0
57
- */
58
- readonly duration: number;
59
- /**
60
- * The name of the performance entry.
61
- * @since v8.5.0
62
- */
63
- readonly name: string;
64
- /**
65
- * The high resolution millisecond timestamp marking the starting time of the
66
- * Performance Entry.
67
- * @since v8.5.0
68
- */
69
- readonly startTime: number;
70
- /**
71
- * The type of the performance entry. It may be one of:
72
- *
73
- * * `'node'` (Node.js only)
74
- * * `'mark'` (available on the Web)
75
- * * `'measure'` (available on the Web)
76
- * * `'gc'` (Node.js only)
77
- * * `'function'` (Node.js only)
78
- * * `'http2'` (Node.js only)
79
- * * `'http'` (Node.js only)
80
- * @since v8.5.0
81
- */
82
- readonly entryType: EntryType;
83
- /**
84
- * Additional detail specific to the `entryType`.
85
- * @since v16.0.0
86
- */
87
- readonly detail?: NodeGCPerformanceDetail | unknown | undefined; // TODO: Narrow this based on entry type.
88
- toJSON(): any;
89
- }
90
- class PerformanceMark extends PerformanceEntry {
91
- readonly duration: 0;
92
- readonly entryType: "mark";
93
- }
94
- class PerformanceMeasure extends PerformanceEntry {
95
- readonly entryType: "measure";
96
- }
97
- /**
98
- * _This property is an extension by Node.js. It is not available in Web browsers._
99
- *
100
- * Provides timing details for Node.js itself. The constructor of this class
101
- * is not exposed to users.
102
- * @since v8.5.0
103
- */
104
- class PerformanceNodeTiming extends PerformanceEntry {
105
- /**
106
- * The high resolution millisecond timestamp at which the Node.js process
107
- * completed bootstrapping. If bootstrapping has not yet finished, the property
108
- * has the value of -1.
109
- * @since v8.5.0
110
- */
111
- readonly bootstrapComplete: number;
112
- /**
113
- * The high resolution millisecond timestamp at which the Node.js environment was
114
- * initialized.
115
- * @since v8.5.0
116
- */
117
- readonly environment: number;
118
- /**
119
- * The high resolution millisecond timestamp of the amount of time the event loop
120
- * has been idle within the event loop's event provider (e.g. `epoll_wait`). This
121
- * does not take CPU usage into consideration. If the event loop has not yet
122
- * started (e.g., in the first tick of the main script), the property has the
123
- * value of 0.
124
- * @since v14.10.0, v12.19.0
125
- */
126
- readonly idleTime: number;
127
- /**
128
- * The high resolution millisecond timestamp at which the Node.js event loop
129
- * exited. If the event loop has not yet exited, the property has the value of -1\.
130
- * It can only have a value of not -1 in a handler of the `'exit'` event.
131
- * @since v8.5.0
132
- */
133
- readonly loopExit: number;
134
- /**
135
- * The high resolution millisecond timestamp at which the Node.js event loop
136
- * started. If the event loop has not yet started (e.g., in the first tick of the
137
- * main script), the property has the value of -1.
138
- * @since v8.5.0
139
- */
140
- readonly loopStart: number;
141
- /**
142
- * The high resolution millisecond timestamp at which the V8 platform was
143
- * initialized.
144
- * @since v8.5.0
145
- */
146
- readonly v8Start: number;
147
- }
148
- interface EventLoopUtilization {
149
- idle: number;
150
- active: number;
151
- utilization: number;
152
- }
153
- /**
154
- * @param util1 The result of a previous call to eventLoopUtilization()
155
- * @param util2 The result of a previous call to eventLoopUtilization() prior to util1
156
- */
157
- type EventLoopUtilityFunction = (
158
- util1?: EventLoopUtilization,
159
- util2?: EventLoopUtilization,
160
- ) => EventLoopUtilization;
161
- interface MarkOptions {
162
- /**
163
- * Additional optional detail to include with the mark.
164
- */
165
- detail?: unknown | undefined;
166
- /**
167
- * An optional timestamp to be used as the mark time.
168
- * @default `performance.now()`.
169
- */
170
- startTime?: number | undefined;
171
- }
172
- interface MeasureOptions {
173
- /**
174
- * Additional optional detail to include with the mark.
175
- */
176
- detail?: unknown | undefined;
177
- /**
178
- * Duration between start and end times.
179
- */
180
- duration?: number | undefined;
181
- /**
182
- * Timestamp to be used as the end time, or a string identifying a previously recorded mark.
183
- */
184
- end?: number | string | undefined;
185
- /**
186
- * Timestamp to be used as the start time, or a string identifying a previously recorded mark.
187
- */
188
- start?: number | string | undefined;
189
- }
190
- interface TimerifyOptions {
191
- /**
192
- * A histogram object created using
193
- * `perf_hooks.createHistogram()` that will record runtime durations in
194
- * nanoseconds.
195
- */
196
- histogram?: RecordableHistogram | undefined;
197
- }
198
- interface Performance {
199
- /**
200
- * If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
201
- * If name is provided, removes only the named mark.
202
- * @param name
203
- */
204
- clearMarks(name?: string): void;
205
- /**
206
- * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline.
207
- * If name is provided, removes only the named measure.
208
- * @param name
209
- * @since v16.7.0
210
- */
211
- clearMeasures(name?: string): void;
212
- /**
213
- * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`.
214
- * If you are only interested in performance entries of certain types or that have certain names, see
215
- * `performance.getEntriesByType()` and `performance.getEntriesByName()`.
216
- * @since v16.7.0
217
- */
218
- getEntries(): PerformanceEntry[];
219
- /**
220
- * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
221
- * whose `performanceEntry.name` is equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to `type`.
222
- * @param name
223
- * @param type
224
- * @since v16.7.0
225
- */
226
- getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
227
- /**
228
- * Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`
229
- * whose `performanceEntry.entryType` is equal to `type`.
230
- * @param type
231
- * @since v16.7.0
232
- */
233
- getEntriesByType(type: EntryType): PerformanceEntry[];
234
- /**
235
- * Creates a new PerformanceMark entry in the Performance Timeline.
236
- * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark',
237
- * and whose performanceEntry.duration is always 0.
238
- * Performance marks are used to mark specific significant moments in the Performance Timeline.
239
- * @param name
240
- * @return The PerformanceMark entry that was created
241
- */
242
- mark(name?: string, options?: MarkOptions): PerformanceMark;
243
- /**
244
- * Creates a new PerformanceMeasure entry in the Performance Timeline.
245
- * A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
246
- * and whose performanceEntry.duration measures the number of milliseconds elapsed since startMark and endMark.
247
- *
248
- * The startMark argument may identify any existing PerformanceMark in the the Performance Timeline, or may identify
249
- * any of the timestamp properties provided by the PerformanceNodeTiming class. If the named startMark does not exist,
250
- * then startMark is set to timeOrigin by default.
251
- *
252
- * The endMark argument must identify any existing PerformanceMark in the the Performance Timeline or any of the timestamp
253
- * properties provided by the PerformanceNodeTiming class. If the named endMark does not exist, an error will be thrown.
254
- * @param name
255
- * @param startMark
256
- * @param endMark
257
- * @return The PerformanceMeasure entry that was created
258
- */
259
- measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure;
260
- measure(name: string, options: MeasureOptions): PerformanceMeasure;
261
- /**
262
- * An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones.
263
- */
264
- readonly nodeTiming: PerformanceNodeTiming;
265
- /**
266
- * @return the current high resolution millisecond timestamp
267
- */
268
- now(): number;
269
- /**
270
- * The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured.
271
- */
272
- readonly timeOrigin: number;
273
- /**
274
- * Wraps a function within a new function that measures the running time of the wrapped function.
275
- * A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed.
276
- * @param fn
277
- */
278
- timerify<T extends (...params: any[]) => any>(fn: T, options?: TimerifyOptions): T;
279
- /**
280
- * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
281
- * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait).
282
- * No other CPU idle time is taken into consideration.
283
- */
284
- eventLoopUtilization: EventLoopUtilityFunction;
285
- }
286
- interface PerformanceObserverEntryList {
287
- /**
288
- * Returns a list of `PerformanceEntry` objects in chronological order
289
- * with respect to `performanceEntry.startTime`.
290
- *
291
- * ```js
292
- * const {
293
- * performance,
294
- * PerformanceObserver
295
- * } = require('perf_hooks');
296
- *
297
- * const obs = new PerformanceObserver((perfObserverList, observer) => {
298
- * console.log(perfObserverList.getEntries());
299
- *
300
- * * [
301
- * * PerformanceEntry {
302
- * * name: 'test',
303
- * * entryType: 'mark',
304
- * * startTime: 81.465639,
305
- * * duration: 0
306
- * * },
307
- * * PerformanceEntry {
308
- * * name: 'meow',
309
- * * entryType: 'mark',
310
- * * startTime: 81.860064,
311
- * * duration: 0
312
- * * }
313
- * * ]
314
- *
315
- * performance.clearMarks();
316
- * performance.clearMeasures();
317
- * observer.disconnect();
318
- * });
319
- * obs.observe({ type: 'mark' });
320
- *
321
- * performance.mark('test');
322
- * performance.mark('meow');
323
- * ```
324
- * @since v8.5.0
325
- */
326
- getEntries(): PerformanceEntry[];
327
- /**
328
- * Returns a list of `PerformanceEntry` objects in chronological order
329
- * with respect to `performanceEntry.startTime` whose `performanceEntry.name` is
330
- * equal to `name`, and optionally, whose `performanceEntry.entryType` is equal to`type`.
331
- *
332
- * ```js
333
- * const {
334
- * performance,
335
- * PerformanceObserver
336
- * } = require('perf_hooks');
337
- *
338
- * const obs = new PerformanceObserver((perfObserverList, observer) => {
339
- * console.log(perfObserverList.getEntriesByName('meow'));
340
- *
341
- * * [
342
- * * PerformanceEntry {
343
- * * name: 'meow',
344
- * * entryType: 'mark',
345
- * * startTime: 98.545991,
346
- * * duration: 0
347
- * * }
348
- * * ]
349
- *
350
- * console.log(perfObserverList.getEntriesByName('nope')); // []
351
- *
352
- * console.log(perfObserverList.getEntriesByName('test', 'mark'));
353
- *
354
- * * [
355
- * * PerformanceEntry {
356
- * * name: 'test',
357
- * * entryType: 'mark',
358
- * * startTime: 63.518931,
359
- * * duration: 0
360
- * * }
361
- * * ]
362
- *
363
- * console.log(perfObserverList.getEntriesByName('test', 'measure')); // []
364
- *
365
- * performance.clearMarks();
366
- * performance.clearMeasures();
367
- * observer.disconnect();
368
- * });
369
- * obs.observe({ entryTypes: ['mark', 'measure'] });
370
- *
371
- * performance.mark('test');
372
- * performance.mark('meow');
373
- * ```
374
- * @since v8.5.0
375
- */
376
- getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
377
- /**
378
- * Returns a list of `PerformanceEntry` objects in chronological order
379
- * with respect to `performanceEntry.startTime` whose `performanceEntry.entryType`is equal to `type`.
380
- *
381
- * ```js
382
- * const {
383
- * performance,
384
- * PerformanceObserver
385
- * } = require('perf_hooks');
386
- *
387
- * const obs = new PerformanceObserver((perfObserverList, observer) => {
388
- * console.log(perfObserverList.getEntriesByType('mark'));
389
- *
390
- * * [
391
- * * PerformanceEntry {
392
- * * name: 'test',
393
- * * entryType: 'mark',
394
- * * startTime: 55.897834,
395
- * * duration: 0
396
- * * },
397
- * * PerformanceEntry {
398
- * * name: 'meow',
399
- * * entryType: 'mark',
400
- * * startTime: 56.350146,
401
- * * duration: 0
402
- * * }
403
- * * ]
404
- *
405
- * performance.clearMarks();
406
- * performance.clearMeasures();
407
- * observer.disconnect();
408
- * });
409
- * obs.observe({ type: 'mark' });
410
- *
411
- * performance.mark('test');
412
- * performance.mark('meow');
413
- * ```
414
- * @since v8.5.0
415
- */
416
- getEntriesByType(type: EntryType): PerformanceEntry[];
417
- }
418
- type PerformanceObserverCallback = (list: PerformanceObserverEntryList, observer: PerformanceObserver) => void;
419
- class PerformanceObserver extends AsyncResource {
420
- constructor(callback: PerformanceObserverCallback);
421
- /**
422
- * Disconnects the `PerformanceObserver` instance from all notifications.
423
- * @since v8.5.0
424
- */
425
- disconnect(): void;
426
- /**
427
- * Subscribes the `PerformanceObserver` instance to notifications of new `PerformanceEntry` instances identified either by `options.entryTypes`or `options.type`:
428
- *
429
- * ```js
430
- * const {
431
- * performance,
432
- * PerformanceObserver
433
- * } = require('perf_hooks');
434
- *
435
- * const obs = new PerformanceObserver((list, observer) => {
436
- * // Called once asynchronously. `list` contains three items.
437
- * });
438
- * obs.observe({ type: 'mark' });
439
- *
440
- * for (let n = 0; n < 3; n++)
441
- * performance.mark(`test${n}`);
442
- * ```
443
- * @since v8.5.0
444
- */
445
- observe(
446
- options:
447
- | {
448
- entryTypes: readonly EntryType[];
449
- buffered?: boolean | undefined;
450
- }
451
- | {
452
- type: EntryType;
453
- buffered?: boolean | undefined;
454
- },
455
- ): void;
456
- }
457
- namespace constants {
458
- const NODE_PERFORMANCE_GC_MAJOR: number;
459
- const NODE_PERFORMANCE_GC_MINOR: number;
460
- const NODE_PERFORMANCE_GC_INCREMENTAL: number;
461
- const NODE_PERFORMANCE_GC_WEAKCB: number;
462
- const NODE_PERFORMANCE_GC_FLAGS_NO: number;
463
- const NODE_PERFORMANCE_GC_FLAGS_CONSTRUCT_RETAINED: number;
464
- const NODE_PERFORMANCE_GC_FLAGS_FORCED: number;
465
- const NODE_PERFORMANCE_GC_FLAGS_SYNCHRONOUS_PHANTOM_PROCESSING: number;
466
- const NODE_PERFORMANCE_GC_FLAGS_ALL_AVAILABLE_GARBAGE: number;
467
- const NODE_PERFORMANCE_GC_FLAGS_ALL_EXTERNAL_MEMORY: number;
468
- const NODE_PERFORMANCE_GC_FLAGS_SCHEDULE_IDLE: number;
469
- }
470
- const performance: Performance;
471
- interface EventLoopMonitorOptions {
472
- /**
473
- * The sampling rate in milliseconds.
474
- * Must be greater than zero.
475
- * @default 10
476
- */
477
- resolution?: number | undefined;
478
- }
479
- interface Histogram {
480
- /**
481
- * Returns a `Map` object detailing the accumulated percentile distribution.
482
- * @since v11.10.0
483
- */
484
- readonly percentiles: Map<number, number>;
485
- /**
486
- * The number of times the event loop delay exceeded the maximum 1 hour event
487
- * loop delay threshold.
488
- * @since v11.10.0
489
- */
490
- readonly exceeds: number;
491
- /**
492
- * The minimum recorded event loop delay.
493
- * @since v11.10.0
494
- */
495
- readonly min: number;
496
- /**
497
- * The maximum recorded event loop delay.
498
- * @since v11.10.0
499
- */
500
- readonly max: number;
501
- /**
502
- * The mean of the recorded event loop delays.
503
- * @since v11.10.0
504
- */
505
- readonly mean: number;
506
- /**
507
- * The standard deviation of the recorded event loop delays.
508
- * @since v11.10.0
509
- */
510
- readonly stddev: number;
511
- /**
512
- * Resets the collected histogram data.
513
- * @since v11.10.0
514
- */
515
- reset(): void;
516
- /**
517
- * Returns the value at the given percentile.
518
- * @since v11.10.0
519
- * @param percentile A percentile value in the range (0, 100].
520
- */
521
- percentile(percentile: number): number;
522
- }
523
- interface IntervalHistogram extends Histogram {
524
- /**
525
- * Enables the update interval timer. Returns `true` if the timer was
526
- * started, `false` if it was already started.
527
- * @since v11.10.0
528
- */
529
- enable(): boolean;
530
- /**
531
- * Disables the update interval timer. Returns `true` if the timer was
532
- * stopped, `false` if it was already stopped.
533
- * @since v11.10.0
534
- */
535
- disable(): boolean;
536
- }
537
- interface RecordableHistogram extends Histogram {
538
- /**
539
- * @since v15.9.0, v14.18.0
540
- * @param val The amount to record in the histogram.
541
- */
542
- record(val: number | bigint): void;
543
- /**
544
- * Calculates the amount of time (in nanoseconds) that has passed since the
545
- * previous call to `recordDelta()` and records that amount in the histogram.
546
- *
547
- * ## Examples
548
- * @since v15.9.0, v14.18.0
549
- */
550
- recordDelta(): void;
551
- /**
552
- * Adds the values from other to this histogram.
553
- * @since v17.4.0, v16.14.0
554
- * @param other Recordable Histogram to combine with
555
- */
556
- add(other: RecordableHistogram): void;
557
- }
558
- /**
559
- * _This property is an extension by Node.js. It is not available in Web browsers._
560
- *
561
- * Creates an `IntervalHistogram` object that samples and reports the event loop
562
- * delay over time. The delays will be reported in nanoseconds.
563
- *
564
- * Using a timer to detect approximate event loop delay works because the
565
- * execution of timers is tied specifically to the lifecycle of the libuv
566
- * event loop. That is, a delay in the loop will cause a delay in the execution
567
- * of the timer, and those delays are specifically what this API is intended to
568
- * detect.
569
- *
570
- * ```js
571
- * const { monitorEventLoopDelay } = require('perf_hooks');
572
- * const h = monitorEventLoopDelay({ resolution: 20 });
573
- * h.enable();
574
- * // Do something.
575
- * h.disable();
576
- * console.log(h.min);
577
- * console.log(h.max);
578
- * console.log(h.mean);
579
- * console.log(h.stddev);
580
- * console.log(h.percentiles);
581
- * console.log(h.percentile(50));
582
- * console.log(h.percentile(99));
583
- * ```
584
- * @since v11.10.0
585
- */
586
- function monitorEventLoopDelay(options?: EventLoopMonitorOptions): IntervalHistogram;
587
- interface CreateHistogramOptions {
588
- /**
589
- * The minimum recordable value. Must be an integer value greater than 0.
590
- * @default 1
591
- */
592
- min?: number | bigint | undefined;
593
- /**
594
- * The maximum recordable value. Must be an integer value greater than min.
595
- * @default Number.MAX_SAFE_INTEGER
596
- */
597
- max?: number | bigint | undefined;
598
- /**
599
- * The number of accuracy digits. Must be a number between 1 and 5.
600
- * @default 3
601
- */
602
- figures?: number | undefined;
603
- }
604
- /**
605
- * Returns a `RecordableHistogram`.
606
- * @since v15.9.0, v14.18.0
607
- */
608
- function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
609
-
610
- import { performance as _performance } from "perf_hooks";
611
- global {
612
- /**
613
- * `performance` is a global reference for `require('perf_hooks').performance`
614
- * https://nodejs.org/api/globals.html#performance
615
- * @since v16.0.0
616
- */
617
- var performance: typeof globalThis extends {
618
- onmessage: any;
619
- performance: infer T;
620
- } ? T
621
- : typeof _performance;
622
- }
623
- }
624
- declare module "node:perf_hooks" {
625
- export * from "perf_hooks";
626
- }