@wxt-dev/browser 0.0.331 → 0.0.332

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/gen/index.d.ts +12 -5
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wxt-dev/browser",
3
3
  "description": "Provides a cross-browser API for using extension APIs and types based on @types/chrome",
4
- "version": "0.0.331",
4
+ "version": "0.0.332",
5
5
  "type": "module",
6
6
  "main": "src/index.mjs",
7
7
  "types": "src/index.d.ts",
@@ -19,7 +19,7 @@
19
19
  "src"
20
20
  ],
21
21
  "devDependencies": {
22
- "@types/chrome": "0.0.331",
22
+ "@types/chrome": "0.0.332",
23
23
  "fs-extra": "^11.3.0",
24
24
  "nano-spawn": "^0.2.0",
25
25
  "tsx": "4.19.4",
@@ -8941,11 +8941,13 @@ export namespace Browser {
8941
8941
  * 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.
8942
8942
  */
8943
8943
  export namespace runtime {
8944
- /** 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. */
8945
- export const lastError: {
8944
+ export interface LastError {
8946
8945
  /** Details about the error which occurred. */
8947
8946
  message?: string;
8948
- } | undefined;
8947
+ }
8948
+
8949
+ /** 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. */
8950
+ export const lastError: LastError | undefined;
8949
8951
 
8950
8952
  /** The ID of the extension/app. */
8951
8953
  export const id: string;
@@ -9173,6 +9175,11 @@ export namespace Browser {
9173
9175
  name: string;
9174
9176
  }
9175
9177
 
9178
+ export interface UpdateAvailableDetails {
9179
+ /** The version number of the available update. */
9180
+ version: string;
9181
+ }
9182
+
9176
9183
  export interface UpdateCheckDetails {
9177
9184
  /** The version of the available update. */
9178
9185
  version: string;
@@ -9652,7 +9659,7 @@ export namespace Browser {
9652
9659
  */
9653
9660
  export function requestUpdateCheck(): Promise<RequestUpdateCheckResult>;
9654
9661
  export function requestUpdateCheck(
9655
- callback: (status: `${RequestUpdateCheckStatus}`, details?: { version: string }) => void,
9662
+ callback: (status: `${RequestUpdateCheckStatus}`, details?: UpdateCheckDetails) => void,
9656
9663
  ): void;
9657
9664
 
9658
9665
  /** Restart the ChromeOS device when the app runs in kiosk mode. Otherwise, it's no-op. */
@@ -9771,7 +9778,7 @@ export namespace Browser {
9771
9778
  export const onRestartRequired: events.Event<(reason: `${OnRestartRequiredReason}`) => void>;
9772
9779
 
9773
9780
  /** 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. */
9774
- export const onUpdateAvailable: events.Event<(details: { version: string }) => void>;
9781
+ export const onUpdateAvailable: events.Event<(details: UpdateAvailableDetails) => void>;
9775
9782
 
9776
9783
  /**
9777
9784
  * Fired when a Chrome update is available, but isn't installed immediately because a browser restart is required.