@types/chrome 0.1.0 → 0.1.2

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 +93 -156
  3. chrome/package.json +3 -3
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, 11 Jul 2025 18:02:44 GMT
11
+ * Last updated: Fri, 08 Aug 2025 15:37:56 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
@@ -471,23 +471,23 @@ declare namespace chrome {
471
471
  /**
472
472
  * Retrieves details about the specified alarm.
473
473
  */
474
- export function get(callback: (alarm: Alarm) => void): void;
474
+ export function get(callback: (alarm?: Alarm) => void): void;
475
475
  /**
476
476
  * Retrieves details about the specified alarm.
477
477
  * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
478
478
  */
479
- export function get(): Promise<Alarm>;
479
+ export function get(): Promise<Alarm | undefined>;
480
480
  /**
481
481
  * Retrieves details about the specified alarm.
482
482
  * @param name The name of the alarm to get. Defaults to the empty string.
483
483
  */
484
- export function get(name: string, callback: (alarm: Alarm) => void): void;
484
+ export function get(name: string, callback: (alarm?: Alarm) => void): void;
485
485
  /**
486
486
  * Retrieves details about the specified alarm.
487
487
  * @param name The name of the alarm to get. Defaults to the empty string.
488
488
  * @return The `get` method provides its result via callback or returned as a `Promise` (MV3 only).
489
489
  */
490
- export function get(name: string): Promise<Alarm>;
490
+ export function get(name: string): Promise<Alarm | undefined>;
491
491
 
492
492
  /** Fired when an alarm has elapsed. Useful for event pages. */
493
493
  export var onAlarm: AlarmEvent;
@@ -1086,267 +1086,209 @@ declare namespace chrome {
1086
1086
  */
1087
1087
  export namespace browsingData {
1088
1088
  export interface OriginTypes {
1089
- /** Optional. Extensions and packaged applications a user has installed (be _really_ careful!). */
1089
+ /** Extensions and packaged applications a user has installed (be _really_ careful!). */
1090
1090
  extension?: boolean | undefined;
1091
- /** Optional. Websites that have been installed as hosted applications (be careful!). */
1091
+ /** Websites that have been installed as hosted applications (be careful!). */
1092
1092
  protectedWeb?: boolean | undefined;
1093
- /** Optional. Normal websites. */
1093
+ /** Normal websites. */
1094
1094
  unprotectedWeb?: boolean | undefined;
1095
1095
  }
1096
1096
 
1097
1097
  /** Options that determine exactly what data will be removed. */
1098
1098
  export interface RemovalOptions {
1099
1099
  /**
1100
- * Optional.
1100
+ * When present, data for origins in this list is excluded from deletion. Can't be used together with `origins`. Only supported for cookies, storage and cache. Cookies are excluded for the whole registrable domain.
1101
1101
  * @since Chrome 74
1102
- * When present, data for origins in this list is excluded from deletion. Can't be used together with origins. Only supported for cookies, storage and cache. Cookies are excluded for the whole registrable domain.
1103
1102
  */
1104
1103
  excludeOrigins?: string[] | undefined;
1105
- /**
1106
- * Optional.
1107
- * An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you _really_ want to remove application data before adding 'protectedWeb' or 'extensions'.
1108
- */
1104
+ /** An object whose properties specify which origin types ought to be cleared. If this object isn't specified, it defaults to clearing only "unprotected" origins. Please ensure that you _really_ want to remove application data before adding 'protectedWeb' or 'extensions'. */
1109
1105
  originTypes?: OriginTypes | undefined;
1110
1106
  /**
1111
- * Optional.
1112
- * @since Chrome 74
1113
1107
  * When present, only data for origins in this list is deleted. Only supported for cookies, storage and cache. Cookies are cleared for the whole registrable domain.
1108
+ * @since Chrome 74
1114
1109
  */
1115
- origins?: string[] | undefined;
1116
- /**
1117
- * Optional.
1118
- * Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the {@link Date.getTime} method). If absent, defaults to 0 (which would remove all browsing data).
1119
- */
1110
+ origins?: [string, ...string[]] | undefined;
1111
+ /** Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the {@link Date.getTime getTime} method of the JavaScript `Date` object). If absent, defaults to 0 (which would remove all browsing data). */
1120
1112
  since?: number | undefined;
1121
1113
  }
1122
1114
 
1123
- /**
1124
- * @since Chrome 27
1125
- * A set of data types. Missing data types are interpreted as false.
1126
- */
1115
+ /** A set of data types. Missing data types are interpreted as `false`. */
1127
1116
  export interface DataTypeSet {
1128
- /** Optional. Websites' WebSQL data. */
1117
+ /** Websites' WebSQL data. */
1129
1118
  webSQL?: boolean | undefined;
1130
- /** Optional. Websites' IndexedDB data. */
1119
+ /** Websites' IndexedDB data. */
1131
1120
  indexedDB?: boolean | undefined;
1132
- /** Optional. The browser's cookies. */
1121
+ /** The browser's cookies. */
1133
1122
  cookies?: boolean | undefined;
1134
- /** Optional. Stored passwords. */
1123
+ /** Stored passwords. */
1135
1124
  passwords?: boolean | undefined;
1136
1125
  /**
1137
- * @deprecated Deprecated since Chrome 76.
1138
- * Support for server-bound certificates has been removed. This data type will be ignored.
1139
- *
1140
- * Optional. Server-bound certificates.
1126
+ * Server-bound certificates.
1127
+ * @deprecated since Chrome 76. Support for server-bound certificates has been removed. This data type will be ignored.
1141
1128
  */
1142
1129
  serverBoundCertificates?: boolean | undefined;
1143
- /** Optional. The browser's download list. */
1130
+ /** The browser's download list. */
1144
1131
  downloads?: boolean | undefined;
1145
- /** Optional. The browser's cache. Note: when removing data, this clears the entire cache: it is not limited to the range you specify. */
1132
+ /** The browser's cache. */
1146
1133
  cache?: boolean | undefined;
1147
- /** Optional. The browser's cacheStorage. */
1134
+ /** Cache storage. */
1148
1135
  cacheStorage?: boolean | undefined;
1149
- /** Optional. Websites' appcaches. */
1136
+ /** Websites' appcaches. */
1150
1137
  appcache?: boolean | undefined;
1151
- /** Optional. Websites' file systems. */
1138
+ /** Websites' file systems. */
1152
1139
  fileSystems?: boolean | undefined;
1153
1140
  /**
1154
- * @deprecated Deprecated since Chrome 88.
1155
- * Support for Flash has been removed. This data type will be ignored.
1156
- *
1157
- * Optional. Plugins' data.
1141
+ * Plugins' data.
1142
+ * @deprecated since Chrome 88. Support for Flash has been removed. This data type will be ignored.
1158
1143
  */
1159
1144
  pluginData?: boolean | undefined;
1160
- /** Optional. Websites' local storage data. */
1145
+ /** Websites' local storage data. */
1161
1146
  localStorage?: boolean | undefined;
1162
- /** Optional. The browser's stored form data. */
1147
+ /** The browser's stored form data. */
1163
1148
  formData?: boolean | undefined;
1164
- /** Optional. The browser's history. */
1149
+ /** The browser's history. */
1165
1150
  history?: boolean | undefined;
1166
- /**
1167
- * Optional.
1168
- * @since Chrome 39
1169
- * Service Workers.
1170
- */
1151
+ /** Service Workers. */
1171
1152
  serviceWorkers?: boolean | undefined;
1172
1153
  }
1173
1154
 
1174
1155
  export interface SettingsResult {
1175
1156
  options: RemovalOptions;
1176
- /** All of the types will be present in the result, with values of true if they are both selected to be removed and permitted to be removed, otherwise false. */
1157
+ /** All of the types will be present in the result, with values of `true` if they are both selected to be removed and permitted to be removed, otherwise `false`. */
1177
1158
  dataToRemove: DataTypeSet;
1178
- /** All of the types will be present in the result, with values of true if they are permitted to be removed (e.g., by enterprise policy) and false if not. */
1159
+ /** All of the types will be present in the result, with values of `true` if they are permitted to be removed (e.g., by enterprise policy) and `false` if not. */
1179
1160
  dataRemovalPermitted: DataTypeSet;
1180
1161
  }
1181
1162
 
1182
1163
  /**
1183
- * @since Chrome 26
1184
1164
  * Reports which types of data are currently selected in the 'Clear browsing data' settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here.
1185
- * @return The `settings` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1165
+ *
1166
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1186
1167
  */
1187
1168
  export function settings(): Promise<SettingsResult>;
1188
- /**
1189
- * @since Chrome 26
1190
- * Reports which types of data are currently selected in the 'Clear browsing data' settings UI. Note: some of the data types included in this API are not available in the settings UI, and some UI settings control more than one data type listed here.
1191
- */
1192
1169
  export function settings(callback: (result: SettingsResult) => void): void;
1170
+
1193
1171
  /**
1194
- * @deprecated Deprecated since Chrome 88.
1195
- * Support for Flash has been removed. This function has no effect.
1196
- *
1197
1172
  * Clears plugins' data.
1198
- * @return The `removePluginData` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1199
- */
1200
- export function removePluginData(options: RemovalOptions): Promise<void>;
1201
- /**
1202
- * @deprecated Deprecated since Chrome 88.
1203
- * Support for Flash has been removed. This function has no effect.
1204
1173
  *
1205
- * Clears plugins' data.
1206
- * @param callback Called when plugins' data has been cleared.
1174
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1175
+ * @deprecated since Chrome 88. Support for Flash has been removed. This function has no effect
1207
1176
  */
1177
+ export function removePluginData(options: RemovalOptions): Promise<void>;
1208
1178
  export function removePluginData(options: RemovalOptions, callback: () => void): void;
1179
+
1209
1180
  /**
1210
- * @since Chrome 72
1211
1181
  * Clears websites' service workers.
1212
- * @return The `removeServiceWorkers` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1213
- */
1214
- export function removeServiceWorkers(options: RemovalOptions): Promise<void>;
1215
- /**
1182
+ *
1183
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1216
1184
  * @since Chrome 72
1217
- * Clears websites' service workers.
1218
- * @param callback Called when the browser's service workers have been cleared.
1219
1185
  */
1186
+ export function removeServiceWorkers(options: RemovalOptions): Promise<void>;
1220
1187
  export function removeServiceWorkers(options: RemovalOptions, callback: () => void): void;
1188
+
1221
1189
  /**
1222
1190
  * Clears the browser's stored form data (autofill).
1223
- * @return The `removeFormData` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1191
+ *
1192
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1224
1193
  */
1225
1194
  export function removeFormData(options: RemovalOptions): Promise<void>;
1226
- /**
1227
- * Clears the browser's stored form data (autofill).
1228
- * @param callback Called when the browser's form data has been cleared.
1229
- */
1230
1195
  export function removeFormData(options: RemovalOptions, callback: () => void): void;
1196
+
1231
1197
  /**
1232
1198
  * Clears websites' file system data.
1233
- * @return The `removeFileSystems` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1199
+ *
1200
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1234
1201
  */
1235
1202
  export function removeFileSystems(options: RemovalOptions): Promise<void>;
1236
- /**
1237
- * Clears websites' file system data.
1238
- * @param callback Called when websites' file systems have been cleared.
1239
- */
1240
1203
  export function removeFileSystems(options: RemovalOptions, callback: () => void): void;
1204
+
1241
1205
  /**
1242
1206
  * Clears various types of browsing data stored in a user's profile.
1207
+ *
1208
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1243
1209
  * @param dataToRemove The set of data types to remove.
1244
- * @return The `remove` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1245
1210
  */
1246
1211
  export function remove(options: RemovalOptions, dataToRemove: DataTypeSet): Promise<void>;
1247
- /**
1248
- * Clears various types of browsing data stored in a user's profile.
1249
- * @param dataToRemove The set of data types to remove.
1250
- * @param callback Called when deletion has completed.
1251
- */
1252
1212
  export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback: () => void): void;
1213
+
1253
1214
  /**
1254
1215
  * Clears the browser's stored passwords.
1255
- * @return The `removePasswords` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1216
+ *
1217
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1256
1218
  */
1257
1219
  export function removePasswords(options: RemovalOptions): Promise<void>;
1258
- /**
1259
- * Clears the browser's stored passwords.
1260
- * @param callback Called when the browser's passwords have been cleared.
1261
- */
1262
1220
  export function removePasswords(options: RemovalOptions, callback: () => void): void;
1221
+
1263
1222
  /**
1264
1223
  * Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
1265
- * @return The `removeCookies` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1224
+ *
1225
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1266
1226
  */
1267
1227
  export function removeCookies(options: RemovalOptions): Promise<void>;
1268
- /**
1269
- * Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
1270
- * @param callback Called when the browser's cookies and server-bound certificates have been cleared.
1271
- */
1272
1228
  export function removeCookies(options: RemovalOptions, callback: () => void): void;
1229
+
1273
1230
  /**
1274
1231
  * Clears websites' WebSQL data.
1275
- * @return The `removeWebSQL` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1232
+ *
1233
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1276
1234
  */
1277
1235
  export function removeWebSQL(options: RemovalOptions): Promise<void>;
1278
- /**
1279
- * Clears websites' WebSQL data.
1280
- * @param callback Called when websites' WebSQL databases have been cleared.
1281
- */
1282
1236
  export function removeWebSQL(options: RemovalOptions, callback: () => void): void;
1237
+
1283
1238
  /**
1284
1239
  * Clears websites' appcache data.
1285
- * @return The `removeAppcache` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1240
+ *
1241
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1286
1242
  */
1287
1243
  export function removeAppcache(options: RemovalOptions): Promise<void>;
1288
- /**
1289
- * Clears websites' appcache data.
1290
- * @param callback Called when websites' appcache data has been cleared.
1291
- */
1292
1244
  export function removeAppcache(options: RemovalOptions, callback: () => void): void;
1293
- /** Clears websites' cache storage data.
1294
- * @return The `removeCacheStorage` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1245
+
1246
+ /**
1247
+ * Clears websites' cache storage data.
1248
+ *
1249
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1295
1250
  */
1296
1251
  export function removeCacheStorage(options: RemovalOptions): Promise<void>;
1297
- /** Clears websites' cache storage data.
1298
- * @param callback Called when websites' appcache data has been cleared.
1299
- */
1300
1252
  export function removeCacheStorage(options: RemovalOptions, callback: () => void): void;
1253
+
1301
1254
  /**
1302
1255
  * Clears the browser's list of downloaded files (not the downloaded files themselves).
1303
- * @return The `removeDownloads` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1256
+ *
1257
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1304
1258
  */
1305
1259
  export function removeDownloads(options: RemovalOptions): Promise<void>;
1306
- /**
1307
- * Clears the browser's list of downloaded files (not the downloaded files themselves).
1308
- * @param callback Called when the browser's list of downloaded files has been cleared.
1309
- */
1310
1260
  export function removeDownloads(options: RemovalOptions, callback: () => void): void;
1261
+
1311
1262
  /**
1312
1263
  * Clears websites' local storage data.
1313
- * @return The `removeLocalStorage` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1264
+ *
1265
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1314
1266
  */
1315
1267
  export function removeLocalStorage(options: RemovalOptions): Promise<void>;
1316
- /**
1317
- * Clears websites' local storage data.
1318
- * @param callback Called when websites' local storage has been cleared.
1319
- */
1320
1268
  export function removeLocalStorage(options: RemovalOptions, callback: () => void): void;
1269
+
1321
1270
  /**
1322
1271
  * Clears the browser's cache.
1323
- * @return The `removeCache` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1272
+ *
1273
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1324
1274
  */
1325
1275
  export function removeCache(options: RemovalOptions): Promise<void>;
1326
- /**
1327
- * Clears the browser's cache.
1328
- * @param callback Called when the browser's cache has been cleared.
1329
- */
1330
1276
  export function removeCache(options: RemovalOptions, callback: () => void): void;
1277
+
1331
1278
  /**
1332
1279
  * Clears the browser's history.
1333
- * @return The `removeHistory` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1280
+ *
1281
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1334
1282
  */
1335
1283
  export function removeHistory(options: RemovalOptions): Promise<void>;
1336
- /**
1337
- * Clears the browser's history.
1338
- * @param callback Called when the browser's history has cleared.
1339
- */
1340
1284
  export function removeHistory(options: RemovalOptions, callback: () => void): void;
1285
+
1341
1286
  /**
1342
1287
  * Clears websites' IndexedDB data.
1343
- * @return The `removeIndexedDB` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1288
+ *
1289
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1344
1290
  */
1345
1291
  export function removeIndexedDB(options: RemovalOptions): Promise<void>;
1346
- /**
1347
- * Clears websites' IndexedDB data.
1348
- * @param callback Called when websites' IndexedDB data has been cleared.
1349
- */
1350
1292
  export function removeIndexedDB(options: RemovalOptions, callback: () => void): void;
1351
1293
  }
1352
1294
 
@@ -1600,29 +1542,24 @@ declare namespace chrome {
1600
1542
  */
1601
1543
  export namespace commands {
1602
1544
  export interface Command {
1603
- /** Optional. The name of the Extension Command */
1604
- name?: string | undefined;
1605
- /** Optional. The Extension Command description */
1606
- description?: string | undefined;
1607
- /** Optional. The shortcut active for this command, or blank if not active. */
1608
- shortcut?: string | undefined;
1545
+ /** The name of the Extension Command */
1546
+ name?: string;
1547
+ /** The Extension Command description */
1548
+ description?: string;
1549
+ /** The shortcut active for this command, or blank if not active. */
1550
+ shortcut?: string;
1609
1551
  }
1610
1552
 
1611
- export interface CommandEvent extends chrome.events.Event<(command: string, tab: chrome.tabs.Tab) => void> {}
1612
-
1613
1553
  /**
1614
- * Returns all the registered extension commands for this extension and their shortcut (if active).
1615
- * @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
1554
+ * Returns all the registered extension commands for this extension and their shortcut (if active). Before Chrome 110, this command did not return `_execute_action`.
1555
+ *
1556
+ * Can return its result via Promise in Manifest V3 or later since Chrome 96.
1616
1557
  */
1617
1558
  export function getAll(): Promise<Command[]>;
1618
- /**
1619
- * Returns all the registered extension commands for this extension and their shortcut (if active).
1620
- * @param callback Called to return the registered commands.
1621
- */
1622
1559
  export function getAll(callback: (commands: Command[]) => void): void;
1623
1560
 
1624
1561
  /** Fired when a registered command is activated using a keyboard shortcut. */
1625
- export var onCommand: CommandEvent;
1562
+ export const onCommand: events.Event<(command: string, tab?: tabs.Tab) => void>;
1626
1563
  }
1627
1564
 
1628
1565
  ////////////////////
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
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": "131e5a519538e0fd73a2e764f34363c45bfa0795a8c8520f19fd445a0aeeae3d",
98
- "typeScriptVersion": "5.1"
97
+ "typesPublisherContentHash": "c8c961b7bcd05535fa54883ad1f2343b3a64565402676ca65423e02ce6537d13",
98
+ "typeScriptVersion": "5.2"
99
99
  }