diff --git a/bun.lock b/bun.lock index bf722524..718a2626 100644 --- a/bun.lock +++ b/bun.lock @@ -83,13 +83,13 @@ }, "packages/browser": { "name": "@wxt-dev/browser", - "version": "0.1.43", + "version": "0.2.0", "dependencies": { "@types/filesystem": "*", "@types/har-format": "*", }, "devDependencies": { - "@types/chrome": "0.1.43", + "@types/chrome": "0.2.0", "@types/node": "catalog:", "nano-spawn": "catalog:", "typescript": "catalog:", @@ -1061,7 +1061,7 @@ "@types/chai": ["@types/chai@5.2.3", "", { "dependencies": { "@types/deep-eql": "*", "assertion-error": "^2.0.1" } }, "sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA=="], - "@types/chrome": ["@types/chrome@0.1.43", "", { "dependencies": { "@types/filesystem": "*", "@types/har-format": "*" } }, "sha512-ukH/HhmR6ht+UTX3PLUWJxgJ/RQcK2Foj4lBzsF24SIWsXgqhGuXqjd8FFuwioPP7d/JUKLM4g8GZxw3F4HTcA=="], + "@types/chrome": ["@types/chrome@0.2.0", "", { "dependencies": { "@types/filesystem": "*", "@types/har-format": "*" } }, "sha512-K/i7EKEVSpmyXXjE0ev5oASWBYMY6yM8LFSutG2PkM1DmxJUggZsoaTc0W1RsVwDDKrsZEjpHFAbqqxlRxGsSg=="], "@types/debug": ["@types/debug@4.1.12", "", { "dependencies": { "@types/ms": "*" } }, "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ=="], diff --git a/packages/browser/package.json b/packages/browser/package.json index 233133fc..5c7bd92f 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.1.43", + "version": "0.2.0", "type": "module", "main": "src/index.mjs", "types": "src/index.d.ts", @@ -25,7 +25,7 @@ "src" ], "devDependencies": { - "@types/chrome": "0.1.43", + "@types/chrome": "0.2.0", "@types/node": "catalog:", "nano-spawn": "catalog:", "typescript": "catalog:", diff --git a/packages/browser/src/gen/index.d.ts b/packages/browser/src/gen/index.d.ts index 230eaef8..4946c8f5 100644 --- a/packages/browser/src/gen/index.d.ts +++ b/packages/browser/src/gen/index.d.ts @@ -2250,7 +2250,7 @@ export namespace Browser { * * Permissions: "debugger" */ - export namespace _debugger { + namespace _debugger { /** Debuggee identifier. Either tabId, extensionId or targetId must be specified */ interface Debuggee { /** The id of the tab which you intend to debug. */ @@ -9225,11 +9225,6 @@ export namespace Browser { | "webRequestBlocking" | "webRequestAuthProvider"; - /** - * @deprecated Use `ManifestPermission` instead. - */ - type ManifestPermissions = ManifestPermission; - /** Source : https://developer.chrome.com/docs/extensions/reference/api/permissions */ type ManifestOptionalPermission = Exclude< ManifestPermission, @@ -9247,11 +9242,6 @@ export namespace Browser { | "webAuthenticationProxy" >; - /** - * @deprecated Use `ManifestOptionalPermission` instead. - */ - type ManifestOptionalPermissions = ManifestOptionalPermission; - interface SearchProvider { name?: string | undefined; keyword?: string | undefined; @@ -10120,12 +10110,7 @@ export namespace Browser { * Permissions: "storage" */ export namespace storage { - /** NoInfer for old TypeScript versions (Required TS 5.4+) */ - type NoInferX = T[][T extends any ? 0 : never]; - // The next line prevents things without the export keyword from being automatically exported (like NoInferX) - export {}; - - export interface StorageArea { + interface StorageArea { /** * Gets the amount of space (in bytes) being used by one or more items. * @param keys A single key or list of keys to get the total usage for. An empty list will return 0. Pass in `null` to get the total usage of all of storage. @@ -10172,11 +10157,11 @@ export namespace Browser { * Can return its result via Promise in Manifest V3 or later since Chrome 95. */ get( - keys?: NoInferX | Array> | Partial> | null, + keys?: NoInfer | Array> | Partial> | null | undefined, ): Promise; get(callback: (items: T) => void): void; get( - keys: NoInferX | Array> | Partial> | null | undefined, + keys: NoInfer | Array> | Partial> | null | undefined, callback: (items: T) => void, ): void; @@ -10203,19 +10188,19 @@ export namespace Browser { getKeys(callback: (keys: string[]) => void): void; } - export interface StorageChange { + interface StorageChange { /** The new value of the item, if there is a new value. */ newValue?: unknown; /** The old value of the item, if there was an old value. */ oldValue?: unknown; } - export interface LocalStorageArea extends StorageArea { + interface LocalStorageArea extends StorageArea { /** The maximum amount (in bytes) of data that can be stored in local storage, as measured by the JSON stringification of every value plus every key's length. This value will be ignored if the extension has the unlimitedStorage permission. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError when using a callback, or a rejected Promise if using async/await. */ QUOTA_BYTES: 10485760; } - export interface SyncStorageArea extends StorageArea { + interface SyncStorageArea extends StorageArea { /** @deprecated The storage.sync API no longer has a sustained write operation quota. */ MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: 1000000; /** The maximum total amount (in bytes) of data that can be stored in sync storage, as measured by the JSON stringification of every value plus every key's length. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError when using a callback, or when a Promise is rejected. */ @@ -10238,18 +10223,18 @@ export namespace Browser { MAX_WRITE_OPERATIONS_PER_MINUTE: 120; } - export interface SessionStorageArea extends StorageArea { + interface SessionStorageArea extends StorageArea { /** The maximum amount (in bytes) of data that can be stored in memory, as measured by estimating the dynamically allocated memory usage of every value and key. Updates that would cause this limit to be exceeded fail immediately and set runtime.lastError when using a callback, or when a Promise is rejected. */ QUOTA_BYTES: 10485760; } - export type AreaName = "sync" | "local" | "managed" | "session"; + type AreaName = "sync" | "local" | "managed" | "session"; /** * The storage area's access level. * @since Chrome 102 */ - export enum AccessLevel { + enum AccessLevel { /** Specifies contexts originating from the extension itself. */ TRUSTED_CONTEXTS = "TRUSTED_CONTEXTS", /** Specifies contexts originating from outside the extension. */ @@ -10257,13 +10242,13 @@ export namespace Browser { } /** Items in the `local` storage area are local to each machine. */ - export const local: LocalStorageArea; + const local: LocalStorageArea; /** Items in the `sync` storage area are synced using Chrome Sync. */ - export const sync: SyncStorageArea; + const sync: SyncStorageArea; /** Items in the `managed` storage area are set by an enterprise policy configured by the domain administrator, and are read-only for the extension; trying to modify this namespace results in an error. For information on configuring a policy, see Manifest for storage areas. */ - export const managed: StorageArea; + const managed: StorageArea; /** * Items in the `session` storage area are stored in-memory and will not be persisted to disk. @@ -10271,10 +10256,10 @@ export namespace Browser { * MV3 only * @since Chrome 102 */ - export const session: SessionStorageArea; + const session: SessionStorageArea; /** Fired when one or more items change. */ - export const onChanged: events.Event<(changes: { [key: string]: StorageChange }, areaName: AreaName) => void>; + const onChanged: events.Event<(changes: { [key: string]: StorageChange }, areaName: AreaName) => void>; } //////////////////// @@ -10297,10 +10282,6 @@ export namespace Browser { total: number; } - /** @deprecated Use {@link CpuTime} instead. */ - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface ProcessorUsage extends CpuTime {} - interface ProcessorInfo { /** Cumulative usage info for this logical processor. */ usage: CpuTime; @@ -12533,10 +12514,6 @@ export namespace Browser { reconnect?: string | undefined; } - /** @deprecated Use {@link Parameters} instead */ - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface VpnSessionParameters extends Parameters {} - /** The enum is used by the platform to notify the client of the VPN session status. */ enum PlatformMessage { /** Indicates that the VPN configuration connected. */ @@ -13441,7 +13418,6 @@ export namespace Browser { /** Fired before sending an HTTP request, once the request headers are available. This may occur after a TCP connection is made to the server, but before any HTTP data is sent. */ const onBeforeSendHeaders: WebRequestEvent< - // eslint-disable-next-line @typescript-eslint/no-invalid-void-type (details: OnBeforeSendHeadersDetails) => BlockingResponse | undefined, `${OnBeforeSendHeadersOptions}`[] >;