@wxt-dev/browser 0.1.43 → 0.2.0
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.
- package/package.json +2 -2
- package/src/gen/index.d.ts +15 -39
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.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.mjs",
|
|
7
7
|
"types": "src/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"src"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@types/chrome": "0.
|
|
28
|
+
"@types/chrome": "0.2.0",
|
|
29
29
|
"@types/node": "^20.17.6",
|
|
30
30
|
"nano-spawn": "^2.0.0",
|
|
31
31
|
"typescript": "^6.0.3",
|
package/src/gen/index.d.ts
CHANGED
|
@@ -2250,7 +2250,7 @@ export namespace Browser {
|
|
|
2250
2250
|
*
|
|
2251
2251
|
* Permissions: "debugger"
|
|
2252
2252
|
*/
|
|
2253
|
-
|
|
2253
|
+
namespace _debugger {
|
|
2254
2254
|
/** Debuggee identifier. Either tabId, extensionId or targetId must be specified */
|
|
2255
2255
|
interface Debuggee {
|
|
2256
2256
|
/** The id of the tab which you intend to debug. */
|
|
@@ -9225,11 +9225,6 @@ export namespace Browser {
|
|
|
9225
9225
|
| "webRequestBlocking"
|
|
9226
9226
|
| "webRequestAuthProvider";
|
|
9227
9227
|
|
|
9228
|
-
/**
|
|
9229
|
-
* @deprecated Use `ManifestPermission` instead.
|
|
9230
|
-
*/
|
|
9231
|
-
type ManifestPermissions = ManifestPermission;
|
|
9232
|
-
|
|
9233
9228
|
/** Source : https://developer.chrome.com/docs/extensions/reference/api/permissions */
|
|
9234
9229
|
type ManifestOptionalPermission = Exclude<
|
|
9235
9230
|
ManifestPermission,
|
|
@@ -9247,11 +9242,6 @@ export namespace Browser {
|
|
|
9247
9242
|
| "webAuthenticationProxy"
|
|
9248
9243
|
>;
|
|
9249
9244
|
|
|
9250
|
-
/**
|
|
9251
|
-
* @deprecated Use `ManifestOptionalPermission` instead.
|
|
9252
|
-
*/
|
|
9253
|
-
type ManifestOptionalPermissions = ManifestOptionalPermission;
|
|
9254
|
-
|
|
9255
9245
|
interface SearchProvider {
|
|
9256
9246
|
name?: string | undefined;
|
|
9257
9247
|
keyword?: string | undefined;
|
|
@@ -10120,12 +10110,7 @@ export namespace Browser {
|
|
|
10120
10110
|
* Permissions: "storage"
|
|
10121
10111
|
*/
|
|
10122
10112
|
export namespace storage {
|
|
10123
|
-
|
|
10124
|
-
type NoInferX<T> = T[][T extends any ? 0 : never];
|
|
10125
|
-
// The next line prevents things without the export keyword from being automatically exported (like NoInferX)
|
|
10126
|
-
export {};
|
|
10127
|
-
|
|
10128
|
-
export interface StorageArea {
|
|
10113
|
+
interface StorageArea {
|
|
10129
10114
|
/**
|
|
10130
10115
|
* Gets the amount of space (in bytes) being used by one or more items.
|
|
10131
10116
|
* @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 {
|
|
|
10172
10157
|
* Can return its result via Promise in Manifest V3 or later since Chrome 95.
|
|
10173
10158
|
*/
|
|
10174
10159
|
get<T = { [key: string]: unknown }>(
|
|
10175
|
-
keys?:
|
|
10160
|
+
keys?: NoInfer<keyof T> | Array<NoInfer<keyof T>> | Partial<NoInfer<T>> | null | undefined,
|
|
10176
10161
|
): Promise<T>;
|
|
10177
10162
|
get<T = { [key: string]: unknown }>(callback: (items: T) => void): void;
|
|
10178
10163
|
get<T = { [key: string]: unknown }>(
|
|
10179
|
-
keys:
|
|
10164
|
+
keys: NoInfer<keyof T> | Array<NoInfer<keyof T>> | Partial<NoInfer<T>> | null | undefined,
|
|
10180
10165
|
callback: (items: T) => void,
|
|
10181
10166
|
): void;
|
|
10182
10167
|
|
|
@@ -10203,19 +10188,19 @@ export namespace Browser {
|
|
|
10203
10188
|
getKeys(callback: (keys: string[]) => void): void;
|
|
10204
10189
|
}
|
|
10205
10190
|
|
|
10206
|
-
|
|
10191
|
+
interface StorageChange {
|
|
10207
10192
|
/** The new value of the item, if there is a new value. */
|
|
10208
10193
|
newValue?: unknown;
|
|
10209
10194
|
/** The old value of the item, if there was an old value. */
|
|
10210
10195
|
oldValue?: unknown;
|
|
10211
10196
|
}
|
|
10212
10197
|
|
|
10213
|
-
|
|
10198
|
+
interface LocalStorageArea extends StorageArea {
|
|
10214
10199
|
/** 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. */
|
|
10215
10200
|
QUOTA_BYTES: 10485760;
|
|
10216
10201
|
}
|
|
10217
10202
|
|
|
10218
|
-
|
|
10203
|
+
interface SyncStorageArea extends StorageArea {
|
|
10219
10204
|
/** @deprecated The storage.sync API no longer has a sustained write operation quota. */
|
|
10220
10205
|
MAX_SUSTAINED_WRITE_OPERATIONS_PER_MINUTE: 1000000;
|
|
10221
10206
|
/** 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 {
|
|
|
10238
10223
|
MAX_WRITE_OPERATIONS_PER_MINUTE: 120;
|
|
10239
10224
|
}
|
|
10240
10225
|
|
|
10241
|
-
|
|
10226
|
+
interface SessionStorageArea extends StorageArea {
|
|
10242
10227
|
/** 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. */
|
|
10243
10228
|
QUOTA_BYTES: 10485760;
|
|
10244
10229
|
}
|
|
10245
10230
|
|
|
10246
|
-
|
|
10231
|
+
type AreaName = "sync" | "local" | "managed" | "session";
|
|
10247
10232
|
|
|
10248
10233
|
/**
|
|
10249
10234
|
* The storage area's access level.
|
|
10250
10235
|
* @since Chrome 102
|
|
10251
10236
|
*/
|
|
10252
|
-
|
|
10237
|
+
enum AccessLevel {
|
|
10253
10238
|
/** Specifies contexts originating from the extension itself. */
|
|
10254
10239
|
TRUSTED_CONTEXTS = "TRUSTED_CONTEXTS",
|
|
10255
10240
|
/** Specifies contexts originating from outside the extension. */
|
|
@@ -10257,13 +10242,13 @@ export namespace Browser {
|
|
|
10257
10242
|
}
|
|
10258
10243
|
|
|
10259
10244
|
/** Items in the `local` storage area are local to each machine. */
|
|
10260
|
-
|
|
10245
|
+
const local: LocalStorageArea;
|
|
10261
10246
|
|
|
10262
10247
|
/** Items in the `sync` storage area are synced using Chrome Sync. */
|
|
10263
|
-
|
|
10248
|
+
const sync: SyncStorageArea;
|
|
10264
10249
|
|
|
10265
10250
|
/** 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. */
|
|
10266
|
-
|
|
10251
|
+
const managed: StorageArea;
|
|
10267
10252
|
|
|
10268
10253
|
/**
|
|
10269
10254
|
* Items in the `session` storage area are stored in-memory and will not be persisted to disk.
|
|
@@ -10271,10 +10256,10 @@ export namespace Browser {
|
|
|
10271
10256
|
* MV3 only
|
|
10272
10257
|
* @since Chrome 102
|
|
10273
10258
|
*/
|
|
10274
|
-
|
|
10259
|
+
const session: SessionStorageArea;
|
|
10275
10260
|
|
|
10276
10261
|
/** Fired when one or more items change. */
|
|
10277
|
-
|
|
10262
|
+
const onChanged: events.Event<(changes: { [key: string]: StorageChange }, areaName: AreaName) => void>;
|
|
10278
10263
|
}
|
|
10279
10264
|
|
|
10280
10265
|
////////////////////
|
|
@@ -10297,10 +10282,6 @@ export namespace Browser {
|
|
|
10297
10282
|
total: number;
|
|
10298
10283
|
}
|
|
10299
10284
|
|
|
10300
|
-
/** @deprecated Use {@link CpuTime} instead. */
|
|
10301
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
10302
|
-
interface ProcessorUsage extends CpuTime {}
|
|
10303
|
-
|
|
10304
10285
|
interface ProcessorInfo {
|
|
10305
10286
|
/** Cumulative usage info for this logical processor. */
|
|
10306
10287
|
usage: CpuTime;
|
|
@@ -12533,10 +12514,6 @@ export namespace Browser {
|
|
|
12533
12514
|
reconnect?: string | undefined;
|
|
12534
12515
|
}
|
|
12535
12516
|
|
|
12536
|
-
/** @deprecated Use {@link Parameters} instead */
|
|
12537
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
12538
|
-
interface VpnSessionParameters extends Parameters {}
|
|
12539
|
-
|
|
12540
12517
|
/** The enum is used by the platform to notify the client of the VPN session status. */
|
|
12541
12518
|
enum PlatformMessage {
|
|
12542
12519
|
/** Indicates that the VPN configuration connected. */
|
|
@@ -13441,7 +13418,6 @@ export namespace Browser {
|
|
|
13441
13418
|
|
|
13442
13419
|
/** 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. */
|
|
13443
13420
|
const onBeforeSendHeaders: WebRequestEvent<
|
|
13444
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type
|
|
13445
13421
|
(details: OnBeforeSendHeadersDetails) => BlockingResponse | undefined,
|
|
13446
13422
|
`${OnBeforeSendHeadersOptions}`[]
|
|
13447
13423
|
>;
|