diff --git a/packages/browser/package.json b/packages/browser/package.json index 1098bf19..1cba2b33 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -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.0.331", + "version": "0.0.332", "type": "module", "main": "src/index.mjs", "types": "src/index.d.ts", @@ -23,7 +23,7 @@ "src" ], "devDependencies": { - "@types/chrome": "0.0.331", + "@types/chrome": "0.0.332", "fs-extra": "^11.3.0", "nano-spawn": "^0.2.0", "tsx": "4.19.4", diff --git a/packages/browser/src/gen/index.d.ts b/packages/browser/src/gen/index.d.ts index 466f409f..72476166 100644 --- a/packages/browser/src/gen/index.d.ts +++ b/packages/browser/src/gen/index.d.ts @@ -8941,11 +8941,13 @@ export namespace Browser { * Use the `Browser.runtime` API to retrieve the service worker, return details about the manifest, and listen for and respond to events in the extension lifecycle. You can also use this API to convert the relative path of URLs to fully-qualified URLs. */ export namespace runtime { - /** Populated with an error message if calling an API function fails; otherwise undefined. This is only defined within the scope of that function's callback. If an error is produced, but `runtime.lastError` is not accessed within the callback, a message is logged to the console listing the API function that produced the error. API functions that return promises do not set this property. */ - export const lastError: { + export interface LastError { /** Details about the error which occurred. */ message?: string; - } | undefined; + } + + /** Populated with an error message if calling an API function fails; otherwise undefined. This is only defined within the scope of that function's callback. If an error is produced, but `runtime.lastError` is not accessed within the callback, a message is logged to the console listing the API function that produced the error. API functions that return promises do not set this property. */ + export const lastError: LastError | undefined; /** The ID of the extension/app. */ export const id: string; @@ -9173,6 +9175,11 @@ export namespace Browser { name: string; } + export interface UpdateAvailableDetails { + /** The version number of the available update. */ + version: string; + } + export interface UpdateCheckDetails { /** The version of the available update. */ version: string; @@ -9652,7 +9659,7 @@ export namespace Browser { */ export function requestUpdateCheck(): Promise; export function requestUpdateCheck( - callback: (status: `${RequestUpdateCheckStatus}`, details?: { version: string }) => void, + callback: (status: `${RequestUpdateCheckStatus}`, details?: UpdateCheckDetails) => void, ): void; /** Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op. */ @@ -9771,7 +9778,7 @@ export namespace Browser { export const onRestartRequired: events.Event<(reason: `${OnRestartRequiredReason}`) => void>; /** Fired when an update is available, but isn't installed immediately because the app is currently running. If you do nothing, the update will be installed the next time the background page gets unloaded, if you want it to be installed sooner you can explicitly call Browser.runtime.reload(). If your extension is using a persistent background page, the background page of course never gets unloaded, so unless you call Browser.runtime.reload() manually in response to this event the update will not get installed until the next time Chrome itself restarts. If no handlers are listening for this event, and your extension has a persistent background page, it behaves as if Browser.runtime.reload() is called in response to this event. */ - export const onUpdateAvailable: events.Event<(details: { version: string }) => void>; + export const onUpdateAvailable: events.Event<(details: UpdateAvailableDetails) => void>; /** * Fired when a Chrome update is available, but isn't installed immediately because a browser restart is required. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dff7aef5..8f16d017 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -170,8 +170,8 @@ importers: version: 1.2.15 devDependencies: '@types/chrome': - specifier: 0.0.331 - version: 0.0.331 + specifier: 0.0.332 + version: 0.0.332 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.0.331': - resolution: {integrity: sha512-/xgmrxXME8LQQC7YpNpCVYqiJiF5Rcin8tOE4kz8Hrhu8PchDK0CK0r/HzDOHc4B/AEq7T0KKrgHh74/jWNKpA==} + '@types/chrome@0.0.332': + resolution: {integrity: sha512-Fl4luF9q/iroXMKbL1LQyr/nCKhKwkwkZQ9qeeePFECW/8SP/Lrx2kJ26wnpTpr0iAznkENoO8g924CP4mfNxw==} '@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.0.331': + '@types/chrome@0.0.332': dependencies: '@types/filesystem': 0.0.36 '@types/har-format': 1.2.15