@types/node 18.7.6 → 18.7.7

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 (3) hide show
  1. node/README.md +1 -1
  2. node/globals.d.ts +23 -0
  3. node/package.json +2 -2
node/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://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: Tue, 16 Aug 2022 14:02:31 GMT
11
+ * Last updated: Fri, 19 Aug 2022 18:02:30 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
node/globals.d.ts CHANGED
@@ -1,5 +1,28 @@
1
+ // Error extensions
2
+ interface Error {
3
+ /**
4
+ * If present, the `error.cause` property is the underlying cause of the `Error`.
5
+ * It is used when catching an error and throwing a new one with a different message or code in order to still have access to the original error.
6
+ * @added v16.9.0
7
+ */
8
+ cause?: unknown;
9
+ }
10
+
11
+ /**
12
+ * @added v16.9.0
13
+ */
14
+ interface ErrorOptions {
15
+ /**
16
+ * The error that caused the newly created error.
17
+ * @added v16.9.0
18
+ */
19
+ cause?: unknown;
20
+ }
21
+
1
22
  // Declare "static" methods in Error
2
23
  interface ErrorConstructor {
24
+ new(message?: string, options?: ErrorOptions): Error;
25
+ (message?: string, options?: ErrorOptions): Error;
3
26
  /** Create .stack property on a target object */
4
27
  captureStackTrace(targetObject: object, constructorOpt?: Function): void;
5
28
 
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.7.6",
3
+ "version": "18.7.7",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -220,6 +220,6 @@
220
220
  },
221
221
  "scripts": {},
222
222
  "dependencies": {},
223
- "typesPublisherContentHash": "cd432c68b37a5e2bdfd29e94c83191aa3220708137ac9cad45a6d88d2f8f9b17",
223
+ "typesPublisherContentHash": "acf91b0fd256bde0d7f2f68ab089d78ef6d172c3e2ff4264b6a45f22e4af4c63",
224
224
  "typeScriptVersion": "4.0"
225
225
  }