@types/chrome 0.0.177 → 0.0.180

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. chrome/README.md +1 -1
  2. chrome/index.d.ts +329 -8
  3. chrome/package.json +3 -3
chrome/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Chrome extension development (http://
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chrome.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Mon, 24 Jan 2022 14:01:35 GMT
11
+ * Last updated: Tue, 15 Mar 2022 22:01:47 GMT
12
12
  * Dependencies: [@types/filesystem](https://npmjs.com/package/@types/filesystem), [@types/har-format](https://npmjs.com/package/@types/har-format)
13
13
  * Global values: `chrome`
14
14
 
chrome/index.d.ts CHANGED
@@ -1035,7 +1035,7 @@ declare namespace chrome.browsingData {
1035
1035
  serviceWorkers?: boolean | undefined;
1036
1036
  }
1037
1037
 
1038
- export interface SettingsCallback {
1038
+ export interface SettingsResult {
1039
1039
  options: RemovalOptions;
1040
1040
  /** 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. */
1041
1041
  dataToRemove: DataTypeSet;
@@ -1043,13 +1043,27 @@ declare namespace chrome.browsingData {
1043
1043
  dataRemovalPermitted: DataTypeSet;
1044
1044
  }
1045
1045
 
1046
+ /**
1047
+ * Since Chrome 26.
1048
+ * 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.
1049
+ * @return The `settings` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1050
+ */
1051
+ export function settings(): Promise<SettingsResult>;
1046
1052
  /**
1047
1053
  * Since Chrome 26.
1048
1054
  * 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.
1049
1055
  * @param callback The callback parameter should be a function that looks like this:
1050
1056
  * function(object result) {...};
1051
1057
  */
1052
- export function settings(callback: (result: SettingsCallback) => void): void;
1058
+ export function settings(callback: (result: SettingsResult) => void): void;
1059
+ /**
1060
+ * @deprecated Deprecated since Chrome 88.
1061
+ * Support for Flash has been removed. This function has no effect.
1062
+ *
1063
+ * Clears plugins' data.
1064
+ * @return The `removePluginData` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1065
+ */
1066
+ export function removePluginData(options: RemovalOptions): Promise<void>;
1053
1067
  /**
1054
1068
  * @deprecated Deprecated since Chrome 88.
1055
1069
  * Support for Flash has been removed. This function has no effect.
@@ -1060,6 +1074,12 @@ declare namespace chrome.browsingData {
1060
1074
  * function() {...};
1061
1075
  */
1062
1076
  export function removePluginData(options: RemovalOptions, callback?: () => void): void;
1077
+ /**
1078
+ * Since Chrome 72.
1079
+ * Clears websites' service workers.
1080
+ * @return The `removeServiceWorkers` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1081
+ */
1082
+ export function removeServiceWorkers(options: RemovalOptions): Promise<void>;
1063
1083
  /**
1064
1084
  * Since Chrome 72.
1065
1085
  * Clears websites' service workers.
@@ -1068,6 +1088,11 @@ declare namespace chrome.browsingData {
1068
1088
  * function() {...};
1069
1089
  */
1070
1090
  export function removeServiceWorkers(options: RemovalOptions, callback?: () => void): void;
1091
+ /**
1092
+ * Clears the browser's stored form data (autofill).
1093
+ * @return The `removeFormData` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1094
+ */
1095
+ export function removeFormData(options: RemovalOptions): Promise<void>;
1071
1096
  /**
1072
1097
  * Clears the browser's stored form data (autofill).
1073
1098
  * @param callback Called when the browser's form data has been cleared.
@@ -1075,6 +1100,11 @@ declare namespace chrome.browsingData {
1075
1100
  * function() {...};
1076
1101
  */
1077
1102
  export function removeFormData(options: RemovalOptions, callback?: () => void): void;
1103
+ /**
1104
+ * Clears websites' file system data.
1105
+ * @return The `removeFileSystems` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1106
+ */
1107
+ export function removeFileSystems(options: RemovalOptions): Promise<void>;
1078
1108
  /**
1079
1109
  * Clears websites' file system data.
1080
1110
  * @param callback Called when websites' file systems have been cleared.
@@ -1082,6 +1112,12 @@ declare namespace chrome.browsingData {
1082
1112
  * function() {...};
1083
1113
  */
1084
1114
  export function removeFileSystems(options: RemovalOptions, callback?: () => void): void;
1115
+ /**
1116
+ * Clears various types of browsing data stored in a user's profile.
1117
+ * @param dataToRemove The set of data types to remove.
1118
+ * @return The `remove` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1119
+ */
1120
+ export function remove(options: RemovalOptions, dataToRemove: DataTypeSet): Promise<void>;
1085
1121
  /**
1086
1122
  * Clears various types of browsing data stored in a user's profile.
1087
1123
  * @param dataToRemove The set of data types to remove.
@@ -1090,6 +1126,11 @@ declare namespace chrome.browsingData {
1090
1126
  * function() {...};
1091
1127
  */
1092
1128
  export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback?: () => void): void;
1129
+ /**
1130
+ * Clears the browser's stored passwords.
1131
+ * @return The `removePasswords` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1132
+ */
1133
+ export function removePasswords(options: RemovalOptions): Promise<void>;
1093
1134
  /**
1094
1135
  * Clears the browser's stored passwords.
1095
1136
  * @param callback Called when the browser's passwords have been cleared.
@@ -1097,6 +1138,11 @@ declare namespace chrome.browsingData {
1097
1138
  * function() {...};
1098
1139
  */
1099
1140
  export function removePasswords(options: RemovalOptions, callback?: () => void): void;
1141
+ /**
1142
+ * Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
1143
+ * @return The `removeCookies` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1144
+ */
1145
+ export function removeCookies(options: RemovalOptions, callback?: () => void): Promise<void>;
1100
1146
  /**
1101
1147
  * Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
1102
1148
  * @param callback Called when the browser's cookies and server-bound certificates have been cleared.
@@ -1104,6 +1150,11 @@ declare namespace chrome.browsingData {
1104
1150
  * function() {...};
1105
1151
  */
1106
1152
  export function removeCookies(options: RemovalOptions, callback?: () => void): void;
1153
+ /**
1154
+ * Clears websites' WebSQL data.
1155
+ * @return The `removeWebSQL` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1156
+ */
1157
+ export function removeWebSQL(options: RemovalOptions): Promise<void>;
1107
1158
  /**
1108
1159
  * Clears websites' WebSQL data.
1109
1160
  * @param callback Called when websites' WebSQL databases have been cleared.
@@ -1111,6 +1162,11 @@ declare namespace chrome.browsingData {
1111
1162
  * function() {...};
1112
1163
  */
1113
1164
  export function removeWebSQL(options: RemovalOptions, callback?: () => void): void;
1165
+ /**
1166
+ * Clears websites' appcache data.
1167
+ * @return The `removeAppcache` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1168
+ */
1169
+ export function removeAppcache(options: RemovalOptions): Promise<void>;
1114
1170
  /**
1115
1171
  * Clears websites' appcache data.
1116
1172
  * @param callback Called when websites' appcache data has been cleared.
@@ -1118,6 +1174,21 @@ declare namespace chrome.browsingData {
1118
1174
  * function() {...};
1119
1175
  */
1120
1176
  export function removeAppcache(options: RemovalOptions, callback?: () => void): void;
1177
+ /** Clears websites' cache storage data.
1178
+ * @return The `removeCacheStorage` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1179
+ */
1180
+ export function removeCacheStorage(options: RemovalOptions): Promise<void>
1181
+ /** Clears websites' cache storage data.
1182
+ * @param callback Called when websites' appcache data has been cleared.
1183
+ * If you specify the callback parameter, it should be a function that looks like this:
1184
+ * function() {...};
1185
+ */
1186
+ export function removeCacheStorage(options: RemovalOptions, callback?: () => void): void
1187
+ /**
1188
+ * Clears the browser's list of downloaded files (not the downloaded files themselves).
1189
+ * @return The `removeDownloads` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1190
+ */
1191
+ export function removeDownloads(options: RemovalOptions): Promise<void>
1121
1192
  /**
1122
1193
  * Clears the browser's list of downloaded files (not the downloaded files themselves).
1123
1194
  * @param callback Called when the browser's list of downloaded files has been cleared.
@@ -1125,6 +1196,11 @@ declare namespace chrome.browsingData {
1125
1196
  * function() {...};
1126
1197
  */
1127
1198
  export function removeDownloads(options: RemovalOptions, callback?: () => void): void;
1199
+ /**
1200
+ * Clears websites' local storage data.
1201
+ * @return The `removeLocalStorage` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1202
+ */
1203
+ export function removeLocalStorage(options: RemovalOptions): Promise<void>;
1128
1204
  /**
1129
1205
  * Clears websites' local storage data.
1130
1206
  * @param callback Called when websites' local storage has been cleared.
@@ -1132,6 +1208,11 @@ declare namespace chrome.browsingData {
1132
1208
  * function() {...};
1133
1209
  */
1134
1210
  export function removeLocalStorage(options: RemovalOptions, callback?: () => void): void;
1211
+ /**
1212
+ * Clears the browser's cache.
1213
+ * @return The `removeCache` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1214
+ */
1215
+ export function removeCache(options: RemovalOptions): Promise<void>;
1135
1216
  /**
1136
1217
  * Clears the browser's cache.
1137
1218
  * @param callback Called when the browser's cache has been cleared.
@@ -1139,6 +1220,11 @@ declare namespace chrome.browsingData {
1139
1220
  * function() {...};
1140
1221
  */
1141
1222
  export function removeCache(options: RemovalOptions, callback?: () => void): void;
1223
+ /**
1224
+ * Clears the browser's history.
1225
+ * @return The `removeHistory` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1226
+ */
1227
+ export function removeHistory(options: RemovalOptions): Promise<void>;
1142
1228
  /**
1143
1229
  * Clears the browser's history.
1144
1230
  * @param callback Called when the browser's history has cleared.
@@ -1146,6 +1232,11 @@ declare namespace chrome.browsingData {
1146
1232
  * function() {...};
1147
1233
  */
1148
1234
  export function removeHistory(options: RemovalOptions, callback?: () => void): void;
1235
+ /**
1236
+ * Clears websites' IndexedDB data.
1237
+ * @return The `removeIndexedDB` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1238
+ */
1239
+ export function removeIndexedDB(options: RemovalOptions): Promise<void>;
1149
1240
  /**
1150
1241
  * Clears websites' IndexedDB data.
1151
1242
  * @param callback Called when websites' IndexedDB data has been cleared.
@@ -1175,6 +1266,11 @@ declare namespace chrome.commands {
1175
1266
 
1176
1267
  export interface CommandEvent extends chrome.events.Event<(command: string, tab: chrome.tabs.Tab) => void> { }
1177
1268
 
1269
+ /**
1270
+ * Returns all the registered extension commands for this extension and their shortcut (if active).
1271
+ * @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
1272
+ */
1273
+ export function getAll(): Promise<Command[]>;
1178
1274
  /**
1179
1275
  * Returns all the registered extension commands for this extension and their shortcut (if active).
1180
1276
  * @param callback Called to return the registered commands.
@@ -1976,6 +2072,13 @@ declare module chrome {
1976
2072
  export interface DebuggerEventEvent
1977
2073
  extends chrome.events.Event<(source: Debuggee, method: string, params?: Object) => void> { }
1978
2074
 
2075
+ /**
2076
+ * Attaches debugger to the given target.
2077
+ * @param target Debugging target to which you want to attach.
2078
+ * @param requiredVersion Required debugging protocol version ("0.1"). One can only attach to the debuggee with matching major version and greater or equal minor version. List of the protocol versions can be obtained in the documentation pages.
2079
+ * @return The `attach` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
2080
+ */
2081
+ export function attach(target: Debuggee, requiredVersion: string): Promise<void>;
1979
2082
  /**
1980
2083
  * Attaches debugger to the given target.
1981
2084
  * @param target Debugging target to which you want to attach.
@@ -1985,6 +2088,12 @@ declare module chrome {
1985
2088
  * function() {...};
1986
2089
  */
1987
2090
  export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void;
2091
+ /**
2092
+ * Detaches debugger from the given target.
2093
+ * @param target Debugging target from which you want to detach.
2094
+ * @return The `detach` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
2095
+ */
2096
+ export function detach(target: Debuggee): Promise<void>;
1988
2097
  /**
1989
2098
  * Detaches debugger from the given target.
1990
2099
  * @param target Debugging target from which you want to detach.
@@ -1993,6 +2102,19 @@ declare module chrome {
1993
2102
  * function() {...};
1994
2103
  */
1995
2104
  export function detach(target: Debuggee, callback?: () => void): void;
2105
+ /**
2106
+ * Sends given command to the debugging target.
2107
+ * @param target Debugging target to which you want to send the command.
2108
+ * @param method Method name. Should be one of the methods defined by the remote debugging protocol.
2109
+ * @param commandParams Since Chrome 22.
2110
+ * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method.
2111
+ * @return The `sendCommand` method provides its result via callback or returned as a `Promise` (MV3 only).
2112
+ */
2113
+ export function sendCommand(
2114
+ target: Debuggee,
2115
+ method: string,
2116
+ commandParams?: Object,
2117
+ ): Promise<Object>;
1996
2118
  /**
1997
2119
  * Sends given command to the debugging target.
1998
2120
  * @param target Debugging target to which you want to send the command.
@@ -2009,6 +2131,12 @@ declare module chrome {
2009
2131
  commandParams?: Object,
2010
2132
  callback?: (result?: Object) => void,
2011
2133
  ): void;
2134
+ /**
2135
+ * Since Chrome 28.
2136
+ * Returns the list of available debug targets.
2137
+ * @return The `getTargets` method provides its result via callback or returned as a `Promise` (MV3 only).
2138
+ */
2139
+ export function getTargets(): Promise<TargetInfo[]>;
2012
2140
  /**
2013
2141
  * Since Chrome 28.
2014
2142
  * Returns the list of available debug targets.
@@ -2880,12 +3008,23 @@ declare namespace chrome.downloads {
2880
3008
  (downloadItem: DownloadItem, suggest: (suggestion?: DownloadFilenameSuggestion) => void) => void
2881
3009
  > { }
2882
3010
 
3011
+ /**
3012
+ * Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page.
3013
+ * @return The `search` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
3014
+ */
3015
+ export function search(query: DownloadQuery): Promise<DownloadItem[]>;
2883
3016
  /**
2884
3017
  * Find DownloadItem. Set query to the empty object to get all DownloadItem. To get a specific DownloadItem, set only the id field. To page through a large number of items, set orderBy: ['-startTime'], set limit to the number of items per page, and set startedAfter to the startTime of the last item from the last page.
2885
3018
  * @param callback The callback parameter should be a function that looks like this:
2886
3019
  * function(array of DownloadItem results) {...};
2887
3020
  */
2888
3021
  export function search(query: DownloadQuery, callback: (results: DownloadItem[]) => void): void;
3022
+ /**
3023
+ * Pause the download. If the request was successful the download is in a paused state. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active.
3024
+ * @param downloadId The id of the download to pause.
3025
+ * @return The `pause` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
3026
+ */
3027
+ export function pause(downloadId: number): Promise<void>;
2889
3028
  /**
2890
3029
  * Pause the download. If the request was successful the download is in a paused state. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active.
2891
3030
  * @param downloadId The id of the download to pause.
@@ -2894,6 +3033,12 @@ declare namespace chrome.downloads {
2894
3033
  * function() {...};
2895
3034
  */
2896
3035
  export function pause(downloadId: number, callback?: () => void): void;
3036
+ /**
3037
+ * Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message.
3038
+ * @param downloadId The identifier for the download.
3039
+ * @return The `getFileIcon` method provides its result via callback or returned as a `Promise` (MV3 only).
3040
+ */
3041
+ export function getFileIcon(downloadId: number, options?: GetFileIconOptions): Promise<string>;
2897
3042
  /**
2898
3043
  * Retrieve an icon for the specified download. For new downloads, file icons are available after the onCreated event has been received. The image returned by this function while a download is in progress may be different from the image returned after the download is complete. Icon retrieval is done by querying the underlying operating system or toolkit depending on the platform. The icon that is returned will therefore depend on a number of factors including state of the download, platform, registered file types and visual theme. If a file icon cannot be determined, runtime.lastError will contain an error message.
2899
3044
  * @param downloadId The identifier for the download.
@@ -2914,6 +3059,12 @@ declare namespace chrome.downloads {
2914
3059
  options: GetFileIconOptions,
2915
3060
  callback: (iconURL: string) => void,
2916
3061
  ): void;
3062
+ /**
3063
+ * Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active.
3064
+ * @param downloadId The id of the download to resume.
3065
+ * @return The `resume` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
3066
+ */
3067
+ export function resume(downloadId: number): Promise<void>;
2917
3068
  /**
2918
3069
  * Resume a paused download. If the request was successful the download is in progress and unpaused. Otherwise runtime.lastError contains an error message. The request will fail if the download is not active.
2919
3070
  * @param downloadId The id of the download to resume.
@@ -2922,6 +3073,12 @@ declare namespace chrome.downloads {
2922
3073
  * function() {...};
2923
3074
  */
2924
3075
  export function resume(downloadId: number, callback?: () => void): void;
3076
+ /**
3077
+ * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore.
3078
+ * @param downloadId The id of the download to cancel.
3079
+ * @return The `cancel` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
3080
+ */
3081
+ export function cancel(downloadId: number): Promise<void>;
2925
3082
  /**
2926
3083
  * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore.
2927
3084
  * @param downloadId The id of the download to cancel.
@@ -2930,6 +3087,12 @@ declare namespace chrome.downloads {
2930
3087
  * function() {...};
2931
3088
  */
2932
3089
  export function cancel(downloadId: number, callback?: () => void): void;
3090
+ /**
3091
+ * Download a URL. If the URL uses the HTTP[S] protocol, then the request will include all cookies currently set for its hostname. If both filename and saveAs are specified, then the Save As dialog will be displayed, pre-populated with the specified filename. If the download started successfully, callback will be called with the new DownloadItem's downloadId. If there was an error starting the download, then callback will be called with downloadId=undefined and runtime.lastError will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. Extensions must not parse it.
3092
+ * @param options What to download and how.
3093
+ * @return The `download` method provides its result via callback or returned as a `Promise` (MV3 only).
3094
+ */
3095
+ export function download(options: DownloadOptions): Promise<number>;
2933
3096
  /**
2934
3097
  * Download a URL. If the URL uses the HTTP[S] protocol, then the request will include all cookies currently set for its hostname. If both filename and saveAs are specified, then the Save As dialog will be displayed, pre-populated with the specified filename. If the download started successfully, callback will be called with the new DownloadItem's downloadId. If there was an error starting the download, then callback will be called with downloadId=undefined and runtime.lastError will contain a descriptive string. The error strings are not guaranteed to remain backwards compatible between releases. Extensions must not parse it.
2935
3098
  * @param options What to download and how.
@@ -2950,18 +3113,34 @@ declare namespace chrome.downloads {
2950
3113
  export function show(downloadId: number): void;
2951
3114
  /** Show the default Downloads folder in a file manager. */
2952
3115
  export function showDefaultFolder(): void;
3116
+ /**
3117
+ * Erase matching DownloadItem from history without deleting the downloaded file. An onErased event will fire for each DownloadItem that matches query, then callback will be called.
3118
+ * @return The `erase` method provides its result via callback or returned as a `Promise` (MV3 only).
3119
+ */
3120
+ export function erase(query: DownloadQuery): Promise<number[]>;
2953
3121
  /**
2954
3122
  * Erase matching DownloadItem from history without deleting the downloaded file. An onErased event will fire for each DownloadItem that matches query, then callback will be called.
2955
3123
  * @param callback If you specify the callback parameter, it should be a function that looks like this:
2956
3124
  * function(array of integer erasedIds) {...};
2957
3125
  */
2958
3126
  export function erase(query: DownloadQuery, callback: (erasedIds: number[]) => void): void;
3127
+ /**
3128
+ * Remove the downloaded file if it exists and the DownloadItem is complete; otherwise return an error through runtime.lastError.
3129
+ * @return The `removeFile` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
3130
+ */
3131
+ export function removeFile(downloadId: number): Promise<void>;
2959
3132
  /**
2960
3133
  * Remove the downloaded file if it exists and the DownloadItem is complete; otherwise return an error through runtime.lastError.
2961
3134
  * @param callback If you specify the callback parameter, it should be a function that looks like this:
2962
3135
  * function() {...};
2963
3136
  */
2964
3137
  export function removeFile(downloadId: number, callback?: () => void): void;
3138
+ /**
3139
+ * Prompt the user to accept a dangerous download. Can only be called from a visible context (tab, window, or page/browser action popup). Does not automatically accept dangerous downloads. If the download is accepted, then an onChanged event will fire, otherwise nothing will happen. When all the data is fetched into a temporary file and either the download is not dangerous or the danger has been accepted, then the temporary file is renamed to the target filename, the |state| changes to 'complete', and onChanged fires.
3140
+ * @param downloadId The identifier for the DownloadItem.
3141
+ * @return The `acceptDanger` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
3142
+ */
3143
+ export function acceptDanger(downloadId: number): Promise<void>;
2965
3144
  /**
2966
3145
  * Prompt the user to accept a dangerous download. Can only be called from a visible context (tab, window, or page/browser action popup). Does not automatically accept dangerous downloads. If the download is accepted, then an onChanged event will fire, otherwise nothing will happen. When all the data is fetched into a temporary file and either the download is not dangerous or the danger has been accepted, then the temporary file is renamed to the target filename, the |state| changes to 'complete', and onChanged fires.
2967
3146
  * @param downloadId The identifier for the DownloadItem.
@@ -3379,6 +3558,12 @@ declare namespace chrome.extension {
3379
3558
  export function setUpdateUrlData(data: string): void;
3380
3559
  /** Returns an array of the JavaScript 'window' objects for each of the pages running inside the current extension. */
3381
3560
  export function getViews(fetchProperties?: FetchProperties): Window[];
3561
+ /**
3562
+ * Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.
3563
+ * Since Chrome 12.
3564
+ * @return The `isAllowedFileSchemeAccess` method provides its result via callback or returned as a `Promise` (MV3 only).
3565
+ */
3566
+ export function isAllowedFileSchemeAccess(): Promise<boolean>;
3382
3567
  /**
3383
3568
  * Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.
3384
3569
  * Since Chrome 12.
@@ -3387,6 +3572,12 @@ declare namespace chrome.extension {
3387
3572
  * Parameter isAllowedAccess: True if the extension can access the 'file://' scheme, false otherwise.
3388
3573
  */
3389
3574
  export function isAllowedFileSchemeAccess(callback: (isAllowedAccess: boolean) => void): void;
3575
+ /**
3576
+ * Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.
3577
+ * Since Chrome 12.
3578
+ * @return The `isAllowedIncognitoAccess` method provides its result via callback or returned as a `Promise` (MV3 only).
3579
+ */
3580
+ export function isAllowedIncognitoAccess(): Promise<boolean>;
3390
3581
  /**
3391
3582
  * Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.
3392
3583
  * Since Chrome 12.
@@ -3948,7 +4139,13 @@ declare namespace chrome.fontSettings {
3948
4139
 
3949
4140
  export interface FontDetails {
3950
4141
  /** The generic font family for the font. */
3951
- genericFamily: string;
4142
+ genericFamily:
4143
+ | 'cursive'
4144
+ | 'fantasy'
4145
+ | 'fixed'
4146
+ | 'sansserif'
4147
+ | 'serif'
4148
+ | 'standard';
3952
4149
  /** Optional. The script for the font. If omitted, the global script font setting is affected. */
3953
4150
  script?: string | undefined;
3954
4151
  }
@@ -3996,18 +4193,34 @@ declare namespace chrome.fontSettings {
3996
4193
 
3997
4194
  export interface FontChangedEvent extends chrome.events.Event<(details: FullFontDetails) => void> { }
3998
4195
 
4196
+ /**
4197
+ * Sets the default font size.
4198
+ * @return The `setDefaultFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
4199
+ */
4200
+ export function setDefaultFontSize(details: DefaultFontSizeDetails): Promise<void>
3999
4201
  /**
4000
4202
  * Sets the default font size.
4001
4203
  * @param callback If you specify the callback parameter, it should be a function that looks like this:
4002
4204
  * function() {...};
4003
4205
  */
4004
4206
  export function setDefaultFontSize(details: DefaultFontSizeDetails, callback?: Function): void;
4207
+ /**
4208
+ * Gets the font for a given script and generic font family.
4209
+ * @return The `getFont` method provides its result via callback or returned as a `Promise` (MV3 only).
4210
+ */
4211
+ export function getFont(details: FontDetails): Promise<FontDetailsResult>
4005
4212
  /**
4006
4213
  * Gets the font for a given script and generic font family.
4007
4214
  * @param callback If you specify the callback parameter, it should be a function that looks like this:
4008
4215
  * function(object details) {...};
4009
4216
  */
4010
4217
  export function getFont(details: FontDetails, callback?: (details: FontDetailsResult) => void): void;
4218
+ /**
4219
+ * Gets the default font size.
4220
+ * @param details This parameter is currently unused.
4221
+ * @return The `getDefaultFontSize` method provides its result via callback or returned as a `Promise` (MV3 only).
4222
+ */
4223
+ export function getDefaultFontSize(details?: Object): Promise<FontSizeDetails>;
4011
4224
  /**
4012
4225
  * Gets the default font size.
4013
4226
  * @param details This parameter is currently unused.
@@ -4015,19 +4228,36 @@ declare namespace chrome.fontSettings {
4015
4228
  * function(object details) {...};
4016
4229
  */
4017
4230
  export function getDefaultFontSize(details?: Object, callback?: (options: FontSizeDetails) => void): void;
4231
+ /**
4232
+ * Gets the minimum font size.
4233
+ * @param details This parameter is currently unused.
4234
+ * @return The `getMinimumFontSize` method provides its result via callback or returned as a `Promise` (MV3 only).
4235
+ */
4236
+ export function getMinimumFontSize(details?: object): Promise<FontSizeDetails>;
4018
4237
  /**
4019
4238
  * Gets the minimum font size.
4020
4239
  * @param details This parameter is currently unused.
4021
4240
  * @param callback If you specify the callback parameter, it should be a function that looks like this:
4022
4241
  * function(object details) {...};
4023
4242
  */
4024
- export function getMinimumFontSize(details?: FontSizeDetails, callback?: (options: FontSizeDetails) => void): void;
4243
+ export function getMinimumFontSize(details?: object, callback?: (options: FontSizeDetails) => void): void;
4244
+ /**
4245
+ * Sets the minimum font size.
4246
+ * @return The `setMinimumFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
4247
+ */
4248
+ export function setMinimumFontSize(details: SetFontSizeDetails): Promise<void>;
4025
4249
  /**
4026
4250
  * Sets the minimum font size.
4027
4251
  * @param callback If you specify the callback parameter, it should be a function that looks like this:
4028
4252
  * function() {...};
4029
4253
  */
4030
4254
  export function setMinimumFontSize(details: SetFontSizeDetails, callback?: Function): void;
4255
+ /**
4256
+ * Gets the default size for fixed width fonts.
4257
+ * @param details This parameter is currently unused.
4258
+ * @return The `getDefaultFixedFontSize` method provides its result via callback or returned as a `Promise` (MV3 only).
4259
+ */
4260
+ export function getDefaultFixedFontSize(details?: Object): Promise<FontSizeDetails>;
4031
4261
  /**
4032
4262
  * Gets the default size for fixed width fonts.
4033
4263
  * @param details This parameter is currently unused.
@@ -4035,6 +4265,12 @@ declare namespace chrome.fontSettings {
4035
4265
  * function(object details) {...};
4036
4266
  */
4037
4267
  export function getDefaultFixedFontSize(details?: Object, callback?: (details: FontSizeDetails) => void): void;
4268
+ /**
4269
+ * Clears the default font size set by this extension, if any.
4270
+ * @param details This parameter is currently unused.
4271
+ * @return The `clearDefaultFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
4272
+ */
4273
+ export function clearDefaultFontSize(details?: Object): Promise<void>;
4038
4274
  /**
4039
4275
  * Clears the default font size set by this extension, if any.
4040
4276
  * @param details This parameter is currently unused.
@@ -4042,24 +4278,45 @@ declare namespace chrome.fontSettings {
4042
4278
  * function() {...};
4043
4279
  */
4044
4280
  export function clearDefaultFontSize(details?: Object, callback?: Function): void;
4281
+ /**
4282
+ * Sets the default size for fixed width fonts.
4283
+ * @return The `setDefaultFixedFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
4284
+ */
4285
+ export function setDefaultFixedFontSize(details: SetFontSizeDetails): Promise<void>;
4045
4286
  /**
4046
4287
  * Sets the default size for fixed width fonts.
4047
4288
  * @param callback If you specify the callback parameter, it should be a function that looks like this:
4048
4289
  * function() {...};
4049
4290
  */
4050
4291
  export function setDefaultFixedFontSize(details: SetFontSizeDetails, callback?: Function): void;
4292
+ /**
4293
+ * Clears the font set by this extension, if any.
4294
+ * @return The `clearFont` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
4295
+ */
4296
+ export function clearFont(details: FontDetails): Promise<void>;
4051
4297
  /**
4052
4298
  * Clears the font set by this extension, if any.
4053
4299
  * @param callback If you specify the callback parameter, it should be a function that looks like this:
4054
4300
  * function() {...};
4055
4301
  */
4056
4302
  export function clearFont(details: FontDetails, callback?: Function): void;
4303
+ /**
4304
+ * Sets the font for a given script and generic font family.
4305
+ * @return The `setFont` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
4306
+ */
4307
+ export function setFont(details: SetFontDetails): Promise<void>;
4057
4308
  /**
4058
4309
  * Sets the font for a given script and generic font family.
4059
4310
  * @param callback If you specify the callback parameter, it should be a function that looks like this:
4060
4311
  * function(object details) {...};
4061
4312
  */
4062
4313
  export function setFont(details: SetFontDetails, callback?: Function): void;
4314
+ /**
4315
+ * Clears the minimum font size set by this extension, if any.
4316
+ * @param details This parameter is currently unused.
4317
+ * @return The `clearMinimumFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
4318
+ */
4319
+ export function clearMinimumFontSize(details?: Object): Promise<void>;
4063
4320
  /**
4064
4321
  * Clears the minimum font size set by this extension, if any.
4065
4322
  * @param details This parameter is currently unused.
@@ -4067,12 +4324,23 @@ declare namespace chrome.fontSettings {
4067
4324
  * function() {...};
4068
4325
  */
4069
4326
  export function clearMinimumFontSize(details?: Object, callback?: Function): void;
4327
+ /**
4328
+ * Gets a list of fonts on the system.
4329
+ * @return The `getFontList` method provides its result via callback or returned as a `Promise` (MV3 only).
4330
+ */
4331
+ export function getFontList(): Promise<FontName[]>;
4070
4332
  /**
4071
4333
  * Gets a list of fonts on the system.
4072
4334
  * @param callback The callback parameter should be a function that looks like this:
4073
4335
  * function(array of FontName results) {...};
4074
4336
  */
4075
- export function getFontList(callback: (results: FontName[]) => void): void;
4337
+ export function getFontList(callback?: (results: FontName[]) => void): void;
4338
+ /**
4339
+ * Clears the default fixed font size set by this extension, if any.
4340
+ * @param details This parameter is currently unused.
4341
+ * @return The `clearDefaultFixedFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
4342
+ */
4343
+ export function clearDefaultFixedFontSize(details: Object): Promise<void>;
4076
4344
  /**
4077
4345
  * Clears the default fixed font size set by this extension, if any.
4078
4346
  * @param details This parameter is currently unused.
@@ -4252,36 +4520,66 @@ declare namespace chrome.history {
4252
4520
 
4253
4521
  export interface HistoryVisitRemovedEvent extends chrome.events.Event<(removed: RemovedResult) => void> { }
4254
4522
 
4523
+ /**
4524
+ * Searches the history for the last visit time of each page matching the query.
4525
+ * @return The `search` method provides its result via callback or returned as a `Promise` (MV3 only).
4526
+ */
4527
+ export function search(query: HistoryQuery): Promise<HistoryItem[]>;
4255
4528
  /**
4256
4529
  * Searches the history for the last visit time of each page matching the query.
4257
4530
  * @param callback The callback parameter should be a function that looks like this:
4258
4531
  * function(array of HistoryItem results) {...};
4259
4532
  */
4260
- export function search(query: HistoryQuery, callback: (results: HistoryItem[]) => void): void;
4533
+ export function search(query: HistoryQuery, callback?: (results: HistoryItem[]) => void): void;
4534
+ /**
4535
+ * Adds a URL to the history at the current time with a transition type of "link".
4536
+ * @return The `addUrl` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
4537
+ */
4538
+ export function addUrl(details: Url): Promise<void>;
4261
4539
  /**
4262
4540
  * Adds a URL to the history at the current time with a transition type of "link".
4263
4541
  * @param callback If you specify the callback parameter, it should be a function that looks like this:
4264
4542
  * function() {...};
4265
4543
  */
4266
4544
  export function addUrl(details: Url, callback?: () => void): void;
4545
+ /**
4546
+ * Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.
4547
+ * @return The `deleteRange` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
4548
+ */
4549
+ export function deleteRange(range: Range): Promise<void>;
4267
4550
  /**
4268
4551
  * Removes all items within the specified date range from the history. Pages will not be removed from the history unless all visits fall within the range.
4269
4552
  * @param callback The callback parameter should be a function that looks like this:
4270
4553
  * function() {...};
4271
4554
  */
4272
- export function deleteRange(range: Range, callback: () => void): void;
4555
+ export function deleteRange(range: Range, callback?: () => void): void;
4556
+ /**
4557
+ * Deletes all items from the history.
4558
+ * @return The `deleteAll` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
4559
+ */
4560
+ export function deleteAll(): Promise<void>;
4273
4561
  /**
4274
4562
  * Deletes all items from the history.
4275
4563
  * @param callback The callback parameter should be a function that looks like this:
4276
4564
  * function() {...};
4277
4565
  */
4278
4566
  export function deleteAll(callback: () => void): void;
4567
+ /**
4568
+ * Retrieves information about visits to a URL.
4569
+ * @return The `getVisits` method provides its result via callback or returned as a `Promise` (MV3 only).
4570
+ */
4571
+ export function getVisits(details: Url): Promise<VisitItem[]>;
4279
4572
  /**
4280
4573
  * Retrieves information about visits to a URL.
4281
4574
  * @param callback The callback parameter should be a function that looks like this:
4282
4575
  * function(array of VisitItem results) {...};
4283
4576
  */
4284
4577
  export function getVisits(details: Url, callback: (results: VisitItem[]) => void): void;
4578
+ /**
4579
+ * Removes all occurrences of the given URL from the history.
4580
+ * @return The `deleteUrl` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
4581
+ */
4582
+ export function deleteUrl(details: Url): Promise<void>;
4285
4583
  /**
4286
4584
  * Removes all occurrences of the given URL from the history.
4287
4585
  * @param callback If you specify the callback parameter, it should be a function that looks like this:
@@ -4323,6 +4621,12 @@ declare namespace chrome.i18n {
4323
4621
  languages: DetectedLanguage[];
4324
4622
  }
4325
4623
 
4624
+ /**
4625
+ * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage.
4626
+ * @return The `getAcceptLanguages` method provides its result via callback or returned as a `Promise` (MV3 only).
4627
+ * @since MV3
4628
+ */
4629
+ export function getAcceptLanguages(): Promise<string[]>;
4326
4630
  /**
4327
4631
  * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage.
4328
4632
  * @param callback The callback parameter should be a function that looks like this:
@@ -4342,6 +4646,12 @@ declare namespace chrome.i18n {
4342
4646
  */
4343
4647
  export function getUILanguage(): string;
4344
4648
 
4649
+ /** Detects the language of the provided text using CLD.
4650
+ * @param text User input string to be translated.
4651
+ * @return The `detectLanguage` method provides its result via callback or returned as a `Promise` (MV3 only).
4652
+ * @since MV3
4653
+ */
4654
+ export function detectLanguage(text: string): Promise<LanguageDetectionResult>;
4345
4655
  /** Detects the language of the provided text using CLD.
4346
4656
  * @param text User input string to be translated.
4347
4657
  * @param callback The callback parameter should be a function that looks like this: function(object result) {...};
@@ -5820,7 +6130,7 @@ declare namespace chrome.pageCapture {
5820
6130
  * function(binary mhtmlData) {...};
5821
6131
  * Parameter mhtmlData: The MHTML data as a Blob.
5822
6132
  */
5823
- export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: ArrayBuffer) => void): void;
6133
+ export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: Blob) => void): void;
5824
6134
  }
