Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions types/chrome/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10047,10 +10047,8 @@ declare namespace chrome {
*
* Can return its result via Promise in Manifest V3 or later since Chrome 95.
*/
getBytesInUse(keys: never[]): Promise<0>;
getBytesInUse<T = { [key: string]: any }>(keys?: keyof T | Array<keyof T> | null): Promise<number>;
getBytesInUse<T = { [key: string]: any }>(callback: (bytesInUse: number) => void): void;
getBytesInUse(keys: never[], callback: (bytesInUse: 0) => void): void;
getBytesInUse<T = { [key: string]: any }>(
keys: keyof T | Array<keyof T> | null | undefined,
callback: (bytesInUse: number) => void,
Expand Down Expand Up @@ -10088,12 +10086,10 @@ declare namespace chrome {
*
* Can return its result via Promise in Manifest V3 or later since Chrome 95.
*/
get(keys: never[] | Record<string, never>): Promise<{ [key: string]: never }>;
get<T = { [key: string]: unknown }>(
keys?: NoInferX<keyof T> | Array<NoInferX<keyof T>> | Partial<NoInferX<T>> | null,
): Promise<T>;
get<T = { [key: string]: unknown }>(callback: (items: T) => void): void;
get(keys: never[] | Record<string, never>, callback: (items: { [key: string]: never }) => void): void;
get<T = { [key: string]: unknown }>(
keys: NoInferX<keyof T> | Array<NoInferX<keyof T>> | Partial<NoInferX<T>> | null | undefined,
callback: (items: T) => void,
Expand Down
12 changes: 0 additions & 12 deletions types/chrome/test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1374,9 +1374,7 @@ function testStorage() {
chrome.storage[area].get(); // $ExpectType Promise<{ [key: string]: unknown; }>
chrome.storage[area].get(null); // $ExpectType Promise<{ [key: string]: unknown; }>
chrome.storage[area].get(key); // $ExpectType Promise<{ [key: string]: unknown; }>
chrome.storage[area].get([]); // $ExpectType Promise<{ [key: string]: never; }>
chrome.storage[area].get([key]); // $ExpectType Promise<{ [key: string]: unknown; }>
chrome.storage[area].get({}); // $ExpectType Promise<{ [key: string]: never; }>
chrome.storage[area].get({ key }); // $ExpectType Promise<{ [key: string]: unknown; }>
chrome.storage[area].get(badKey); // $ExpectType Promise<{ [key: string]: unknown; }>
chrome.storage[area].get<StorageData>(key); // $ExpectType Promise<StorageData>
Expand All @@ -1389,18 +1387,12 @@ function testStorage() {
chrome.storage[area].get(key, (items) => { // $ExpectType void
items; // $ExpectType { [key: string]: unknown; }
});
chrome.storage[area].get([], (items) => { // $ExpectType void
items; // $ExpectType { [key: string]: never; }
});
chrome.storage[area].get([key], (items) => { // $ExpectType void
items; // $ExpectType { [key: string]: unknown; }
});
chrome.storage[area].get({ key }, (items) => { // $ExpectType void
items; // $ExpectType { [key: string]: unknown; }
});
chrome.storage[area].get({}, (items) => { // $ExpectType void
items; // $ExpectType { [key: string]: never; }
});
chrome.storage[area].get(badKey, (items) => { // $ExpectType void
items; // $ExpectType { [key: string]: unknown; }
});
Expand All @@ -1416,7 +1408,6 @@ function testStorage() {
chrome.storage[area].getBytesInUse(null); // $ExpectType Promise<number>
chrome.storage[area].getBytesInUse(key); // $ExpectType Promise<number>
chrome.storage[area].getBytesInUse([key]); // $ExpectType Promise<number>
chrome.storage[area].getBytesInUse([]); // $ExpectType Promise<0>
chrome.storage[area].getBytesInUse(badKey); // $ExpectType Promise<number>
chrome.storage[area].getBytesInUse<StorageData>(key); // $ExpectType Promise<number>
chrome.storage[area].getBytesInUse<StorageData>(key); // $ExpectType Promise<number>
Expand All @@ -1432,9 +1423,6 @@ function testStorage() {
chrome.storage[area].getBytesInUse([key], (bytesInUse) => { // $ExpectType void
bytesInUse; // $ExpectType number
});
chrome.storage[area].getBytesInUse([], (bytesInUse) => { // $ExpectType void
bytesInUse; // $ExpectType 0
});
chrome.storage[area].getBytesInUse(badKey, (bytesInUse) => { // $ExpectType void
bytesInUse; // $ExpectType number
});
Expand Down