@types/node 20.12.12 → 20.12.13
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.
- node/README.md +1 -1
- node/assert.d.ts +1 -1
- node/async_hooks.d.ts +1 -1
- node/buffer.d.ts +1 -1
- node/child_process.d.ts +31 -29
- node/cluster.d.ts +1 -1
- node/console.d.ts +1 -1
- node/crypto.d.ts +2 -1
- node/dgram.d.ts +1 -1
- node/diagnostics_channel.d.ts +10 -1
- node/dns/promises.d.ts +7 -6
- node/dns.d.ts +23 -12
- node/domain.d.ts +1 -1
- node/events.d.ts +22 -2
- node/fs.d.ts +3 -2
- node/http.d.ts +62 -43
- node/http2.d.ts +1 -1
- node/https.d.ts +1 -1
- node/inspector.d.ts +1 -1
- node/net.d.ts +7 -4
- node/os.d.ts +1 -1
- node/package.json +2 -2
- node/path.d.ts +1 -1
- node/perf_hooks.d.ts +305 -45
- node/process.d.ts +11 -4
- node/punycode.d.ts +1 -1
- node/querystring.d.ts +1 -1
- node/readline.d.ts +1 -1
- node/repl.d.ts +1 -1
- node/stream.d.ts +15 -15
- node/string_decoder.d.ts +1 -1
- node/test.d.ts +291 -51
- node/timers.d.ts +1 -1
- node/tls.d.ts +1 -1
- node/trace_events.d.ts +1 -1
- node/tty.d.ts +1 -1
- node/url.d.ts +11 -3
- node/util.d.ts +20 -4
- node/v8.d.ts +45 -1
- node/vm.d.ts +9 -6
- node/wasi.d.ts +1 -1
- node/worker_threads.d.ts +1 -1
- node/zlib.d.ts +1 -1
node/perf_hooks.d.ts
CHANGED
@@ -27,7 +27,7 @@
|
|
27
27
|
* performance.measure('A to B', 'A', 'B');
|
28
28
|
* });
|
29
29
|
* ```
|
30
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
30
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/perf_hooks.js)
|
31
31
|
*/
|
32
32
|
declare module "perf_hooks" {
|
33
33
|
import { AsyncResource } from "node:async_hooks";
|
@@ -150,6 +150,11 @@ declare module "perf_hooks" {
|
|
150
150
|
* @since v8.5.0
|
151
151
|
*/
|
152
152
|
readonly loopStart: number;
|
153
|
+
/**
|
154
|
+
* The high resolution millisecond timestamp at which the Node.js process was initialized.
|
155
|
+
* @since v8.5.0
|
156
|
+
*/
|
157
|
+
readonly nodeStart: number;
|
153
158
|
/**
|
154
159
|
* The high resolution millisecond timestamp at which the V8 platform was
|
155
160
|
* initialized.
|
@@ -163,12 +168,12 @@ declare module "perf_hooks" {
|
|
163
168
|
utilization: number;
|
164
169
|
}
|
165
170
|
/**
|
166
|
-
* @param
|
167
|
-
* @param
|
171
|
+
* @param utilization1 The result of a previous call to `eventLoopUtilization()`.
|
172
|
+
* @param utilization2 The result of a previous call to `eventLoopUtilization()` prior to `utilization1`.
|
168
173
|
*/
|
169
174
|
type EventLoopUtilityFunction = (
|
170
|
-
|
171
|
-
|
175
|
+
utilization1?: EventLoopUtilization,
|
176
|
+
utilization2?: EventLoopUtilization,
|
172
177
|
) => EventLoopUtilization;
|
173
178
|
interface MarkOptions {
|
174
179
|
/**
|
@@ -177,7 +182,7 @@ declare module "perf_hooks" {
|
|
177
182
|
detail?: unknown | undefined;
|
178
183
|
/**
|
179
184
|
* An optional timestamp to be used as the mark time.
|
180
|
-
* @default `performance.now()
|
185
|
+
* @default `performance.now()`
|
181
186
|
*/
|
182
187
|
startTime?: number | undefined;
|
183
188
|
}
|
@@ -201,26 +206,36 @@ declare module "perf_hooks" {
|
|
201
206
|
}
|
202
207
|
interface TimerifyOptions {
|
203
208
|
/**
|
204
|
-
* A histogram object created using
|
205
|
-
*
|
206
|
-
* nanoseconds.
|
209
|
+
* A histogram object created using `perf_hooks.createHistogram()` that will record runtime
|
210
|
+
* durations in nanoseconds.
|
207
211
|
*/
|
208
212
|
histogram?: RecordableHistogram | undefined;
|
209
213
|
}
|
210
214
|
interface Performance {
|
211
215
|
/**
|
212
|
-
* If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
|
213
|
-
* If name is provided, removes only the named mark.
|
214
|
-
* @
|
216
|
+
* If `name` is not provided, removes all `PerformanceMark` objects from the Performance Timeline.
|
217
|
+
* If `name` is provided, removes only the named mark.
|
218
|
+
* @since v8.5.0
|
215
219
|
*/
|
216
220
|
clearMarks(name?: string): void;
|
217
221
|
/**
|
218
|
-
* If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline.
|
219
|
-
* If name is provided, removes only the named measure.
|
220
|
-
* @param name
|
222
|
+
* If `name` is not provided, removes all `PerformanceMeasure` objects from the Performance Timeline.
|
223
|
+
* If `name` is provided, removes only the named measure.
|
221
224
|
* @since v16.7.0
|
222
225
|
*/
|
223
226
|
clearMeasures(name?: string): void;
|
227
|
+
/**
|
228
|
+
* If `name` is not provided, removes all `PerformanceResourceTiming` objects from the Resource Timeline.
|
229
|
+
* If `name` is provided, removes only the named resource.
|
230
|
+
* @since v18.2.0, v16.17.0
|
231
|
+
*/
|
232
|
+
clearResourceTimings(name?: string): void;
|
233
|
+
/**
|
234
|
+
* eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
|
235
|
+
* It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait).
|
236
|
+
* No other CPU idle time is taken into consideration.
|
237
|
+
*/
|
238
|
+
eventLoopUtilization: EventLoopUtilityFunction;
|
224
239
|
/**
|
225
240
|
* Returns a list of `PerformanceEntry` objects in chronological order with respect to `performanceEntry.startTime`.
|
226
241
|
* If you are only interested in performance entries of certain types or that have certain names, see
|
@@ -244,14 +259,17 @@ declare module "perf_hooks" {
|
|
244
259
|
*/
|
245
260
|
getEntriesByType(type: EntryType): PerformanceEntry[];
|
246
261
|
/**
|
247
|
-
* Creates a new PerformanceMark entry in the Performance Timeline.
|
248
|
-
* A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark'
|
249
|
-
* and whose performanceEntry.duration is always 0
|
262
|
+
* Creates a new `PerformanceMark` entry in the Performance Timeline.
|
263
|
+
* A `PerformanceMark` is a subclass of `PerformanceEntry` whose `performanceEntry.entryType` is always `'mark'`,
|
264
|
+
* and whose `performanceEntry.duration` is always `0`.
|
250
265
|
* Performance marks are used to mark specific significant moments in the Performance Timeline.
|
266
|
+
*
|
267
|
+
* The created `PerformanceMark` entry is put in the global Performance Timeline and can be queried with
|
268
|
+
* `performance.getEntries`, `performance.getEntriesByName`, and `performance.getEntriesByType`. When the observation is
|
269
|
+
* performed, the entries should be cleared from the global Performance Timeline manually with `performance.clearMarks`.
|
251
270
|
* @param name
|
252
|
-
* @return The PerformanceMark entry that was created
|
253
271
|
*/
|
254
|
-
mark(name
|
272
|
+
mark(name: string, options?: MarkOptions): PerformanceMark;
|
255
273
|
/**
|
256
274
|
* Creates a new PerformanceMeasure entry in the Performance Timeline.
|
257
275
|
* A PerformanceMeasure is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'measure',
|
@@ -271,31 +289,74 @@ declare module "perf_hooks" {
|
|
271
289
|
measure(name: string, startMark?: string, endMark?: string): PerformanceMeasure;
|
272
290
|
measure(name: string, options: MeasureOptions): PerformanceMeasure;
|
273
291
|
/**
|
274
|
-
*
|
292
|
+
* _This property is an extension by Node.js. It is not available in Web browsers._
|
293
|
+
*
|
294
|
+
* An instance of the `PerformanceNodeTiming` class that provides performance metrics for specific Node.js operational milestones.
|
295
|
+
* @since v8.5.0
|
275
296
|
*/
|
276
297
|
readonly nodeTiming: PerformanceNodeTiming;
|
277
298
|
/**
|
278
|
-
*
|
299
|
+
* Returns the current high resolution millisecond timestamp, where 0 represents the start of the current `node` process.
|
300
|
+
* @since v8.5.0
|
279
301
|
*/
|
280
302
|
now(): number;
|
281
303
|
/**
|
282
|
-
*
|
304
|
+
* Sets the global performance resource timing buffer size to the specified number of "resource" type performance entry objects.
|
305
|
+
*
|
306
|
+
* By default the max buffer size is set to 250.
|
307
|
+
* @since v18.8.0
|
308
|
+
*/
|
309
|
+
setResourceTimingBufferSize(maxSize: number): void;
|
310
|
+
/**
|
311
|
+
* The [`timeOrigin`](https://w3c.github.io/hr-time/#dom-performance-timeorigin) specifies the high resolution millisecond timestamp
|
312
|
+
* at which the current `node` process began, measured in Unix time.
|
313
|
+
* @since v8.5.0
|
283
314
|
*/
|
284
315
|
readonly timeOrigin: number;
|
285
316
|
/**
|
317
|
+
* _This property is an extension by Node.js. It is not available in Web browsers._
|
318
|
+
*
|
286
319
|
* Wraps a function within a new function that measures the running time of the wrapped function.
|
287
|
-
* A PerformanceObserver must be subscribed to the 'function' event type in order for the timing details to be accessed.
|
320
|
+
* A `PerformanceObserver` must be subscribed to the `'function'` event type in order for the timing details to be accessed.
|
321
|
+
*
|
322
|
+
* ```js
|
323
|
+
* const {
|
324
|
+
* performance,
|
325
|
+
* PerformanceObserver,
|
326
|
+
* } = require('node:perf_hooks');
|
327
|
+
*
|
328
|
+
* function someFunction() {
|
329
|
+
* console.log('hello world');
|
330
|
+
* }
|
331
|
+
*
|
332
|
+
* const wrapped = performance.timerify(someFunction);
|
333
|
+
*
|
334
|
+
* const obs = new PerformanceObserver((list) => {
|
335
|
+
* console.log(list.getEntries()[0].duration);
|
336
|
+
*
|
337
|
+
* performance.clearMarks();
|
338
|
+
* performance.clearMeasures();
|
339
|
+
* obs.disconnect();
|
340
|
+
* });
|
341
|
+
* obs.observe({ entryTypes: ['function'] });
|
342
|
+
*
|
343
|
+
* // A performance timeline entry will be created
|
344
|
+
* wrapped();
|
345
|
+
* ```
|
346
|
+
*
|
347
|
+
* If the wrapped function returns a promise, a finally handler will be attached to the promise and the duration will be reported
|
348
|
+
* once the finally handler is invoked.
|
288
349
|
* @param fn
|
289
350
|
*/
|
290
351
|
timerify<T extends (...params: any[]) => any>(fn: T, options?: TimerifyOptions): T;
|
291
352
|
/**
|
292
|
-
*
|
293
|
-
*
|
294
|
-
*
|
353
|
+
* An object which is JSON representation of the performance object. It is similar to
|
354
|
+
* [`window.performance.toJSON`](https://developer.mozilla.org/en-US/docs/Web/API/Performance/toJSON) in browsers.
|
355
|
+
* @since v16.1.0
|
295
356
|
*/
|
296
|
-
|
357
|
+
toJSON(): any;
|
297
358
|
}
|
298
|
-
|
359
|
+
class PerformanceObserverEntryList {
|
299
360
|
/**
|
300
361
|
* Returns a list of `PerformanceEntry` objects in chronological order
|
301
362
|
* with respect to `performanceEntry.startTime`.
|
@@ -475,6 +536,103 @@ declare module "perf_hooks" {
|
|
475
536
|
},
|
476
537
|
): void;
|
477
538
|
}
|
539
|
+
/**
|
540
|
+
* Provides detailed network timing data regarding the loading of an application's resources.
|
541
|
+
*
|
542
|
+
* The constructor of this class is not exposed to users directly.
|
543
|
+
* @since v18.2.0, v16.17.0
|
544
|
+
*/
|
545
|
+
class PerformanceResourceTiming extends PerformanceEntry {
|
546
|
+
protected constructor();
|
547
|
+
/**
|
548
|
+
* The high resolution millisecond timestamp at immediately before dispatching the `fetch`
|
549
|
+
* request. If the resource is not intercepted by a worker the property will always return 0.
|
550
|
+
* @since v18.2.0, v16.17.0
|
551
|
+
*/
|
552
|
+
readonly workerStart: number;
|
553
|
+
/**
|
554
|
+
* The high resolution millisecond timestamp that represents the start time of the fetch which
|
555
|
+
* initiates the redirect.
|
556
|
+
* @since v18.2.0, v16.17.0
|
557
|
+
*/
|
558
|
+
readonly redirectStart: number;
|
559
|
+
/**
|
560
|
+
* The high resolution millisecond timestamp that will be created immediately after receiving
|
561
|
+
* the last byte of the response of the last redirect.
|
562
|
+
* @since v18.2.0, v16.17.0
|
563
|
+
*/
|
564
|
+
readonly redirectEnd: number;
|
565
|
+
/**
|
566
|
+
* The high resolution millisecond timestamp immediately before the Node.js starts to fetch the resource.
|
567
|
+
* @since v18.2.0, v16.17.0
|
568
|
+
*/
|
569
|
+
readonly fetchStart: number;
|
570
|
+
/**
|
571
|
+
* The high resolution millisecond timestamp immediately before the Node.js starts the domain name lookup
|
572
|
+
* for the resource.
|
573
|
+
* @since v18.2.0, v16.17.0
|
574
|
+
*/
|
575
|
+
readonly domainLookupStart: number;
|
576
|
+
/**
|
577
|
+
* The high resolution millisecond timestamp representing the time immediately after the Node.js finished
|
578
|
+
* the domain name lookup for the resource.
|
579
|
+
* @since v18.2.0, v16.17.0
|
580
|
+
*/
|
581
|
+
readonly domainLookupEnd: number;
|
582
|
+
/**
|
583
|
+
* The high resolution millisecond timestamp representing the time immediately before Node.js starts to
|
584
|
+
* establish the connection to the server to retrieve the resource.
|
585
|
+
* @since v18.2.0, v16.17.0
|
586
|
+
*/
|
587
|
+
readonly connectStart: number;
|
588
|
+
/**
|
589
|
+
* The high resolution millisecond timestamp representing the time immediately after Node.js finishes
|
590
|
+
* establishing the connection to the server to retrieve the resource.
|
591
|
+
* @since v18.2.0, v16.17.0
|
592
|
+
*/
|
593
|
+
readonly connectEnd: number;
|
594
|
+
/**
|
595
|
+
* The high resolution millisecond timestamp representing the time immediately before Node.js starts the
|
596
|
+
* handshake process to secure the current connection.
|
597
|
+
* @since v18.2.0, v16.17.0
|
598
|
+
*/
|
599
|
+
readonly secureConnectionStart: number;
|
600
|
+
/**
|
601
|
+
* The high resolution millisecond timestamp representing the time immediately before Node.js receives the
|
602
|
+
* first byte of the response from the server.
|
603
|
+
* @since v18.2.0, v16.17.0
|
604
|
+
*/
|
605
|
+
readonly requestStart: number;
|
606
|
+
/**
|
607
|
+
* The high resolution millisecond timestamp representing the time immediately after Node.js receives the
|
608
|
+
* last byte of the resource or immediately before the transport connection is closed, whichever comes first.
|
609
|
+
* @since v18.2.0, v16.17.0
|
610
|
+
*/
|
611
|
+
readonly responseEnd: number;
|
612
|
+
/**
|
613
|
+
* A number representing the size (in octets) of the fetched resource. The size includes the response header
|
614
|
+
* fields plus the response payload body.
|
615
|
+
* @since v18.2.0, v16.17.0
|
616
|
+
*/
|
617
|
+
readonly transferSize: number;
|
618
|
+
/**
|
619
|
+
* A number representing the size (in octets) received from the fetch (HTTP or cache), of the payload body, before
|
620
|
+
* removing any applied content-codings.
|
621
|
+
* @since v18.2.0, v16.17.0
|
622
|
+
*/
|
623
|
+
readonly encodedBodySize: number;
|
624
|
+
/**
|
625
|
+
* A number representing the size (in octets) received from the fetch (HTTP or cache), of the message body, after
|
626
|
+
* removing any applied content-codings.
|
627
|
+
* @since v18.2.0, v16.17.0
|
628
|
+
*/
|
629
|
+
readonly decodedBodySize: number;
|
630
|
+
/**
|
631
|
+
* Returns a `object` that is the JSON representation of the `PerformanceResourceTiming` object
|
632
|
+
* @since v18.2.0, v16.17.0
|
633
|
+
*/
|
634
|
+
toJSON(): any;
|
635
|
+
}
|
478
636
|
namespace constants {
|
479
637
|
const NODE_PERFORMANCE_GC_MAJOR: number;
|
480
638
|
const NODE_PERFORMANCE_GC_MINOR: number;
|
@@ -499,10 +657,15 @@ declare module "perf_hooks" {
|
|
499
657
|
}
|
500
658
|
interface Histogram {
|
501
659
|
/**
|
502
|
-
*
|
503
|
-
* @since
|
660
|
+
* The number of samples recorded by the histogram.
|
661
|
+
* @since v17.4.0, v16.14.0
|
504
662
|
*/
|
505
|
-
readonly
|
663
|
+
readonly count: number;
|
664
|
+
/**
|
665
|
+
* The number of samples recorded by the histogram.
|
666
|
+
* v17.4.0, v16.14.0
|
667
|
+
*/
|
668
|
+
readonly countBigInt: bigint;
|
506
669
|
/**
|
507
670
|
* The number of times the event loop delay exceeded the maximum 1 hour event
|
508
671
|
* loop delay threshold.
|
@@ -510,36 +673,67 @@ declare module "perf_hooks" {
|
|
510
673
|
*/
|
511
674
|
readonly exceeds: number;
|
512
675
|
/**
|
513
|
-
* The
|
514
|
-
* @since
|
676
|
+
* The number of times the event loop delay exceeded the maximum 1 hour event loop delay threshold.
|
677
|
+
* @since v17.4.0, v16.14.0
|
515
678
|
*/
|
516
|
-
readonly
|
679
|
+
readonly exceedsBigInt: bigint;
|
517
680
|
/**
|
518
681
|
* The maximum recorded event loop delay.
|
519
682
|
* @since v11.10.0
|
520
683
|
*/
|
521
684
|
readonly max: number;
|
685
|
+
/**
|
686
|
+
* The maximum recorded event loop delay.
|
687
|
+
* v17.4.0, v16.14.0
|
688
|
+
*/
|
689
|
+
readonly maxBigInt: number;
|
522
690
|
/**
|
523
691
|
* The mean of the recorded event loop delays.
|
524
692
|
* @since v11.10.0
|
525
693
|
*/
|
526
694
|
readonly mean: number;
|
527
695
|
/**
|
528
|
-
* The
|
696
|
+
* The minimum recorded event loop delay.
|
529
697
|
* @since v11.10.0
|
530
698
|
*/
|
531
|
-
readonly
|
699
|
+
readonly min: number;
|
532
700
|
/**
|
533
|
-
*
|
534
|
-
*
|
701
|
+
* The minimum recorded event loop delay.
|
702
|
+
* v17.4.0, v16.14.0
|
535
703
|
*/
|
536
|
-
|
704
|
+
readonly minBigInt: bigint;
|
537
705
|
/**
|
538
706
|
* Returns the value at the given percentile.
|
539
707
|
* @since v11.10.0
|
540
708
|
* @param percentile A percentile value in the range (0, 100].
|
541
709
|
*/
|
542
710
|
percentile(percentile: number): number;
|
711
|
+
/**
|
712
|
+
* Returns the value at the given percentile.
|
713
|
+
* @since v17.4.0, v16.14.0
|
714
|
+
* @param percentile A percentile value in the range (0, 100].
|
715
|
+
*/
|
716
|
+
percentileBigInt(percentile: number): bigint;
|
717
|
+
/**
|
718
|
+
* Returns a `Map` object detailing the accumulated percentile distribution.
|
719
|
+
* @since v11.10.0
|
720
|
+
*/
|
721
|
+
readonly percentiles: Map<number, number>;
|
722
|
+
/**
|
723
|
+
* Returns a `Map` object detailing the accumulated percentile distribution.
|
724
|
+
* @since v17.4.0, v16.14.0
|
725
|
+
*/
|
726
|
+
readonly percentilesBigInt: Map<bigint, bigint>;
|
727
|
+
/**
|
728
|
+
* Resets the collected histogram data.
|
729
|
+
* @since v11.10.0
|
730
|
+
*/
|
731
|
+
reset(): void;
|
732
|
+
/**
|
733
|
+
* The standard deviation of the recorded event loop delays.
|
734
|
+
* @since v11.10.0
|
735
|
+
*/
|
736
|
+
readonly stddev: number;
|
543
737
|
}
|
544
738
|
interface IntervalHistogram extends Histogram {
|
545
739
|
/**
|
@@ -564,8 +758,6 @@ declare module "perf_hooks" {
|
|
564
758
|
/**
|
565
759
|
* Calculates the amount of time (in nanoseconds) that has passed since the
|
566
760
|
* previous call to `recordDelta()` and records that amount in the histogram.
|
567
|
-
*
|
568
|
-
* ## Examples
|
569
761
|
* @since v15.9.0, v14.18.0
|
570
762
|
*/
|
571
763
|
recordDelta(): void;
|
@@ -626,11 +818,79 @@ declare module "perf_hooks" {
|
|
626
818
|
* @since v15.9.0, v14.18.0
|
627
819
|
*/
|
628
820
|
function createHistogram(options?: CreateHistogramOptions): RecordableHistogram;
|
629
|
-
import {
|
821
|
+
import {
|
822
|
+
performance as _performance,
|
823
|
+
PerformanceEntry as _PerformanceEntry,
|
824
|
+
PerformanceMark as _PerformanceMark,
|
825
|
+
PerformanceMeasure as _PerformanceMeasure,
|
826
|
+
PerformanceObserver as _PerformanceObserver,
|
827
|
+
PerformanceObserverEntryList as _PerformanceObserverEntryList,
|
828
|
+
PerformanceResourceTiming as _PerformanceResourceTiming,
|
829
|
+
} from "perf_hooks";
|
630
830
|
global {
|
631
831
|
/**
|
632
|
-
* `
|
633
|
-
* https://nodejs.org/api/globals.html#
|
832
|
+
* `PerformanceEntry` is a global reference for `require('node:perf_hooks').PerformanceEntry`
|
833
|
+
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceentry
|
834
|
+
* @since v19.0.0
|
835
|
+
*/
|
836
|
+
var PerformanceEntry: typeof globalThis extends {
|
837
|
+
onmessage: any;
|
838
|
+
PerformanceEntry: infer T;
|
839
|
+
} ? T
|
840
|
+
: typeof _PerformanceEntry;
|
841
|
+
/**
|
842
|
+
* `PerformanceMark` is a global reference for `require('node:perf_hooks').PerformanceMark`
|
843
|
+
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performancemark
|
844
|
+
* @since v19.0.0
|
845
|
+
*/
|
846
|
+
var PerformanceMark: typeof globalThis extends {
|
847
|
+
onmessage: any;
|
848
|
+
PerformanceMark: infer T;
|
849
|
+
} ? T
|
850
|
+
: typeof _PerformanceMark;
|
851
|
+
/**
|
852
|
+
* `PerformanceMeasure` is a global reference for `require('node:perf_hooks').PerformanceMeasure`
|
853
|
+
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performancemeasure
|
854
|
+
* @since v19.0.0
|
855
|
+
*/
|
856
|
+
var PerformanceMeasure: typeof globalThis extends {
|
857
|
+
onmessage: any;
|
858
|
+
PerformanceMeasure: infer T;
|
859
|
+
} ? T
|
860
|
+
: typeof _PerformanceMeasure;
|
861
|
+
/**
|
862
|
+
* `PerformanceObserver` is a global reference for `require('node:perf_hooks').PerformanceObserver`
|
863
|
+
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceobserver
|
864
|
+
* @since v19.0.0
|
865
|
+
*/
|
866
|
+
var PerformanceObserver: typeof globalThis extends {
|
867
|
+
onmessage: any;
|
868
|
+
PerformanceObserver: infer T;
|
869
|
+
} ? T
|
870
|
+
: typeof _PerformanceObserver;
|
871
|
+
/**
|
872
|
+
* `PerformanceObserverEntryList` is a global reference for `require('node:perf_hooks').PerformanceObserverEntryList`
|
873
|
+
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceobserverentrylist
|
874
|
+
* @since v19.0.0
|
875
|
+
*/
|
876
|
+
var PerformanceObserverEntryList: typeof globalThis extends {
|
877
|
+
onmessage: any;
|
878
|
+
PerformanceObserverEntryList: infer T;
|
879
|
+
} ? T
|
880
|
+
: typeof _PerformanceObserverEntryList;
|
881
|
+
/**
|
882
|
+
* `PerformanceResourceTiming` is a global reference for `require('node:perf_hooks').PerformanceResourceTiming`
|
883
|
+
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performanceresourcetiming
|
884
|
+
* @since v19.0.0
|
885
|
+
*/
|
886
|
+
var PerformanceResourceTiming: typeof globalThis extends {
|
887
|
+
onmessage: any;
|
888
|
+
PerformanceResourceTiming: infer T;
|
889
|
+
} ? T
|
890
|
+
: typeof _PerformanceResourceTiming;
|
891
|
+
/**
|
892
|
+
* `performance` is a global reference for `require('node:perf_hooks').performance`
|
893
|
+
* @see https://nodejs.org/docs/latest-v20.x/api/globals.html#performance
|
634
894
|
* @since v16.0.0
|
635
895
|
*/
|
636
896
|
var performance: typeof globalThis extends {
|
node/process.d.ts
CHANGED
@@ -433,13 +433,13 @@ declare module "process" {
|
|
433
433
|
* the same execution environment as the parent.
|
434
434
|
*
|
435
435
|
* ```bash
|
436
|
-
* node --
|
436
|
+
* node --icu-data-dir=./foo --require ./bar.js script.js --version
|
437
437
|
* ```
|
438
438
|
*
|
439
439
|
* Results in `process.execArgv`:
|
440
440
|
*
|
441
441
|
* ```js
|
442
|
-
* [
|
442
|
+
* ["--icu-data-dir=./foo", "--require", "./bar.js"]
|
443
443
|
* ```
|
444
444
|
*
|
445
445
|
* And `process.argv`:
|
@@ -1293,14 +1293,21 @@ declare module "process" {
|
|
1293
1293
|
/**
|
1294
1294
|
* Gets the amount of memory available to the process (in bytes) based on
|
1295
1295
|
* limits imposed by the OS. If there is no such constraint, or the constraint
|
1296
|
-
* is unknown, `
|
1296
|
+
* is unknown, `0` is returned.
|
1297
1297
|
*
|
1298
1298
|
* See [`uv_get_constrained_memory`](https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory) for more
|
1299
1299
|
* information.
|
1300
1300
|
* @since v19.6.0, v18.15.0
|
1301
1301
|
* @experimental
|
1302
1302
|
*/
|
1303
|
-
constrainedMemory(): number
|
1303
|
+
constrainedMemory(): number;
|
1304
|
+
/**
|
1305
|
+
* Gets the amount of free memory that is still available to the process (in bytes).
|
1306
|
+
* See [`uv_get_available_memory`](https://nodejs.org/docs/latest-v20.x/api/process.html#processavailablememory) for more information.
|
1307
|
+
* @experimental
|
1308
|
+
* @since v20.13.0
|
1309
|
+
*/
|
1310
|
+
availableMemory(): number;
|
1304
1311
|
/**
|
1305
1312
|
* The `process.cpuUsage()` method returns the user and system CPU time usage of
|
1306
1313
|
* the current process, in an object with properties `user` and `system`, whose
|
node/punycode.d.ts
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
* made available to developers as a convenience. Fixes or other modifications to
|
25
25
|
* the module must be directed to the [Punycode.js](https://github.com/bestiejs/punycode.js) project.
|
26
26
|
* @deprecated Since v7.0.0 - Deprecated
|
27
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
27
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/punycode.js)
|
28
28
|
*/
|
29
29
|
declare module "punycode" {
|
30
30
|
/**
|
node/querystring.d.ts
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
* `querystring` is more performant than `URLSearchParams` but is not a
|
10
10
|
* standardized API. Use `URLSearchParams` when performance is not critical or
|
11
11
|
* when compatibility with browser code is desirable.
|
12
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
12
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/querystring.js)
|
13
13
|
*/
|
14
14
|
declare module "querystring" {
|
15
15
|
interface StringifyOptions {
|
node/readline.d.ts
CHANGED
@@ -31,7 +31,7 @@
|
|
31
31
|
*
|
32
32
|
* Once this code is invoked, the Node.js application will not terminate until the `readline.Interface` is closed because the interface waits for data to be
|
33
33
|
* received on the `input` stream.
|
34
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
34
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/readline.js)
|
35
35
|
*/
|
36
36
|
declare module "readline" {
|
37
37
|
import { Abortable, EventEmitter } from "node:events";
|
node/repl.d.ts
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
* ```js
|
7
7
|
* const repl = require('node:repl');
|
8
8
|
* ```
|
9
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
9
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/repl.js)
|
10
10
|
*/
|
11
11
|
declare module "repl" {
|
12
12
|
import { AsyncCompleter, Completer, Interface } from "node:readline";
|
node/stream.d.ts
CHANGED
@@ -15,7 +15,7 @@
|
|
15
15
|
*
|
16
16
|
* The `node:stream` module is useful for creating new types of stream instances.
|
17
17
|
* It is usually not necessary to use the `node:stream` module to consume streams.
|
18
|
-
* @see [source](https://github.com/nodejs/node/blob/v20.
|
18
|
+
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/stream.js)
|
19
19
|
*/
|
20
20
|
declare module "stream" {
|
21
21
|
import { Abortable, EventEmitter } from "node:events";
|
@@ -272,14 +272,14 @@ declare module "stream" {
|
|
272
272
|
* });
|
273
273
|
* ```
|
274
274
|
*
|
275
|
-
* The `readable.resume()` method has no effect if there is a `'readable'`event listener.
|
275
|
+
* The `readable.resume()` method has no effect if there is a `'readable'` event listener.
|
276
276
|
* @since v0.9.4
|
277
277
|
*/
|
278
278
|
resume(): this;
|
279
279
|
/**
|
280
|
-
* The `readable.isPaused()` method returns the current operating state of the `Readable`.
|
281
|
-
* used primarily by the mechanism that underlies the `readable.pipe()` method.
|
282
|
-
* there will be no reason to use this method directly.
|
280
|
+
* The `readable.isPaused()` method returns the current operating state of the `Readable`.
|
281
|
+
* This is used primarily by the mechanism that underlies the `readable.pipe()` method.
|
282
|
+
* In most typical cases, there will be no reason to use this method directly.
|
283
283
|
*
|
284
284
|
* ```js
|
285
285
|
* const readable = new stream.Readable();
|
@@ -381,8 +381,8 @@ declare module "stream" {
|
|
381
381
|
* however it is best to simply avoid calling `readable.unshift()` while in the
|
382
382
|
* process of performing a read.
|
383
383
|
* @since v0.9.11
|
384
|
-
* @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must
|
385
|
-
* streams, `chunk` may be any JavaScript value.
|
384
|
+
* @param chunk Chunk of data to unshift onto the read queue. For streams not operating in object mode, `chunk` must
|
385
|
+
* be a {string}, {Buffer}, {TypedArray}, {DataView} or `null`. For object mode streams, `chunk` may be any JavaScript value.
|
386
386
|
* @param encoding Encoding of string chunks. Must be a valid `Buffer` encoding, such as `'utf8'` or `'ascii'`.
|
387
387
|
*/
|
388
388
|
unshift(chunk: any, encoding?: BufferEncoding): void;
|
@@ -782,8 +782,8 @@ declare module "stream" {
|
|
782
782
|
*
|
783
783
|
* A `Writable` stream in object mode will always ignore the `encoding` argument.
|
784
784
|
* @since v0.9.4
|
785
|
-
* @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string,
|
786
|
-
* JavaScript value other than `null`.
|
785
|
+
* @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
|
786
|
+
* {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
|
787
787
|
* @param [encoding='utf8'] The encoding, if `chunk` is a string.
|
788
788
|
* @param callback Callback for when this chunk of data is flushed.
|
789
789
|
* @return `false` if the stream wishes for the calling code to wait for the `'drain'` event to be emitted before continuing to write additional data; otherwise `true`.
|
@@ -813,8 +813,8 @@ declare module "stream" {
|
|
813
813
|
* // Writing more now is not allowed!
|
814
814
|
* ```
|
815
815
|
* @since v0.9.4
|
816
|
-
* @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a string,
|
817
|
-
* JavaScript value other than `null`.
|
816
|
+
* @param chunk Optional data to write. For streams not operating in object mode, `chunk` must be a {string}, {Buffer},
|
817
|
+
* {TypedArray} or {DataView}. For object mode streams, `chunk` may be any JavaScript value other than `null`.
|
818
818
|
* @param encoding The encoding if `chunk` is a string
|
819
819
|
* @param callback Callback for when the stream is finished.
|
820
820
|
*/
|
@@ -1300,8 +1300,8 @@ declare module "stream" {
|
|
1300
1300
|
* Attaches an AbortSignal to a readable or writeable stream. This lets code
|
1301
1301
|
* control stream destruction using an `AbortController`.
|
1302
1302
|
*
|
1303
|
-
* Calling `abort` on the `AbortController` corresponding to the passed `AbortSignal` will behave the same way as
|
1304
|
-
*
|
1303
|
+
* Calling `abort` on the `AbortController` corresponding to the passed `AbortSignal` will behave the same way as calling `.destroy(new AbortError())` on the
|
1304
|
+
* stream, and `controller.error(new AbortError())` for webstreams.
|
1305
1305
|
*
|
1306
1306
|
* ```js
|
1307
1307
|
* const fs = require('node:fs');
|
@@ -1417,7 +1417,7 @@ declare module "stream" {
|
|
1417
1417
|
* Especially useful in error handling scenarios where a stream is destroyed
|
1418
1418
|
* prematurely (like an aborted HTTP request), and will not emit `'end'` or `'finish'`.
|
1419
1419
|
*
|
1420
|
-
* The `finished` API provides [promise version](https://nodejs.org/docs/latest-v20.x/api/stream.html#streamfinishedstream-options).
|
1420
|
+
* The `finished` API provides [`promise version`](https://nodejs.org/docs/latest-v20.x/api/stream.html#streamfinishedstream-options).
|
1421
1421
|
*
|
1422
1422
|
* `stream.finished()` leaves dangling event listeners (in particular `'error'`, `'end'`, `'finish'` and `'close'`) after `callback` has been
|
1423
1423
|
* invoked. The reason for this is so that unexpected `'error'` events (due to
|
@@ -1505,7 +1505,7 @@ declare module "stream" {
|
|
1505
1505
|
* );
|
1506
1506
|
* ```
|
1507
1507
|
*
|
1508
|
-
* The `pipeline` API provides a [promise version](https://nodejs.org/docs/latest-v20.x/api/stream.html#streampipelinesource-transforms-destination-options).
|
1508
|
+
* The `pipeline` API provides a [`promise version`](https://nodejs.org/docs/latest-v20.x/api/stream.html#streampipelinesource-transforms-destination-options).
|
1509
1509
|
*
|
1510
1510
|
* `stream.pipeline()` will call `stream.destroy(err)` on all streams except:
|
1511
1511
|
*
|