@types/chrome 0.0.173 → 0.0.177

Sign up to get free protection for your applications and to get access to all the features.
chrome/index.d.ts CHANGED
@@ -21,6 +21,7 @@
21
21
 
22
22
  /// <reference types="filesystem" />
23
23
  /// <reference path="./har-format/index.d.ts" />
24
+ /// <reference path="./chrome-cast/index.d.ts" />
24
25
 
25
26
  ////////////////////
26
27
  // Global object
@@ -496,7 +497,7 @@ declare namespace chrome.bookmarks {
496
497
  * Since Chrome 37.
497
498
  * Indicates the reason why this node is unmodifiable. The managed value indicates that this node was configured by the system administrator or by the custodian of a supervised user. Omitted if the node can be modified by the user and the extension (default).
498
499
  */
499
- unmodifiable?: any;
500
+ unmodifiable?: 'managed' | undefined;
500
501
  }
501
502
 
502
503
  export interface BookmarkRemoveInfo {
@@ -795,7 +796,7 @@ declare namespace chrome.browserAction {
795
796
 
796
797
  export interface TabIconDetails {
797
798
  /** Optional. Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}' */
798
- path?: any;
799
+ path?: string | { [index: string]: string } | undefined;
799
800
  /** Optional. Limits the change to when a particular tab is selected. Automatically resets when the tab is closed. */
800
801
  tabId?: number | undefined;
801
802
  /** Optional. Either an ImageData object or a dictionary {size -> ImageData} representing icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.imageData = foo' is equivalent to 'details.imageData = {'19': foo}' */
@@ -951,10 +952,10 @@ declare namespace chrome.browserAction {
951
952
  */
952
953
  declare namespace chrome.browsingData {
953
954
  export interface OriginTypes {
954
- /** Optional. Websites that have been installed as hosted applications (be careful!). */
955
- protectedWeb?: boolean | undefined;
956
955
  /** Optional. Extensions and packaged applications a user has installed (be _really_ careful!). */
957
956
  extension?: boolean | undefined;
957
+ /** Optional. Websites that have been installed as hosted applications (be careful!). */
958
+ protectedWeb?: boolean | undefined;
958
959
  /** Optional. Normal websites. */
959
960
  unprotectedWeb?: boolean | undefined;
960
961
  }
@@ -963,11 +964,25 @@ declare namespace chrome.browsingData {
963
964
  export interface RemovalOptions {
964
965
  /**
965
966
  * Optional.
966
- * Since Chrome 21.
967
- * 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'.
967
+ * Since Chrome 74.
968
+ * 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.
969
+ */
970
+ excludeOrigins?: string[] | undefined;
971
+ /**
972
+ * Optional.
973
+ * 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'.
968
974
  */
969
975
  originTypes?: OriginTypes | undefined;
970
- /** Optional. Remove data accumulated on or after this date, represented in milliseconds since the epoch (accessible via the getTime method of the JavaScript Date object). If absent, defaults to 0 (which would remove all browsing data). */
976
+ /**
977
+ * Optional.
978
+ * Since Chrome 74.
979
+ * 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.
980
+ */
981
+ origins?: string[] | undefined;
982
+ /**
983
+ * Optional.
984
+ * 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).
985
+ */
971
986
  since?: number | undefined;
972
987
  }
973
988
 
@@ -984,7 +999,12 @@ declare namespace chrome.browsingData {
984
999
  cookies?: boolean | undefined;
985
1000
  /** Optional. Stored passwords. */
986
1001
  passwords?: boolean | undefined;
987
- /** Optional. Server-bound certificates. */
1002
+ /**
1003
+ * @deprecated Deprecated since Chrome 76.
1004
+ * Support for server-bound certificates has been removed. This data type will be ignored.
1005
+ *
1006
+ * Optional. Server-bound certificates.
1007
+ */
988
1008
  serverBoundCertificates?: boolean | undefined;
989
1009
  /** Optional. The browser's download list. */
990
1010
  downloads?: boolean | undefined;
@@ -994,7 +1014,12 @@ declare namespace chrome.browsingData {
994
1014
  appcache?: boolean | undefined;
995
1015
  /** Optional. Websites' file systems. */
996
1016
  fileSystems?: boolean | undefined;
997
- /** Optional. Plugins' data. */
1017
+ /**
1018
+ * @deprecated Deprecated since Chrome 88.
1019
+ * Support for Flash has been removed. This data type will be ignored.
1020
+ *
1021
+ * Optional. Plugins' data.
1022
+ */
998
1023
  pluginData?: boolean | undefined;
999
1024
  /** Optional. Websites' local storage data. */
1000
1025
  localStorage?: boolean | undefined;
@@ -1026,12 +1051,23 @@ declare namespace chrome.browsingData {
1026
1051
  */
1027
1052
  export function settings(callback: (result: SettingsCallback) => void): void;
1028
1053
  /**
1054
+ * @deprecated Deprecated since Chrome 88.
1055
+ * Support for Flash has been removed. This function has no effect.
1056
+ *
1029
1057
  * Clears plugins' data.
1030
1058
  * @param callback Called when plugins' data has been cleared.
1031
1059
  * If you specify the callback parameter, it should be a function that looks like this:
1032
1060
  * function() {...};
1033
1061
  */
1034
1062
  export function removePluginData(options: RemovalOptions, callback?: () => void): void;
1063
+ /**
1064
+ * Since Chrome 72.
1065
+ * Clears websites' service workers.
1066
+ * @param callback Called when the browser's service workers have been cleared.
1067
+ * If you specify the callback parameter, it should be a function that looks like this:
1068
+ * function() {...};
1069
+ */
1070
+ export function removeServiceWorkers(options: RemovalOptions, callback?: () => void): void;
1035
1071
  /**
1036
1072
  * Clears the browser's stored form data (autofill).
1037
1073
  * @param callback Called when the browser's form data has been cleared.
@@ -1173,11 +1209,13 @@ declare namespace chrome.contentSettings {
1173
1209
  scope?: ScopeEnum | undefined;
1174
1210
  }
1175
1211
 
1212
+ type DefaultContentSettingDetails = 'allow' | 'ask' | 'block' | 'detect_important_content' | 'session_only';
1213
+
1176
1214
  export interface SetDetails {
1177
1215
  /** Optional. The resource identifier for the content type. */
1178
1216
  resourceIdentifier?: ResourceIdentifier | undefined;
1179
1217
  /** The setting applied by this rule. See the description of the individual ContentSetting objects for the possible values. */
1180
- setting: any;
1218
+ setting: DefaultContentSettingDetails;
1181
1219
  /** Optional. The pattern for the secondary URL. Defaults to matching all URLs. For details on the format of a pattern, see Content Setting Patterns. */
1182
1220
  secondaryPattern?: string | undefined;
1183
1221
  /** Optional. Where to set the setting (default: regular). */
@@ -1251,7 +1289,7 @@ declare namespace chrome.contentSettings {
1251
1289
 
1252
1290
  export interface ReturnedDetails {
1253
1291
  /** The content setting. See the description of the individual ContentSetting objects for the possible values. */
1254
- setting: any;
1292
+ setting: DefaultContentSettingDetails;
1255
1293
  }
1256
1294
 
1257
1295
  export interface ContentSetting {
@@ -1283,54 +1321,67 @@ declare namespace chrome.contentSettings {
1283
1321
 
1284
1322
  export interface CookieContentSetting extends ContentSetting {
1285
1323
  set(details: CookieSetDetails, callback?: () => void): void;
1324
+ get(details: GetDetails, callback: (details: CookieSetDetails) => void): void;
1286
1325
  }
1287
1326
 
1288
1327
  export interface PopupsContentSetting extends ContentSetting {
1289
1328
  set(details: PopupsSetDetails, callback?: () => void): void;
1329
+ get(details: GetDetails, callback: (details: PopupsSetDetails) => void): void;
1290
1330
  }
1291
1331
 
1292
1332
  export interface JavascriptContentSetting extends ContentSetting {
1293
1333
  set(details: JavascriptSetDetails, callback?: () => void): void;
1334
+ get(details: GetDetails, callback: (details: JavascriptSetDetails) => void): void;
1294
1335
  }
1295
1336
 
1296
1337
  export interface NotificationsContentSetting extends ContentSetting {
1297
1338
  set(details: NotificationsSetDetails, callback?: () => void): void;
1339
+ get(details: GetDetails, callback: (details: NotificationsSetDetails) => void): void;
1298
1340
  }
1299
1341
 
1300
1342
  export interface PluginsContentSetting extends ContentSetting {
1301
1343
  set(details: PluginsSetDetails, callback?: () => void): void;
1344
+ get(details: GetDetails, callback: (details: PluginsSetDetails) => void): void;
1302
1345
  }
1303
1346
 
1304
1347
  export interface ImagesContentSetting extends ContentSetting {
1305
1348
  set(details: ImagesSetDetails, callback?: () => void): void;
1349
+ get(details: GetDetails, callback: (details: ImagesSetDetails) => void): void;
1306
1350
  }
1307
1351
 
1308
1352
  export interface LocationContentSetting extends ContentSetting {
1309
1353
  set(details: LocationSetDetails, callback?: () => void): void;
1354
+ get(details: GetDetails, callback: (details: LocationSetDetails) => void): void;
1310
1355
  }
1311
1356
 
1312
1357
  export interface FullscreenContentSetting extends ContentSetting {
1313
1358
  set(details: FullscreenSetDetails, callback?: () => void): void;
1359
+ get(details: GetDetails, callback: (details: FullscreenSetDetails) => void): void;
1314
1360
  }
1315
1361
 
1316
1362
  export interface MouselockContentSetting extends ContentSetting {
1317
1363
  set(details: MouselockSetDetails, callback?: () => void): void;
1364
+ get(details: GetDetails, callback: (details: MouselockSetDetails) => void): void;
1318
1365
  }
1319
1366
 
1320
1367
  export interface MicrophoneContentSetting extends ContentSetting {
1321
1368
  set(details: MicrophoneSetDetails, callback?: () => void): void;
1369
+ get(details: GetDetails, callback: (details: MicrophoneSetDetails) => void): void;
1322
1370
  }
1323
1371
 
1324
1372
  export interface CameraContentSetting extends ContentSetting {
1325
1373
  set(details: CameraSetDetails, callback?: () => void): void;
1374
+ get(details: GetDetails, callback: (details: CameraSetDetails) => void): void;
1326
1375
  }
1327
1376
 
1328
1377
  export interface PpapiBrokerContentSetting extends ContentSetting {
1329
1378
  set(details: PpapiBrokerSetDetails, callback?: () => void): void;
1379
+ get(details: GetDetails, callback: (details: PpapiBrokerSetDetails) => void): void;
1330
1380
  }
1331
1381
 
1332
1382
  export interface MultipleAutomaticDownloadsContentSetting extends ContentSetting {
1333
1383
  set(details: MultipleAutomaticDownloadsSetDetails, callback?: () => void): void;
1384
+ get(details: GetDetails, callback: (details: MultipleAutomaticDownloadsSetDetails) => void): void;
1334
1385
  }
1335
1386
 
1336
1387
  /** The only content type using resource identifiers is contentSettings.plugins. For more information, see Resource Identifiers. */
@@ -1576,7 +1627,7 @@ declare namespace chrome.contextMenus {
1576
1627
  */
1577
1628
  onclick?: ((info: OnClickData, tab: chrome.tabs.Tab) => void) | undefined;
1578
1629
  /** Optional. The ID of a parent menu item; this makes the item a child of a previously added item. */
1579
- parentId?: any;
1630
+ parentId?: number | string | undefined;
1580
1631
  /** Optional. The type of menu item. Defaults to 'normal' if not specified. */
1581
1632
  type?: ContextItemType | undefined;
1582
1633
  /**
@@ -2074,11 +2125,11 @@ declare namespace chrome.declarativeContent {
2074
2125
  declare namespace chrome.declarativeWebRequest {
2075
2126
  export interface HeaderFilter {
2076
2127
  nameEquals?: string | undefined;
2077
- valueContains?: any;
2128
+ valueContains?: string | string[] | undefined;
2078
2129
  nameSuffix?: string | undefined;
2079
2130
  valueSuffix?: string | undefined;
2080
2131
  valuePrefix?: string | undefined;
2081
- nameContains?: any;
2132
+ nameContains?: string | string[] | undefined;
2082
2133
  valueEquals?: string | undefined;
2083
2134
  namePrefix?: string | undefined;
2084
2135
  }
@@ -3182,7 +3233,7 @@ declare namespace chrome.events {
3182
3233
  /** Optional. Matches if the URL (without fragment identifier) ends with a specified string. Port numbers are stripped from the URL if they match the default port number. */
3183
3234
  urlSuffix?: string | undefined;
3184
3235
  /** Optional. Matches if the port of the URL is contained in any of the specified port lists. For example [80, 443, [1000, 1200]] matches all requests on port 80, 443 and in the range 1000-1200. */
3185
- ports?: any[] | undefined;
3236
+ ports?: (number | number[])[] | undefined;
3186
3237
  /**
3187
3238
  * Optional.
3188
3239
  * Since Chrome 28.
@@ -4284,7 +4335,7 @@ declare namespace chrome.i18n {
4284
4335
  * @param messageName The name of the message, as specified in the messages.json file.
4285
4336
  * @param substitutions Optional. Up to 9 substitution strings, if the message requires any.
4286
4337
  */
4287
- export function getMessage(messageName: string, substitutions?: any): string;
4338
+ export function getMessage(messageName: string, substitutions?: string | string[]): string;
4288
4339
  /**
4289
4340
  * Gets the browser UI language of the browser. This is different from i18n.getAcceptLanguages which returns the preferred user languages.
4290
4341
  * @since Chrome 35.
@@ -5698,7 +5749,7 @@ declare namespace chrome.pageAction {
5698
5749
  * Optional.
5699
5750
  * Either a relative image path or a dictionary {size -> relative image path} pointing to icon to be set. If the icon is specified as a dictionary, the actual image to be used is chosen depending on screen's pixel density. If the number of image pixels that fit into one screen space unit equals scale, then image with size scale * 19 will be selected. Initially only scales 1 and 2 will be supported. At least one image must be specified. Note that 'details.path = foo' is equivalent to 'details.imageData = {'19': foo}'
5700
5751
  */
5701
- path?: any;
5752
+ path?: string | { [index: string]: string } | undefined;
5702
5753
  }
5703
5754
 
5704
5755
  /**
@@ -5769,7 +5820,7 @@ declare namespace chrome.pageCapture {
5769
5820
  * function(binary mhtmlData) {...};
5770
5821
  * Parameter mhtmlData: The MHTML data as a Blob.
5771
5822
  */
5772
- export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData: any) => void): void;
5823
+ export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: ArrayBuffer) => void): void;
5773
5824
  }
5774
5825
 
5775
5826
  ////////////////////
@@ -6761,8 +6812,7 @@ declare namespace chrome.runtime {
6761
6812
  icons?: ManifestIcons | undefined;
6762
6813
 
6763
6814
  // Optional
6764
- author?: any;
6765
- automation?: any;
6815
+ author?: string | undefined;
6766
6816
  background_page?: string | undefined;
6767
6817
  chrome_settings_overrides?: {
6768
6818
  homepage?: string | undefined;
@@ -6809,7 +6859,6 @@ declare namespace chrome.runtime {
6809
6859
  exclude_globs?: string[] | undefined;
6810
6860
  }[] | undefined;
6811
6861
  converted_from_user_script?: boolean | undefined;
6812
- copresence?: any;
6813
6862
  current_locale?: string | undefined;
6814
6863
  devtools_page?: string | undefined;
6815
6864
  event_rules?: {
@@ -6850,7 +6899,7 @@ declare namespace chrome.runtime {
6850
6899
  id?: string | undefined;
6851
6900
  description?: string | undefined;
6852
6901
  language?: string | undefined;
6853
- layouts?: any[] | undefined;
6902
+ layouts?: string[] | undefined;
6854
6903
  }[] | undefined;
6855
6904
  key?: string | undefined;
6856
6905
  minimum_chrome_version?: string | undefined;
@@ -6892,7 +6941,6 @@ declare namespace chrome.runtime {
6892
6941
  content_security_policy?: string | undefined;
6893
6942
  } | undefined;
6894
6943
  short_name?: string | undefined;
6895
- signature?: any;
6896
6944
  spellcheck?: {
6897
6945
  dictionary_language?: string | undefined;
6898
6946
  dictionary_locale?: string | undefined;
@@ -6902,7 +6950,6 @@ declare namespace chrome.runtime {
6902
6950
  storage?: {
6903
6951
  managed_schema: string;
6904
6952
  } | undefined;
6905
- system_indicator?: any;
6906
6953
  tts_engine?: {
6907
6954
  voices: {
6908
6955
  voice_name: string;
@@ -9834,6 +9881,8 @@ declare namespace chrome.ttsEngine {
9834
9881
  * @since Chrome 13.
9835
9882
  */
9836
9883
  declare namespace chrome.types {
9884
+ type settingsScope = 'regular' | 'regular_only' | 'incognito_persistent' | 'incognito_session_only' | undefined;
9885
+
9837
9886
  export interface ChromeSettingClearDetails {
9838
9887
  /**
9839
9888
  * Optional.
@@ -9843,7 +9892,7 @@ declare namespace chrome.types {
9843
9892
  * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),
9844
9893
  * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
9845
9894
  */
9846
- scope?: string | undefined;
9895
+ scope?: settingsScope;
9847
9896
  }
9848
9897
 
9849
9898
  export interface ChromeSettingSetDetails extends ChromeSettingClearDetails {
@@ -9860,7 +9909,7 @@ declare namespace chrome.types {
9860
9909
  * • incognito_persistent: setting for the incognito profile that survives browser restarts (overrides regular preferences),
9861
9910
  * • incognito_session_only: setting for the incognito profile that can only be set during an incognito session and is deleted when the incognito session ends (overrides regular and incognito_persistent preferences).
9862
9911
  */
9863
- scope?: string | undefined;
9912
+ scope?: settingsScope;
9864
9913
  }
9865
9914
 
9866
9915
  export interface ChromeSettingGetDetails {
@@ -9881,7 +9930,7 @@ declare namespace chrome.types {
9881
9930
  * • controllable_by_this_extension: can be controlled by this extension
9882
9931
  * • controlled_by_this_extension: controlled by this extension
9883
9932
  */
9884
- levelOfControl: string;
9933
+ levelOfControl: 'not_controllable' | 'controlled_by_other_extensions' | 'controllable_by_this_extension' | 'controlled_by_this_extension';
9885
9934
  /** The value of the setting. */
9886
9935
  value: any;
9887
9936
  /**
@@ -10019,14 +10068,14 @@ declare namespace chrome.vpnProvider {
10019
10068
  declare namespace chrome.wallpaper {
10020
10069
  export interface WallpaperDetails {
10021
10070
  /** Optional. The jpeg or png encoded wallpaper image. */
10022
- data?: any;
10071
+ data?: ArrayBuffer | undefined;
10023
10072
  /** Optional. The URL of the wallpaper to be set. */
10024
10073
  url?: string | undefined;
10025
10074
  /**
10026
10075
  * The supported wallpaper layouts.
10027
10076
  * One of: "STRETCH", "CENTER", or "CENTER_CROPPED"
10028
10077
  */
10029
- layout: string;
10078
+ layout: 'STRETCH' | 'CENTER' | 'CENTER_CROPPED';
10030
10079
  /** The file name of the saved wallpaper. */
10031
10080
  filename: string;
10032
10081
  /** Optional. True if a 128x60 thumbnail should be generated. */
@@ -10038,7 +10087,7 @@ declare namespace chrome.wallpaper {
10038
10087
  * @param callback
10039
10088
  * Optional parameter thumbnail: The jpeg encoded wallpaper thumbnail. It is generated by resizing the wallpaper to 128x60.
10040
10089
  */
10041
- export function setWallpaper(details: WallpaperDetails, callback: (thumbnail: any) => void): void;
10090
+ export function setWallpaper(details: WallpaperDetails, callback: (thumbnail?: ArrayBuffer) => void): void;
10042
10091
  }
10043
10092
 
10044
10093
  ////////////////////
@@ -11209,7 +11258,7 @@ declare namespace chrome.declarativeNetRequest {
11209
11258
  * An ID of {@link chrome.tabs.TAB_ID_NONE} excludes requests which don't originate from a tab.
11210
11259
  * An empty list is not allowed. Only supported for session-scoped rules.
11211
11260
  */
11212
- tabIds?: number | undefined;
11261
+ tabIds?: number[] | undefined;
11213
11262
 
11214
11263
  /**
11215
11264
  * The pattern which is matched against the network request url.
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.173",
3
+ "version": "0.0.177",
4
4
  "description": "TypeScript definitions for Chrome extension development",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome",
6
6
  "license": "MIT",
@@ -98,6 +98,6 @@
98
98
  "@types/filesystem": "*",
99
99
  "@types/har-format": "*"
100
100
  },
101
- "typesPublisherContentHash": "fbe995bc0c62c1c3411056a81eb115bed3b617527d187fc0cebf08338b4e25b8",
101
+ "typesPublisherContentHash": "a5f93025e2722961165bcf68177c845ec912f4bac2651adf4280653df9f12a46",
102
102
  "typeScriptVersion": "3.8"
103
103
  }