@types/node
Advanced tools
Comparing version 22.4.1 to 22.4.2
@@ -5,3 +5,3 @@ export {}; // Make this a module | ||
// Conditional type aliases, used at the end of this file. | ||
// Will either be empty if lib-dom is included, or the undici version otherwise. | ||
// Will either be empty if lib.dom (or lib.webworker) is included, or the undici version otherwise. | ||
type _Request = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Request; | ||
@@ -21,2 +21,45 @@ type _Response = typeof globalThis extends { onmessage: any } ? {} : import("undici-types").Response; | ||
// Conditional type definitions for webstorage interface, which conflicts with lib.dom otherwise. | ||
type _Storage = typeof globalThis extends { onabort: any } ? {} : { | ||
/** | ||
* Returns the number of key/value pairs. | ||
* | ||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/length) | ||
*/ | ||
readonly length: number; | ||
/** | ||
* Removes all key/value pairs, if there are any. | ||
* | ||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/clear) | ||
*/ | ||
clear(): void; | ||
/** | ||
* Returns the current value associated with the given key, or null if the given key does not exist. | ||
* | ||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/getItem) | ||
*/ | ||
getItem(key: string): string | null; | ||
/** | ||
* Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs. | ||
* | ||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/key) | ||
*/ | ||
key(index: number): string | null; | ||
/** | ||
* Removes the key/value pair with the given key, if a key/value pair with the given key exists. | ||
* | ||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/removeItem) | ||
*/ | ||
removeItem(key: string): void; | ||
/** | ||
* Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously. | ||
* | ||
* Throws a "QuotaExceededError" DOMException exception if the new value couldn't be set. | ||
* | ||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/setItem) | ||
*/ | ||
setItem(key: string, value: string): void; | ||
[key: string]: any; | ||
}; | ||
declare global { | ||
@@ -114,50 +157,6 @@ // Declare "static" methods in Error | ||
*/ | ||
interface Storage { | ||
/** | ||
* Returns the number of key/value pairs. | ||
* | ||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/length) | ||
*/ | ||
readonly length: number; | ||
/** | ||
* Removes all key/value pairs, if there are any. | ||
* | ||
* Dispatches a storage event on Window objects holding an equivalent Storage object. | ||
* | ||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/clear) | ||
*/ | ||
clear(): void; | ||
/** | ||
* Returns the current value associated with the given key, or null if the given key does not exist. | ||
* | ||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/getItem) | ||
*/ | ||
getItem(key: string): string | null; | ||
/** | ||
* Returns the name of the nth key, or null if n is greater than or equal to the number of key/value pairs. | ||
* | ||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/key) | ||
*/ | ||
key(index: number): string | null; | ||
/** | ||
* Removes the key/value pair with the given key, if a key/value pair with the given key exists. | ||
* | ||
* Dispatches a storage event on Window objects holding an equivalent Storage object. | ||
* | ||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/removeItem) | ||
*/ | ||
removeItem(key: string): void; | ||
/** | ||
* Sets the value of the pair identified by key to value, creating a new key/value pair if none existed for key previously. | ||
* | ||
* 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.) | ||
* | ||
* Dispatches a storage event on Window objects holding an equivalent Storage object. | ||
* | ||
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Storage/setItem) | ||
*/ | ||
setItem(key: string, value: string): void; | ||
} | ||
interface Storage extends _Storage {} | ||
var Storage: typeof globalThis extends { onmessage: any; Storage: infer T } ? T | ||
// Conditional on `onabort` rather than `onmessage`, in order to exclude lib.webworker | ||
var Storage: typeof globalThis extends { onabort: any; Storage: infer T } ? T | ||
: { | ||
@@ -164,0 +163,0 @@ prototype: Storage; |
{ | ||
"name": "@types/node", | ||
"version": "22.4.1", | ||
"version": "22.4.2", | ||
"description": "TypeScript definitions for node", | ||
@@ -215,4 +215,4 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node", | ||
}, | ||
"typesPublisherContentHash": "ccc9f99822466307487be499b4c3c04a1a5f42f97b354a1afa5584dfa95e982d", | ||
"typesPublisherContentHash": "1661354099f570fd618ceda1a789867f3c8f3e5a51051679453227abe7d5b726", | ||
"typeScriptVersion": "4.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Mon, 19 Aug 2024 02:45:10 GMT | ||
* Last updated: Wed, 21 Aug 2024 01:34:14 GMT | ||
* Dependencies: [undici-types](https://npmjs.com/package/undici-types) | ||
@@ -14,0 +14,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
46
1
2110487
47351
248