@types/node 14.10.0 → 14.10.1

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 CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (http://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 10 Sep 2020 17:17:10 GMT
11
+ * Last updated: Fri, 11 Sep 2020 16:36:27 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`, `Symbol`
14
14
 
node/assert.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  declare module "assert" {
2
+ /** An alias of `assert.ok()`. */
2
3
  function assert(value: any, message?: string | Error): asserts value;
3
4
  namespace assert {
4
5
  class AssertionError implements Error {
@@ -11,11 +12,37 @@ declare module "assert" {
11
12
  code: 'ERR_ASSERTION';
12
13
 
13
14
  constructor(options?: {
14
- message?: string; actual?: any; expected?: any;
15
- operator?: string; stackStartFn?: Function
15
+ /** If provided, the error message is set to this value. */
16
+ message?: string;
17
+ /** The `actual` property on the error instance. */
18
+ actual?: any;
19
+ /** The `expected` property on the error instance. */
20
+ expected?: any;
21
+ /** The `operator` property on the error instance. */
22
+ operator?: string;
23
+ /** If provided, the generated stack trace omits frames before this function. */
24
+ stackStartFn?: Function
16
25
  });
17
26
  }
18
27
 
28
+ class CallTracker {
29
+ calls(exact?: number): () => void;
30
+ calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
31
+ report(): CallTrackerReportInformation[];
32
+ verify(): void;
33
+ }
34
+ export interface CallTrackerReportInformation {
35
+ message: string;
36
+ /** The actual number of times the function was called. */
37
+ actual: number;
38
+ /** The number of times the function was expected to be called. */
39
+ expected: number;
40
+ /** The name of the function that is wrapped. */
41
+ operator: string;
42
+ /** A stack trace of the function. */
43
+ stack: object;
44
+ }
45
+
19
46
  type AssertPredicate = RegExp | (new() => object) | ((thrown: any) => boolean) | object | Error;
20
47
 
21
48
  function fail(message?: string | Error): never;
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "14.10.0",
3
+ "version": "14.10.1",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "license": "MIT",
6
6
  "contributors": [
@@ -246,6 +246,6 @@
246
246
  },
247
247
  "scripts": {},
248
248
  "dependencies": {},
249
- "typesPublisherContentHash": "1f84a9f206134885334a6e49e5126f4c6c26bf59a9d8d74d48900d8f383df7fb",
249
+ "typesPublisherContentHash": "b022f3ba74691f5df061333d238cc0b27b5f5a9bd8dadfeb49c0c8cfb41527a6",
250
250
  "typeScriptVersion": "3.1"
251
251
  }
@@ -115,6 +115,19 @@ declare module "async_hooks" {
115
115
  */
116
116
  constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
117
117
 
118
+ /**
119
+ * Binds the given function to the current execution context.
120
+ * @param fn The function to bind to the current execution context.
121
+ * @param type An optional name to associate with the underlying `AsyncResource`.
122
+ */
123
+ static bind<Func extends (...args: any[]) => any>(fn: Func, type?: string): Func & { asyncResource: AsyncResource };
124
+
125
+ /**
126
+ * Binds the given function to execute to this `AsyncResource`'s scope.
127
+ * @param fn The function to bind to the current `AsyncResource`.
128
+ */
129
+ bind<Func extends (...args: any[]) => any>(fn: Func): Func & { asyncResource: AsyncResource };
130
+
118
131
  /**
119
132
  * Call the provided function with the provided arguments in the
120
133
  * execution context of the async resource. This will establish the
node/ts3.1/crypto.d.ts CHANGED
@@ -408,6 +408,7 @@ declare module "crypto" {
408
408
  function privateEncrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
409
409
  function getCiphers(): string[];
410
410
  function getCurves(): string[];
411
+ function getFips(): 1 | 0;
411
412
  function getHashes(): string[];
412
413
  class ECDH {
413
414
  private constructor();
node/ts3.1/globals.d.ts CHANGED
@@ -576,7 +576,8 @@ declare namespace NodeJS {
576
576
  id: string;
577
577
  filename: string;
578
578
  loaded: boolean;
579
- parent: Module | null;
579
+ /** @deprecated since 14.6.0 Please use `require.main` and `module.children` instead. */
580
+ parent: Module | null | undefined;
580
581
  children: Module[];
581
582
  /**
582
583
  * @since 11.14.0
@@ -48,74 +48,43 @@ declare module 'perf_hooks' {
48
48
  readonly bootstrapComplete: number;
49
49
 
50
50
  /**
51
- * The high resolution millisecond timestamp at which cluster processing ended.
51
+ * The high resolution millisecond timestamp at which the Node.js process completed bootstrapping.
52
+ * If bootstrapping has not yet finished, the property has the value of -1.
52
53
  */
53
- readonly clusterSetupEnd: number;
54
+ readonly environment: number;
54
55
 
55
56
  /**
56
- * The high resolution millisecond timestamp at which cluster processing started.
57
+ * The high resolution millisecond timestamp at which the Node.js environment was initialized.
57
58
  */
58
- readonly clusterSetupStart: number;
59
+ readonly idleTime: number;
59
60
 
60
61
  /**
61
- * The high resolution millisecond timestamp at which the Node.js event loop exited.
62
+ * The high resolution millisecond timestamp of the amount of time the event loop has been idle
63
+ * within the event loop's event provider (e.g. `epoll_wait`). This does not take CPU usage
64
+ * into consideration. If the event loop has not yet started (e.g., in the first tick of the main script),
65
+ * the property has the value of 0.
62
66
  */
63
67
  readonly loopExit: number;
64
68
 
65
69
  /**
66
70
  * The high resolution millisecond timestamp at which the Node.js event loop started.
71
+ * If the event loop has not yet started (e.g., in the first tick of the main script), the property has the value of -1.
67
72
  */
68
73
  readonly loopStart: number;
69
74
 
70
- /**
71
- * The high resolution millisecond timestamp at which main module load ended.
72
- */
73
- readonly moduleLoadEnd: number;
74
-
75
- /**
76
- * The high resolution millisecond timestamp at which main module load started.
77
- */
78
- readonly moduleLoadStart: number;
79
-
80
- /**
81
- * The high resolution millisecond timestamp at which the Node.js process was initialized.
82
- */
83
- readonly nodeStart: number;
84
-
85
- /**
86
- * The high resolution millisecond timestamp at which preload module load ended.
87
- */
88
- readonly preloadModuleLoadEnd: number;
89
-
90
- /**
91
- * The high resolution millisecond timestamp at which preload module load started.
92
- */
93
- readonly preloadModuleLoadStart: number;
94
-
95
- /**
96
- * The high resolution millisecond timestamp at which third_party_main processing ended.
97
- */
98
- readonly thirdPartyMainEnd: number;
99
-
100
- /**
101
- * The high resolution millisecond timestamp at which third_party_main processing started.
102
- */
103
- readonly thirdPartyMainStart: number;
104
-
105
75
  /**
106
76
  * The high resolution millisecond timestamp at which the V8 platform was initialized.
107
77
  */
108
78
  readonly v8Start: number;
109
79
  }
110
80
 
111
- interface Performance {
112
- /**
113
- * If name is not provided, removes all PerformanceFunction objects from the Performance Timeline.
114
- * If name is provided, removes entries with name.
115
- * @param name
116
- */
117
- clearFunctions(name?: string): void;
81
+ interface EventLoopUtilization {
82
+ idle: number;
83
+ active: number;
84
+ utilization: number;
85
+ }
118
86
 
87
+ interface Performance {
119
88
  /**
120
89
  * If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
121
90
  * If name is provided, removes only the named mark.
@@ -123,35 +92,6 @@ declare module 'perf_hooks' {
123
92
  */
124
93
  clearMarks(name?: string): void;
125
94
 
126
- /**
127
- * If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline.
128
- * If name is provided, removes only objects whose performanceEntry.name matches name.
129
- */
130
- clearMeasures(name?: string): void;
131
-
132
- /**
133
- * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime.
134
- * @return list of all PerformanceEntry objects
135
- */
136
- getEntries(): PerformanceEntry[];
137
-
138
- /**
139
- * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
140
- * whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type.
141
- * @param name
142
- * @param type
143
- * @return list of all PerformanceEntry objects
144
- */
145
- getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
146
-
147
- /**
148
- * Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
149
- * whose performanceEntry.entryType is equal to type.
150
- * @param type
151
- * @return list of all PerformanceEntry objects
152
- */
153
- getEntriesByType(type: EntryType): PerformanceEntry[];
154
-
155
95
  /**
156
96
  * Creates a new PerformanceMark entry in the Performance Timeline.
157
97
  * A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark',
@@ -199,6 +139,16 @@ declare module 'perf_hooks' {
199
139
  * @param fn
200
140
  */
201
141
  timerify<T extends (...optionalParams: any[]) => any>(fn: T): T;
142
+
143
+ /**
144
+ * eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
145
+ * It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait).
146
+ * No other CPU idle time is taken into consideration.
147
+ *
148
+ * @param util1 The result of a previous call to eventLoopUtilization()
149
+ * @param util2 The result of a previous call to eventLoopUtilization() prior to util1
150
+ */
151
+ eventLoopUtilization(util1?: EventLoopUtilization, util2?: EventLoopUtilization): EventLoopUtilization;
202
152
  }
203
153
 
204
154
  interface PerformanceObserverEntryList {
node/ts3.1/process.d.ts CHANGED
@@ -245,6 +245,8 @@ declare module "process" {
245
245
  title: string;
246
246
  arch: string;
247
247
  platform: Platform;
248
+ /** @deprecated since v14.0.0 - use `require.main` instead. */
249
+ mainModule?: Module;
248
250
  memoryUsage(): MemoryUsage;
249
251
  cpuUsage(previousValue?: CpuUsage): CpuUsage;
250
252
  nextTick(callback: Function, ...args: any[]): void;
@@ -259,6 +261,12 @@ declare module "process" {
259
261
  tls_ocsp: boolean;
260
262
  tls: boolean;
261
263
  };
264
+ /**
265
+ * @deprecated since v14.0.0 - Calling process.umask() with no argument causes
266
+ * the process-wide umask to be written twice. This introduces a race condition between threads,
267
+ * and is a potential security vulnerability. There is no safe, cross-platform alternative API.
268
+ */
269
+ umask(): number;
262
270
  /**
263
271
  * Can only be set if not in worker thread.
264
272
  */