fix: Upgrade @wxt-dev/browser to latest @types/chrome version

This commit is contained in:
aklinker1
2025-08-11 23:42:47 +00:00
committed by github-actions[bot]
parent 8b3e35de94
commit 74a9b1aef4
3 changed files with 100 additions and 166 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
{
"name": "@wxt-dev/browser",
"description": "Provides a cross-browser API for using extension APIs and types based on @types/chrome",
"version": "0.1.1",
"version": "0.1.3",
"type": "module",
"main": "src/index.mjs",
"types": "src/index.d.ts",
@@ -23,7 +23,7 @@
"src"
],
"devDependencies": {
"@types/chrome": "0.1.1",
"@types/chrome": "0.1.3",
"fs-extra": "^11.3.0",
"nano-spawn": "^0.2.0",
"tsx": "4.19.4",
+93 -159
View File
@@ -1088,267 +1088,209 @@ export namespace Browser {
*/
export namespace browsingData {
export interface OriginTypes {
/** Optional. Extensions and packaged applications a user has installed (be _really_ careful!). */
/** Extensions and packaged applications a user has installed (be _really_ careful!). */
extension?: boolean | undefined;
/** Optional. Websites that have been installed as hosted applications (be careful!). */
/** Websites that have been installed as hosted applications (be careful!). */
protectedWeb?: boolean | undefined;
/** Optional. Normal websites. */
/** Normal websites. */
unprotectedWeb?: boolean | undefined;
}
/** Options that determine exactly what data will be removed. */
export interface RemovalOptions {
/**
* Optional.
* When present, data for origins in this list is excluded from deletion. Can't be used together with `origins`. Only supported for cookies, storage and cache. Cookies are excluded for the whole registrable domain.
* @since Chrome 74
* When present, data for origins in this list is excluded from deletion. Can't be used together with origins. Only supported for cookies, storage and cache. Cookies are excluded for the whole registrable domain.
*/
excludeOrigins?: string[] | undefined;
/**
* Optional.
* An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you _really_ want to remove application data before adding 'protectedWeb' or 'extensions'.
*/
/** An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you _really_ want to remove application data before adding 'protectedWeb' or 'extensions'. */
originTypes?: OriginTypes | undefined;
/**
* Optional.
* @since Chrome 74
* When present, only data for origins in this list is deleted. Only supported for cookies, storage and cache. Cookies are cleared for the whole registrable domain.
* @since Chrome 74
*/
origins?: string[] | undefined;
/**
* Optional.
* Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the {@link Date.getTime} method). If absent, defaults to 0 (which would remove all browsing data).
*/
origins?: [string, ...string[]] | undefined;
/** Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the {@link Date.getTime getTime} method of the JavaScript `Date` object). If absent, defaults to 0 (which would remove all browsing data). */
since?: number | undefined;
}
/**
* @since Chrome 27
* A set of data types. Missing data types are interpreted as false.
*/
/** A set of data types. Missing data types are interpreted as `false`. */
export interface DataTypeSet {
/** Optional. Websites' WebSQL data. */
/** Websites' WebSQL data. */
webSQL?: boolean | undefined;
/** Optional. Websites' IndexedDB data. */
/** Websites' IndexedDB data. */
indexedDB?: boolean | undefined;
/** Optional. The browser's cookies. */
/** The browser's cookies. */
cookies?: boolean | undefined;
/** Optional. Stored passwords. */
/** Stored passwords. */
passwords?: boolean | undefined;
/**
* @deprecated Deprecated since Chrome 76.
* Support for server-bound certificates has been removed. This data type will be ignored.
*
* Optional. Server-bound certificates.
* Server-bound certificates.
* @deprecated since Chrome 76. Support for server-bound certificates has been removed. This data type will be ignored.
*/
serverBoundCertificates?: boolean | undefined;
/** Optional. The browser's download list. */
/** The browser's download list. */
downloads?: boolean | undefined;
/** Optional. The browser's cache. Note: when removing data, this clears the entire cache: it is not limited to the range you specify. */
/** The browser's cache. */
cache?: boolean | undefined;
/** Optional. The browser's cacheStorage. */
/** Cache storage. */
cacheStorage?: boolean | undefined;
/** Optional. Websites' appcaches. */
/** Websites' appcaches. */
appcache?: boolean | undefined;
/** Optional. Websites' file systems. */
/** Websites' file systems. */
fileSystems?: boolean | undefined;
/**
* @deprecated Deprecated since Chrome 88.
* Support for Flash has been removed. This data type will be ignored.
*
* Optional. Plugins' data.
* Plugins' data.
* @deprecated since Chrome 88. Support for Flash has been removed. This data type will be ignored.
*/
pluginData?: boolean | undefined;
/** Optional. Websites' local storage data. */
/** Websites' local storage data. */
localStorage?: boolean | undefined;
/** Optional. The browser's stored form data. */
/** The browser's stored form data. */
formData?: boolean | undefined;
/** Optional. The browser's history. */
/** The browser's history. */
history?: boolean | undefined;
/**
* Optional.
* @since Chrome 39
* Service Workers.
*/
/** Service Workers. */
serviceWorkers?: boolean | undefined;
}
export interface SettingsResult {
options: RemovalOptions;
/** All of the types will be present in the result, with values of true if they are both selected to be removed and permitted to be removed, otherwise false. */
/** All of the types will be present in the result, with values of `true` if they are both selected to be removed and permitted to be removed, otherwise `false`. */
dataToRemove: DataTypeSet;
/** All of the types will be present in the result, with values of true if they are permitted to be removed (e.g., by enterprise policy) and false if not. */
/** All of the types will be present in the result, with values of `true` if they are permitted to be removed (e.g., by enterprise policy) and `false` if not. */
dataRemovalPermitted: DataTypeSet;
}
/**
* @since Chrome 26
* Reports which types of data are currently selected in the 'Clear browsing data' settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here.
* @return The `settings` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function settings(): Promise<SettingsResult>;
/**
* @since Chrome 26
* Reports which types of data are currently selected in the 'Clear browsing data' settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here.
*/
export function settings(callback: (result: SettingsResult) => void): void;
/**
* @deprecated Deprecated since Chrome 88.
* Support for Flash has been removed. This function has no effect.
*
* Clears plugins' data.
* @return The `removePluginData` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
* @deprecated since Chrome 88. Support for Flash has been removed. This function has no effect
*/
export function removePluginData(options: RemovalOptions): Promise<void>;
/**
* @deprecated Deprecated since Chrome 88.
* Support for Flash has been removed. This function has no effect.
*
* Clears plugins' data.
* @param callback Called when plugins' data has been cleared.
*/
export function removePluginData(options: RemovalOptions, callback: () => void): void;
/**
* @since Chrome 72
* Clears websites' service workers.
* @return The `removeServiceWorkers` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
* @since Chrome 72
*/
export function removeServiceWorkers(options: RemovalOptions): Promise<void>;
/**
* @since Chrome 72
* Clears websites' service workers.
* @param callback Called when the browser's service workers have been cleared.
*/
export function removeServiceWorkers(options: RemovalOptions, callback: () => void): void;
/**
* Clears the browser's stored form data (autofill).
* @return The `removeFormData` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function removeFormData(options: RemovalOptions): Promise<void>;
/**
* Clears the browser's stored form data (autofill).
* @param callback Called when the browser's form data has been cleared.
*/
export function removeFormData(options: RemovalOptions, callback: () => void): void;
/**
* Clears websites' file system data.
* @return The `removeFileSystems` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function removeFileSystems(options: RemovalOptions): Promise<void>;
/**
* Clears websites' file system data.
* @param callback Called when websites' file systems have been cleared.
*/
export function removeFileSystems(options: RemovalOptions, callback: () => void): void;
/**
* Clears various types of browsing data stored in a user's profile.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
* @param dataToRemove The set of data types to remove.
* @return The `remove` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*/
export function remove(options: RemovalOptions, dataToRemove: DataTypeSet): Promise<void>;
/**
* Clears various types of browsing data stored in a user's profile.
* @param dataToRemove The set of data types to remove.
* @param callback Called when deletion has completed.
*/
export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback: () => void): void;
/**
* Clears the browser's stored passwords.
* @return The `removePasswords` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function removePasswords(options: RemovalOptions): Promise<void>;
/**
* Clears the browser's stored passwords.
* @param callback Called when the browser's passwords have been cleared.
*/
export function removePasswords(options: RemovalOptions, callback: () => void): void;
/**
* Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
* @return The `removeCookies` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function removeCookies(options: RemovalOptions): Promise<void>;
/**
* Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
* @param callback Called when the browser's cookies and server-bound certificates have been cleared.
*/
export function removeCookies(options: RemovalOptions, callback: () => void): void;
/**
* Clears websites' WebSQL data.
* @return The `removeWebSQL` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function removeWebSQL(options: RemovalOptions): Promise<void>;
/**
* Clears websites' WebSQL data.
* @param callback Called when websites' WebSQL databases have been cleared.
*/
export function removeWebSQL(options: RemovalOptions, callback: () => void): void;
/**
* Clears websites' appcache data.
* @return The `removeAppcache` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function removeAppcache(options: RemovalOptions): Promise<void>;
/**
* Clears websites' appcache data.
* @param callback Called when websites' appcache data has been cleared.
*/
export function removeAppcache(options: RemovalOptions, callback: () => void): void;
/** Clears websites' cache storage data.
* @return The `removeCacheStorage` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
/**
* Clears websites' cache storage data.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function removeCacheStorage(options: RemovalOptions): Promise<void>;
/** Clears websites' cache storage data.
* @param callback Called when websites' appcache data has been cleared.
*/
export function removeCacheStorage(options: RemovalOptions, callback: () => void): void;
/**
* Clears the browser's list of downloaded files (not the downloaded files themselves).
* @return The `removeDownloads` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function removeDownloads(options: RemovalOptions): Promise<void>;
/**
* Clears the browser's list of downloaded files (not the downloaded files themselves).
* @param callback Called when the browser's list of downloaded files has been cleared.
*/
export function removeDownloads(options: RemovalOptions, callback: () => void): void;
/**
* Clears websites' local storage data.
* @return The `removeLocalStorage` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function removeLocalStorage(options: RemovalOptions): Promise<void>;
/**
* Clears websites' local storage data.
* @param callback Called when websites' local storage has been cleared.
*/
export function removeLocalStorage(options: RemovalOptions, callback: () => void): void;
/**
* Clears the browser's cache.
* @return The `removeCache` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function removeCache(options: RemovalOptions): Promise<void>;
/**
* Clears the browser's cache.
* @param callback Called when the browser's cache has been cleared.
*/
export function removeCache(options: RemovalOptions, callback: () => void): void;
/**
* Clears the browser's history.
* @return The `removeHistory` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function removeHistory(options: RemovalOptions): Promise<void>;
/**
* Clears the browser's history.
* @param callback Called when the browser's history has cleared.
*/
export function removeHistory(options: RemovalOptions, callback: () => void): void;
/**
* Clears websites' IndexedDB data.
* @return The `removeIndexedDB` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function removeIndexedDB(options: RemovalOptions): Promise<void>;
/**
* Clears websites' IndexedDB data.
* @param callback Called when websites' IndexedDB data has been cleared.
*/
export function removeIndexedDB(options: RemovalOptions, callback: () => void): void;
}
@@ -1602,29 +1544,24 @@ export namespace Browser {
*/
export namespace commands {
export interface Command {
/** Optional. The name of the Extension Command */
name?: string | undefined;
/** Optional. The Extension Command description */
description?: string | undefined;
/** Optional. The shortcut active for this command, or blank if not active. */
shortcut?: string | undefined;
/** The name of the Extension Command */
name?: string;
/** The Extension Command description */
description?: string;
/** The shortcut active for this command, or blank if not active. */
shortcut?: string;
}
export interface CommandEvent extends Browser.events.Event<(command: string, tab: Browser.tabs.Tab) => void> {}
/**
* Returns all the registered extension commands for this extension and their shortcut (if active).
* @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
* Returns all the registered extension commands for this extension and their shortcut (if active). Before Chrome 110, this command did not return `_execute_action`.
*
* Can return its result via Promise in Manifest V3 or later since Chrome 96.
*/
export function getAll(): Promise<Command[]>;
/**
* Returns all the registered extension commands for this extension and their shortcut (if active).
* @param callback Called to return the registered commands.
*/
export function getAll(callback: (commands: Command[]) => void): void;
/** Fired when a registered command is activated using a keyboard shortcut. */
export var onCommand: CommandEvent;
export const onCommand: events.Event<(command: string, tab?: tabs.Tab) => void>;
}
////////////////////
@@ -2928,7 +2865,7 @@ export namespace Browser {
export interface PanelSearchEvent extends Browser.events.Event<(action: string, queryString?: string) => void> {}
/** Represents a panel created by extension. */
/** Represents a panel created by an extension. */
export interface ExtensionPanel {
/**
* Appends a button to the status bar of the panel.
@@ -8345,10 +8282,7 @@ export namespace Browser {
*/
relatedWebsiteSetsEnabled: Browser.types.ChromeSetting<boolean>;
/**
* If disabled, Chrome blocks third-party sites from setting cookies.
* The value of this preference is of type boolean, and the default value is `true`.
*/
/** If disabled, Chrome blocks third-party sites from setting cookies. The value of this preference is of type boolean, and the default value is `true`. Extensions may not enable this API in Incognito mode, where third-party cookies are blocked and can only be allowed at the site level. If you try setting this API to true in Incognito, it will throw an error. */
thirdPartyCookiesAllowed: Browser.types.ChromeSetting<boolean>;
/**
@@ -9917,14 +9851,14 @@ export namespace Browser {
*/
get<T = { [key: string]: any }>(callback: (items: T) => void): void;
/**
* Sets the desired access level for the storage area. The default will be only trusted contexts.
* Sets the desired access level for the storage area. By default, session storage is restricted to trusted contexts (extension pages and service workers), while managed, local, and sync storage allow access from both trusted and untrusted contexts.
* @param accessOptions An object containing an accessLevel key which contains the access level of the storage area.
* @return A void Promise.
* @since Chrome 102
*/
setAccessLevel(accessOptions: { accessLevel: AccessLevel }): Promise<void>;
/**
* Sets the desired access level for the storage area. The default will be only trusted contexts.
* Sets the desired access level for the storage area. By default, session storage is restricted to trusted contexts (extension pages and service workers), while managed, local, and sync storage allow access from both trusted and untrusted contexts.
* @param accessOptions An object containing an accessLevel key which contains the access level of the storage area.
* @param callback Optional.
* @since Chrome 102
+5 -5
View File
@@ -170,8 +170,8 @@ importers:
version: 1.2.15
devDependencies:
'@types/chrome':
specifier: 0.1.1
version: 0.1.1
specifier: 0.1.3
version: 0.1.3
fs-extra:
specifier: ^11.3.0
version: 11.3.0
@@ -1966,8 +1966,8 @@ packages:
'@types/chai@5.2.2':
resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==}
'@types/chrome@0.1.1':
resolution: {integrity: sha512-MLtFW++/n+OPQIaf5hA6pmURd3Zn+OxuvASyf2mYh8B8pHDpbhHjwlVHMw3H/aJC9Z7Z3itO0AFaZeegrGk0yA==}
'@types/chrome@0.1.3':
resolution: {integrity: sha512-KVOIHEKjDZXMg8c18Ir3kbLc+bb8JxZjNJv27Wen3F0I/eeTyrYm7tWOjGhoBjI9fFQfjsTSyFcENBo9Wbl5kw==}
'@types/conventional-commits-parser@5.0.1':
resolution: {integrity: sha512-7uz5EHdzz2TqoMfV7ee61Egf5y6NkcO4FB/1iCCQnbeiI1F3xzv3vK5dBCXUCLQgGYS+mUeigK1iKQzvED+QnQ==}
@@ -6337,7 +6337,7 @@ snapshots:
dependencies:
'@types/deep-eql': 4.0.2
'@types/chrome@0.1.1':
'@types/chrome@0.1.3':
dependencies:
'@types/filesystem': 0.0.36
'@types/har-format': 1.2.15