@types/node
Advanced tools
Comparing version 18.19.71 to 18.19.72
{ | ||
"name": "@types/node", | ||
"version": "18.19.71", | ||
"version": "18.19.72", | ||
"description": "TypeScript definitions for node", | ||
@@ -223,4 +223,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", | ||
"peerDependencies": {}, | ||
"typesPublisherContentHash": "b647172e49cef8d6c6c37fad400211ae4f94725bc1385df959712f4a1a699b16", | ||
"typesPublisherContentHash": "4ace8ddb500f644dc7ea0d53a0f5140b9389270a2c1d535b385302c502ba3038", | ||
"typeScriptVersion": "5.0" | ||
} |
@@ -29,3 +29,3 @@ /** | ||
* ``` | ||
* @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/perf_hooks.js) | ||
* @see [source](https://github.com/nodejs/node/blob/v18.20.5/lib/perf_hooks.js) | ||
*/ | ||
@@ -153,2 +153,7 @@ declare module "perf_hooks" { | ||
/** | ||
* The high resolution millisecond timestamp at which the Node.js process was initialized. | ||
* @since v8.5.0 | ||
*/ | ||
readonly nodeStart: number; | ||
/** | ||
* The high resolution millisecond timestamp at which the V8 platform was | ||
@@ -166,8 +171,8 @@ * initialized. | ||
/** | ||
* @param util1 The result of a previous call to eventLoopUtilization() | ||
* @param util2 The result of a previous call to eventLoopUtilization() prior to util1 | ||
* @param utilization1 The result of a previous call to `eventLoopUtilization()`. | ||
* @param utilization2 The result of a previous call to `eventLoopUtilization()` prior to `utilization1`. | ||
*/ | ||
type EventLoopUtilityFunction = ( | ||
util1?: EventLoopUtilization, | ||
util2?: EventLoopUtilization, | ||
utilization1?: EventLoopUtilization, | ||
utilization2?: EventLoopUtilization, | ||
) => EventLoopUtilization; | ||
@@ -181,3 +186,3 @@ interface MarkOptions { | ||
* An optional timestamp to be used as the mark time. | ||
* @default `performance.now()`. | ||
* @default `performance.now()` | ||
*/ | ||
@@ -206,5 +211,4 @@ startTime?: number | undefined; | ||
/** | ||
* A histogram object created using | ||
* `perf_hooks.createHistogram()` that will record runtime durations in | ||
* nanoseconds. | ||
* A histogram object created using `perf_hooks.createHistogram()` that will record runtime | ||
* durations in nanoseconds. | ||
*/ | ||
@@ -215,10 +219,11 @@ histogram?: RecordableHistogram | undefined; | ||
/** | ||
* If name is not provided, removes all PerformanceMark objects from the Performance Timeline. | ||
* If name is provided, removes only the named mark. | ||
* If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline. | ||
* If `name` is provided, removes only the named mark. | ||
* @param name | ||
* @since v8.5.0 | ||
*/ | ||
clearMarks(name?: string): void; | ||
/** | ||
* If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline. | ||
* If name is provided, removes only the named measure. | ||
* If `name` is not provided, removes all `PerformanceMeasure` objects from the Performance Timeline. | ||
* If `name` is provided, removes only the named measure. | ||
* @param name | ||
@@ -229,2 +234,14 @@ * @since v16.7.0 | ||
/** | ||
* If `name` is not provided, removes all `PerformanceResourceTiming` objects from the Resource Timeline. | ||
* If `name` is provided, removes only the named resource. | ||
* @since v18.2.0, v16.17.0 | ||
*/ | ||
clearResourceTimings(name?: string): void; | ||
/** | ||
* eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. | ||
* It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). | ||
* No other CPU idle time is taken into consideration. | ||
*/ | ||
eventLoopUtilization: EventLoopUtilityFunction; | ||
/** | ||
* Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`. | ||
@@ -252,10 +269,14 @@ * If you are only interested in performance entries of certain types or that have certain names, see | ||
/** | ||
* Creates a new PerformanceMark entry in the Performance Timeline. | ||
* A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark', | ||
* and whose performanceEntry.duration is always 0. | ||
* Creates a new `PerformanceMark` entry in the Performance Timeline. | ||
* A `PerformanceMark` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'mark'`, | ||
* and whose `performanceEntry.duration` is always `0`. | ||
* Performance marks are used to mark specific significant moments in the Performance Timeline. | ||
* | ||
* The created `PerformanceMark` entry is put in the global Performance Timeline and can be queried with | ||
* `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is | ||
* performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMarks`. | ||
* @param name | ||
* @return The PerformanceMark entry that was created | ||
*/ | ||
mark(name?: string, options?: MarkOptions): PerformanceMark; | ||
mark(name: string, options?: MarkOptions): PerformanceMark; | ||
/** | ||
@@ -298,16 +319,70 @@ * Creates a new `PerformanceResourceTiming` entry in the Resource Timeline. | ||
/** | ||
* An instance of the PerformanceNodeTiming class that provides performance metrics for specific Node.js operational milestones. | ||
* _This property is an extension by Node.js. It is not available in Web browsers._ | ||
* | ||
* An instance of the `PerformanceNodeTiming` class that provides performance metrics for specific Node.js operational milestones. | ||
* @since v8.5.0 | ||
*/ | ||
readonly nodeTiming: PerformanceNodeTiming; | ||
/** | ||
* @return the current high resolution millisecond timestamp | ||
* Returns the current high resolution millisecond timestamp, where 0 represents the start of the current `node` process. | ||
* @since v8.5.0 | ||
*/ | ||
now(): number; | ||
/** | ||
* The timeOrigin specifies the high resolution millisecond timestamp from which all performance metric durations are measured. | ||
* Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects. | ||
* | ||
* By default the max buffer size is set to 250. | ||
* @since v18.8.0 | ||
*/ | ||
setResourceTimingBufferSize(maxSize: number): void; | ||
/** | ||
* The [`timeOrigin`](https://w3c.github.io/hr-time/#dom-performance-timeorigin) specifies the high resolution millisecond timestamp | ||
* at which the current `node` process began, measured in Unix time. | ||
* @since v8.5.0 | ||
* Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects. | ||
* | ||
* By default the max buffer size is set to 250. | ||
* @since v18.8.0 | ||
*/ | ||
setResourceTimingBufferSize(maxSize: number): void; | ||
/** | ||
* The [`timeOrigin`](https://w3c.github.io/hr-time/#dom-performance-timeorigin) specifies the high resolution millisecond timestamp | ||
* at which the current `node` process began, measured in Unix time. | ||
* @since v8.5.0 | ||
/** | ||
*/ | ||
readonly timeOrigin: number; | ||
/** | ||
* _This property is an extension by Node.js. It is not available in Web browsers._ | ||
* | ||
* Wraps a function within a new function that measures the running time of the wrapped function. | ||
* A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed. | ||
* A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed. | ||
* | ||
* ```js | ||
* const { | ||
* performance, | ||
* PerformanceObserver, | ||
* } = require('node:perf_hooks'); | ||
* | ||
* function someFunction() { | ||
* console.log('hello world'); | ||
* } | ||
* | ||
* const wrapped = performance.timerify(someFunction); | ||
* | ||
* const obs = new PerformanceObserver((list) => { | ||
* console.log(list.getEntries()[0].duration); | ||
* | ||
* performance.clearMarks(); | ||
* performance.clearMeasures(); | ||
* obs.disconnect(); | ||
* }); | ||
* obs.observe({ entryTypes: ['function'] }); | ||
* | ||
* // A performance timeline entry will be created | ||
* wrapped(); | ||
* ``` | ||
* | ||
* If the wrapped function returns a promise, a finally handler will be attached to the promise and the duration will be reported | ||
* once the finally handler is invoked. | ||
* @param fn | ||
@@ -317,9 +392,9 @@ */ | ||
/** | ||
* eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time. | ||
* It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait). | ||
* No other CPU idle time is taken into consideration. | ||
* An object which is JSON representation of the performance object. It is similar to | ||
* [`window.performance.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON) in browsers. | ||
* @since v16.1.0 | ||
*/ | ||
eventLoopUtilization: EventLoopUtilityFunction; | ||
toJSON(): any; | ||
} | ||
interface PerformanceObserverEntryList { | ||
class PerformanceObserverEntryList { | ||
/** | ||
@@ -502,3 +577,2 @@ * Returns a list of `PerformanceEntry` objects in chronological order | ||
class PerformanceResourceTiming extends PerformanceEntry { | ||
readonly entryType: "resource"; | ||
protected constructor(); | ||
@@ -594,3 +668,2 @@ /** | ||
} | ||
namespace constants { | ||
@@ -620,7 +693,12 @@ const NODE_PERFORMANCE_GC_MAJOR: number; | ||
/** | ||
* Returns a `Map` object detailing the accumulated percentile distribution. | ||
* @since v11.10.0 | ||
* The number of samples recorded by the histogram. | ||
* @since v17.4.0, v16.14.0 | ||
*/ | ||
readonly percentiles: Map<number, number>; | ||
readonly count: number; | ||
/** | ||
* The number of samples recorded by the histogram. | ||
* v17.4.0, v16.14.0 | ||
*/ | ||
readonly countBigInt: bigint; | ||
/** | ||
* The number of times the event loop delay exceeded the maximum 1 hour event | ||
@@ -632,6 +710,6 @@ * loop delay threshold. | ||
/** | ||
* The minimum recorded event loop delay. | ||
* @since v11.10.0 | ||
* The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold. | ||
* @since v17.4.0, v16.14.0 | ||
*/ | ||
readonly min: number; | ||
readonly exceedsBigInt: bigint; | ||
/** | ||
@@ -643,2 +721,7 @@ * The maximum recorded event loop delay. | ||
/** | ||
* The maximum recorded event loop delay. | ||
* v17.4.0, v16.14.0 | ||
*/ | ||
readonly maxBigInt: number; | ||
/** | ||
* The mean of the recorded event loop delays. | ||
@@ -649,7 +732,34 @@ * @since v11.10.0 | ||
/** | ||
* The standard deviation of the recorded event loop delays. | ||
* The minimum recorded event loop delay. | ||
* @since v11.10.0 | ||
*/ | ||
readonly stddev: number; | ||
readonly min: number; | ||
/** | ||
* The minimum recorded event loop delay. | ||
* v17.4.0, v16.14.0 | ||
*/ | ||
readonly minBigInt: bigint; | ||
/** | ||
* Returns the value at the given percentile. | ||
* @since v11.10.0 | ||
* @param percentile A percentile value in the range (0, 100]. | ||
*/ | ||
percentile(percentile: number): number; | ||
/** | ||
* Returns the value at the given percentile. | ||
* @since v17.4.0, v16.14.0 | ||
* @param percentile A percentile value in the range (0, 100]. | ||
*/ | ||
percentileBigInt(percentile: number): bigint; | ||
/** | ||
* Returns a `Map` object detailing the accumulated percentile distribution. | ||
* @since v11.10.0 | ||
*/ | ||
readonly percentiles: Map<number, number>; | ||
/** | ||
* Returns a `Map` object detailing the accumulated percentile distribution. | ||
* @since v17.4.0, v16.14.0 | ||
*/ | ||
readonly percentilesBigInt: Map<bigint, bigint>; | ||
/** | ||
* Resets the collected histogram data. | ||
@@ -660,7 +770,6 @@ * @since v11.10.0 | ||
/** | ||
* Returns the value at the given percentile. | ||
* The standard deviation of the recorded event loop delays. | ||
* @since v11.10.0 | ||
* @param percentile A percentile value in the range (0, 100]. | ||
*/ | ||
percentile(percentile: number): number; | ||
readonly stddev: number; | ||
} | ||
@@ -690,4 +799,2 @@ interface IntervalHistogram extends Histogram { | ||
* previous call to `recordDelta()` and records that amount in the histogram. | ||
* | ||
* ## Examples | ||
* @since v15.9.0, v14.18.0 | ||
@@ -759,3 +866,3 @@ */ | ||
* `performance` is a global reference for `import { performance } from 'node:perf_hooks'` | ||
* https://nodejs.org/api/globals.html#performance | ||
* @see https://nodejs.org/docs/latest-v18.x/api/globals.html#performance | ||
* @since v16.0.0 | ||
@@ -762,0 +869,0 @@ */ |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Thu, 16 Jan 2025 00:46:49 GMT | ||
* Last updated: Wed, 22 Jan 2025 23:32:17 GMT | ||
* Dependencies: [undici-types](https://npmjs.com/package/undici-types) | ||
@@ -14,0 +14,0 @@ |
2039059
45632
2