5825
6135
 
5826
6136
  ////////////////////
@@ -7070,6 +7380,17 @@ declare namespace chrome.runtime {
7070
7380
  * @since Chrome 32.
7071
7381
  */
7072
7382
  export function restart(): void;
7383
+ /**
7384
+ * Restart the ChromeOS device when the app runs in kiosk mode after the
7385
+ * given seconds. If called again before the time ends, the reboot will
7386
+ * be delayed. If called with a value of -1, the reboot will be
7387
+ * cancelled. It's a no-op in non-kiosk mode. It's only allowed to be
7388
+ * called repeatedly by the first extension to invoke this API.
7389
+ * @since Chrome 53.
7390
+ * @param seconds
7391
+ * @param callback
7392
+ */
7393
+ export function restartAfterDelay(seconds: number, callback?: () => void): void;
7073
7394
  /**
7074
7395
  * Sends a single message to event listeners within your extension/app or a different extension/app. Similar to runtime.connect but only sends a single message, with an optional response. If sending to your extension, the runtime.onMessage event will be fired in each page, or runtime.onMessageExternal, if a different extension. Note that extensions cannot send messages to content scripts using this method. To send messages to content scripts, use tabs.sendMessage.
7075
7396
  * @since Chrome 26.
chrome/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chrome",
3
- "version": "0.0.177",
3
+ "version": "0.0.180",
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": "a5f93025e2722961165bcf68177c845ec912f4bac2651adf4280653df9f12a46",
102
- "typeScriptVersion": "3.8"
101
+ "typesPublisherContentHash": "e4cba3fb0e78790f42d1afb1984733452d613e0c137ac8c242154403717f9a42",
102
+ "typeScriptVersion": "3.9"
103
103
  }