@types/node 22.4.1 → 22.4.2
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/globals.d.ts +47 -48
- node/package.json +2 -2
node/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (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:
|
11
|
+
* Last updated: Wed, 21 Aug 2024 01:34:14 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
node/globals.d.ts
CHANGED
@@ -2,7 +2,7 @@ export {}; // Make this a module
|
|
2
2
|
|
3
3
|
// #region Fetch and friends
|
4
4
|
// Conditional type aliases, used at the end of this file.
|
5
|
-
// Will either be empty if lib
|
5
|
+
// Will either be empty if lib.dom (or lib.webworker) is included, or the undici version otherwise.
|
6
6
|
type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request;
|
7
7
|
type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response;
|
8
8
|
type _FormData = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").FormData;
|
@@ -17,6 +17,49 @@ type _WebSocket = typeof globalThis extends { onmessage: any } ? {} : import("un
|
|
17
17
|
type _EventSource = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").EventSource;
|
18
18
|
// #endregion Fetch and friends
|
19
19
|
|
20
|
+
// Conditional type definitions for webstorage interface, which conflicts with lib.dom otherwise.
|
21
|
+
type _Storage = typeof globalThis extends { onabort: any } ? {} : {
|
22
|
+
/**
|
23
|
+
* Returns the number of key/value pairs.
|
24
|
+
*
|
25
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/length)
|
26
|
+
*/
|
27
|
+
readonly length: number;
|
28
|
+
/**
|
29
|
+
* Removes all key/value pairs, if there are any.
|
30
|
+
*
|
31
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/clear)
|
32
|
+
*/
|
33
|
+
clear(): void;
|
34
|
+
/**
|
35
|
+
* Returns the current value associated with the given key, or null if the given key does not exist.
|
36
|
+
*
|
37
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/getItem)
|
38
|
+
*/
|
39
|
+
getItem(key: string): string | null;
|
40
|
+
/**
|
41
|
+
* Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs.
|
42
|
+
*
|
43
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/key)
|
44
|
+
*/
|
45
|
+
key(index: number): string | null;
|
46
|
+
/**
|
47
|
+
* Removes the key/value pair with the given key, if a key/value pair with the given key exists.
|
48
|
+
*
|
49
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/removeItem)
|
50
|
+
*/
|
51
|
+
removeItem(key: string): void;
|
52
|
+
/**
|
53
|
+
* Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
|
54
|
+
*
|
55
|
+
* Throws a "QuotaExceededError" DOMException exception if the new value couldn't be set.
|
56
|
+
*
|
57
|
+
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/setItem)
|
58
|
+
*/
|
59
|
+
setItem(key: string, value: string): void;
|
60
|
+
[key: string]: any;
|
61
|
+
};
|
62
|
+
|
20
63
|
declare global {
|
21
64
|
// Declare "static" methods in Error
|
22
65
|
interface ErrorConstructor {
|
@@ -109,54 +152,10 @@ declare global {
|
|
109
152
|
*
|
110
153
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage)
|
111
154
|
*/
|
112
|
-
interface Storage {
|
113
|
-
/**
|
114
|
-
* Returns the number of key/value pairs.
|
115
|
-
*
|
116
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/length)
|
117
|
-
*/
|
118
|
-
readonly length: number;
|
119
|
-
/**
|
120
|
-
* Removes all key/value pairs, if there are any.
|
121
|
-
*
|
122
|
-
* Dispatches a storage event on Window objects holding an equivalent Storage object.
|
123
|
-
*
|
124
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/clear)
|
125
|
-
*/
|
126
|
-
clear(): void;
|
127
|
-
/**
|
128
|
-
* Returns the current value associated with the given key, or null if the given key does not exist.
|
129
|
-
*
|
130
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/getItem)
|
131
|
-
*/
|
132
|
-
getItem(key: string): string | null;
|
133
|
-
/**
|
134
|
-
* Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs.
|
135
|
-
*
|
136
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/key)
|
137
|
-
*/
|
138
|
-
key(index: number): string | null;
|
139
|
-
/**
|
140
|
-
* Removes the key/value pair with the given key, if a key/value pair with the given key exists.
|
141
|
-
*
|
142
|
-
* Dispatches a storage event on Window objects holding an equivalent Storage object.
|
143
|
-
*
|
144
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/removeItem)
|
145
|
-
*/
|
146
|
-
removeItem(key: string): void;
|
147
|
-
/**
|
148
|
-
* Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously.
|
149
|
-
*
|
150
|
-
* Throws a "QuotaExceededError" DOMException exception if the new value couldn't be set. (Setting could fail if, e.g., the user has disabled storage for the site, or if the quota has been exceeded.)
|
151
|
-
*
|
152
|
-
* Dispatches a storage event on Window objects holding an equivalent Storage object.
|
153
|
-
*
|
154
|
-
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/setItem)
|
155
|
-
*/
|
156
|
-
setItem(key: string, value: string): void;
|
157
|
-
}
|
155
|
+
interface Storage extends _Storage {}
|
158
156
|
|
159
|
-
|
157
|
+
// Conditional on `onabort` rather than `onmessage`, in order to exclude lib.webworker
|
158
|
+
var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T
|
160
159
|
: {
|
161
160
|
prototype: Storage;
|
162
161
|
new(): Storage;
|
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "22.4.
|
3
|
+
"version": "22.4.2",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -212,6 +212,6 @@
|
|
212
212
|
"dependencies": {
|
213
213
|
"undici-types": "~6.19.2"
|
214
214
|
},
|
215
|
-
"typesPublisherContentHash": "
|
215
|
+
"typesPublisherContentHash": "1661354099f570fd618ceda1a789867f3c8f3e5a51051679453227abe7d5b726",
|
216
216
|
"typeScriptVersion": "4.8"
|
217
217
|
}
|