@types/chrome 0.1.21 → 0.1.22

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 (3) hide show
  1. chrome/README.md +1 -1
  2. chrome/index.d.ts +41 -36
  3. 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: Fri, 03 Oct 2025 06:39:45 GMT
11
+ * Last updated: Fri, 03 Oct 2025 21:32:25 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
@@ -10156,69 +10156,74 @@ declare namespace chrome {
10156
10156
  * Permissions: "system.storage"
10157
10157
  */
10158
10158
  export namespace system.storage {
10159
+ export enum EjectDeviceResultCode {
10160
+ /** The ejection command is successful -- the application can prompt the user to remove the device. */
10161
+ SUCCESS = "success",
10162
+ /** 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. */
10163
+ IN_USE = "in_use",
10164
+ /** There is no such device known. */
10165
+ NO_SUCH_DEVICE = "no_such_device",
10166
+ /** The ejection command failed. */
10167
+ FAILURE = "failure",
10168
+ }
10169
+
10159
10170
  export interface StorageUnitInfo {
10160
10171
  /** 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
10172
  id: string;
10162
10173
  /** The name of the storage unit. */
10163
10174
  name: string;
10164
- /**
10165
- * The media type of the storage unit.
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;
10175
+ /** The media type of the storage unit. */
10176
+ type: `${StorageUnitType}`;
10171
10177
  /** The total amount of the storage space, in bytes. */
10172
10178
  capacity: number;
10173
10179
  }
10174
10180
 
10175
- export interface StorageCapacityInfo {
10176
- /** A copied |id| of getAvailableCapacity function parameter |id|. */
10181
+ export enum StorageUnitType {
10182
+ /** The storage has fixed media, e.g. hard disk or SSD. */
10183
+ FIXED = "fixed",
10184
+ /** The storage is removable, e.g. USB flash drive. */
10185
+ REMOVABLE = "removable",
10186
+ /** The storage type is unknown. */
10187
+ UNKNOWN = "unknown",
10188
+ }
10189
+
10190
+ export interface StorageAvailableCapacityInfo {
10191
+ /** A copied `id` of getAvailableCapacity function parameter `id`. */
10177
10192
  id: string;
10178
10193
  /** The available capacity of the storage device, in bytes. */
10179
10194
  availableCapacity: number;
10180
10195
  }
10181
10196
 
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
10197
  /**
10189
10198
  * Get the storage information from the system. The argument passed to the callback is an array of StorageUnitInfo objects.
10190
- * @return The `getInfo` method provides its result via callback or returned as a `Promise` (MV3 only).
10199
+ *
10200
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
10191
10201
  */
10192
10202
  export function getInfo(): Promise<StorageUnitInfo[]>;
10203
+ export function getInfo(callback: (info: StorageUnitInfo[]) => void): void;
10204
+
10193
10205
  /**
10194
10206
  * Ejects a removable storage device.
10195
- * @param callback
10196
- * 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.
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.
10207
+ *
10208
+ * Can return its result via Promise in Manifest V3 or later since Chrome 91.
10209
10209
  */
10210
- export function getAvailableCapacity(id: string, callback: (info: StorageCapacityInfo) => void): void;
10210
+ export function ejectDevice(id: string): Promise<`${EjectDeviceResultCode}`>;
10211
+ export function ejectDevice(id: string, callback: (result: `${EjectDeviceResultCode}`) => void): void;
10212
+
10211
10213
  /**
10212
- * Get the available capacity of a specified |id| storage device. The |id| is the transient device ID from StorageUnitInfo.
10214
+ * Get the available capacity of a specified `id` storage device. The `id` is the transient device ID from StorageUnitInfo.
10215
+ *
10216
+ * Can return its result via Promise in Manifest V3.
10213
10217
  * @since Dev channel only.
10214
- * @return The `getAvailableCapacity` method provides its result via callback or returned as a `Promise` (MV3 only).
10215
10218
  */
10216
- export function getAvailableCapacity(id: string): Promise<StorageCapacityInfo>;
10219
+ export function getAvailableCapacity(id: string): Promise<StorageAvailableCapacityInfo>;
10220
+ export function getAvailableCapacity(id: string, callback: (info: StorageAvailableCapacityInfo) => void): void;
10217
10221
 
10218
10222
  /** Fired when a new removable storage is attached to the system. */
10219
- export var onAttached: SystemStorageAttachedEvent;
10223
+ export const onAttached: events.Event<(info: StorageUnitInfo) => void>;
10224
+
10220
10225
  /** Fired when a removable storage is detached from the system. */
10221
- export var onDetached: SystemStorageDetachedEvent;
10226
+ export const onDetached: events.Event<(id: string) => void>;
10222
10227
  }
10223
10228
 
10224
10229
  ////////////////////
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
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": "428112a1fe1e6c91a0d80daf37710dfb8d33374f33d46c605328323a5676a6dd",
97
+ "typesPublisherContentHash": "eada04150c1c42679c4730cf050e1fb35c08aeda9efc7f58416c976c363236bb",
98
98
  "typeScriptVersion": "5.2"
99
99
  }