@types/chrome 0.1.21 → 0.1.23
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.
- chrome/README.md +1 -1
- chrome/index.d.ts +53 -37
- chrome/package.json +2 -2
chrome/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chrome (https://developer.chrome.com/
|
|
8
8
|
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
|
9
9
|
|
10
10
|
### Additional Details
|
11
|
-
* Last updated:
|
11
|
+
* Last updated: Sat, 11 Oct 2025 05:34:11 GMT
|
12
12
|
* Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
|
13
13
|
|
14
14
|
# Credits
|
chrome/index.d.ts
CHANGED
@@ -9296,7 +9296,18 @@ declare namespace chrome {
|
|
9296
9296
|
optional_permissions?: ManifestOptionalPermissions[] | undefined;
|
9297
9297
|
optional_host_permissions?: string[] | undefined;
|
9298
9298
|
permissions?: ManifestPermissions[] | undefined;
|
9299
|
-
web_accessible_resources?:
|
9299
|
+
web_accessible_resources?:
|
9300
|
+
| Array<
|
9301
|
+
& {
|
9302
|
+
resources: string[];
|
9303
|
+
use_dynamic_url?: boolean | undefined;
|
9304
|
+
}
|
9305
|
+
& (
|
9306
|
+
| { extension_ids: string[]; matches?: string[] | undefined }
|
9307
|
+
| { matches: string[]; extension_ids?: string[] | undefined }
|
9308
|
+
)
|
9309
|
+
>
|
9310
|
+
| undefined;
|
9300
9311
|
}
|
9301
9312
|
|
9302
9313
|
export type Manifest = ManifestV2 | ManifestV3;
|
@@ -10156,69 +10167,74 @@ declare namespace chrome {
|
|
10156
10167
|
* Permissions: "system.storage"
|
10157
10168
|
*/
|
10158
10169
|
export namespace system.storage {
|
10170
|
+
export enum EjectDeviceResultCode {
|
10171
|
+
/** The ejection command is successful -- the application can prompt the user to remove the device. */
|
10172
|
+
SUCCESS = "success",
|
10173
|
+
/** The device is in use by another application. The ejection did not succeed; the user should not remove the device until the other application is done with the device. */
|
10174
|
+
IN_USE = "in_use",
|
10175
|
+
/** There is no such device known. */
|
10176
|
+
NO_SUCH_DEVICE = "no_such_device",
|
10177
|
+
/** The ejection command failed. */
|
10178
|
+
FAILURE = "failure",
|
10179
|
+
}
|
10180
|
+
|
10159
10181
|
export interface StorageUnitInfo {
|
10160
10182
|
/** The transient ID that uniquely identifies the storage device. This ID will be persistent within the same run of a single application. It will not be a persistent identifier between different runs of an application, or between different applications. */
|
10161
10183
|
id: string;
|
10162
10184
|
/** The name of the storage unit. */
|
10163
10185
|
name: string;
|
10164
|
-
/**
|
10165
|
-
|
10166
|
-
* fixed: The storage has fixed media, e.g. hard disk or SSD.
|
10167
|
-
* removable: The storage is removable, e.g. USB flash drive.
|
10168
|
-
* unknown: The storage type is unknown.
|
10169
|
-
*/
|
10170
|
-
type: string;
|
10186
|
+
/** The media type of the storage unit. */
|
10187
|
+
type: `${StorageUnitType}`;
|
10171
10188
|
/** The total amount of the storage space, in bytes. */
|
10172
10189
|
capacity: number;
|
10173
10190
|
}
|
10174
10191
|
|
10175
|
-
export
|
10176
|
-
/**
|
10192
|
+
export enum StorageUnitType {
|
10193
|
+
/** The storage has fixed media, e.g. hard disk or SSD. */
|
10194
|
+
FIXED = "fixed",
|
10195
|
+
/** The storage is removable, e.g. USB flash drive. */
|
10196
|
+
REMOVABLE = "removable",
|
10197
|
+
/** The storage type is unknown. */
|
10198
|
+
UNKNOWN = "unknown",
|
10199
|
+
}
|
10200
|
+
|
10201
|
+
export interface StorageAvailableCapacityInfo {
|
10202
|
+
/** A copied `id` of getAvailableCapacity function parameter `id`. */
|
10177
10203
|
id: string;
|
10178
10204
|
/** The available capacity of the storage device, in bytes. */
|
10179
10205
|
availableCapacity: number;
|
10180
10206
|
}
|
10181
10207
|
|
10182
|
-
export interface SystemStorageAttachedEvent extends chrome.events.Event<(info: StorageUnitInfo) => void> {}
|
10183
|
-
|
10184
|
-
export interface SystemStorageDetachedEvent extends chrome.events.Event<(id: string) => void> {}
|
10185
|
-
|
10186
|
-
/** Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects. */
|
10187
|
-
export function getInfo(callback: (info: StorageUnitInfo[]) => void): void;
|
10188
10208
|
/**
|
10189
10209
|
* Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects.
|
10190
|
-
*
|
10210
|
+
*
|
10211
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 91.
|
10191
10212
|
*/
|
10192
10213
|
export function getInfo(): Promise<StorageUnitInfo[]>;
|
10214
|
+
export function getInfo(callback: (info: StorageUnitInfo[]) => void): void;
|
10215
|
+
|
10193
10216
|
/**
|
10194
10217
|
* Ejects a removable storage device.
|
10195
|
-
*
|
10196
|
-
*
|
10197
|
-
*/
|
10198
|
-
export function ejectDevice(id: string, callback: (result: string) => void): void;
|
10199
|
-
/**
|
10200
|
-
* Ejects a removable storage device.
|
10201
|
-
* @param callback
|
10202
|
-
* Parameter result: success: The ejection command is successful -- the application can prompt the user to remove the device; in_use: The device is in use by another application. The ejection did not succeed; the user should not remove the device until the other application is done with the device; no_such_device: There is no such device known. failure: The ejection command failed.
|
10203
|
-
* @return The `ejectDevice` method provides its result via callback or returned as a `Promise` (MV3 only).
|
10204
|
-
*/
|
10205
|
-
export function ejectDevice(id: string): Promise<string>;
|
10206
|
-
/**
|
10207
|
-
* Get the available capacity of a specified |id| storage device. The |id| is the transient device ID from StorageUnitInfo.
|
10208
|
-
* @since Dev channel only.
|
10218
|
+
*
|
10219
|
+
* Can return its result via Promise in Manifest V3 or later since Chrome 91.
|
10209
10220
|
*/
|
10210
|
-
export function
|
10221
|
+
export function ejectDevice(id: string): Promise<`${EjectDeviceResultCode}`>;
|
10222
|
+
export function ejectDevice(id: string, callback: (result: `${EjectDeviceResultCode}`) => void): void;
|
10223
|
+
|
10211
10224
|
/**
|
10212
|
-
* Get the available capacity of a specified
|
10225
|
+
* Get the available capacity of a specified `id` storage device. The `id` is the transient device ID from StorageUnitInfo.
|
10226
|
+
*
|
10227
|
+
* Can return its result via Promise in Manifest V3.
|
10213
10228
|
* @since Dev channel only.
|
10214
|
-
* @return The `getAvailableCapacity` method provides its result via callback or returned as a `Promise` (MV3 only).
|
10215
10229
|
*/
|
10216
|
-
export function getAvailableCapacity(id: string): Promise<
|
10230
|
+
export function getAvailableCapacity(id: string): Promise<StorageAvailableCapacityInfo>;
|
10231
|
+
export function getAvailableCapacity(id: string, callback: (info: StorageAvailableCapacityInfo) => void): void;
|
10217
10232
|
|
10218
10233
|
/** Fired when a new removable storage is attached to the system. */
|
10219
|
-
export
|
10234
|
+
export const onAttached: events.Event<(info: StorageUnitInfo) => void>;
|
10235
|
+
|
10220
10236
|
/** Fired when a removable storage is detached from the system. */
|
10221
|
-
export
|
10237
|
+
export const onDetached: events.Event<(id: string) => void>;
|
10222
10238
|
}
|
10223
10239
|
|
10224
10240
|
////////////////////
|
chrome/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/chrome",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.23",
|
4
4
|
"description": "TypeScript definitions for chrome",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
|
6
6
|
"license": "MIT",
|
@@ -94,6 +94,6 @@
|
|
94
94
|
"@types/har-format": "*"
|
95
95
|
},
|
96
96
|
"peerDependencies": {},
|
97
|
-
"typesPublisherContentHash": "
|
97
|
+
"typesPublisherContentHash": "aeba34b4b0487d782a1e868033d51b9b8e2e4509e7973ea314537754c5337132",
|
98
98
|
"typeScriptVersion": "5.2"
|
99
99
|
}
|