@types/chrome 0.0.215 → 0.0.217

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 +230 -600
  3. chrome/package.json +2 -2
chrome/index.d.ts CHANGED
@@ -168,7 +168,8 @@ declare namespace chrome.action {
168
168
  * @param tabId The id of the tab for which you want to modify the action.
169
169
  * @param callback
170
170
  */
171
- export function disable(tabId?: number, callback?: () => void): void;
171
+ export function disable(callback: () => void): void;
172
+ export function disable(tabId: number, callback: () => void): void;
172
173
 
173
174
  /**
174
175
  * Since Chrome 88.
@@ -184,13 +185,12 @@ declare namespace chrome.action {
184
185
  * @param tabId The id of the tab for which you want to modify the action.
185
186
  * @param callback
186
187
  */
187
- export function enable(tabId?: number, callback?: () => void): void;
188
+ export function enable(callback: () => void): void;
189
+ export function enable(tabId: number, callback: () => void): void;
188
190
 
189
191
  /**
190
192
  * Since Chrome 88.
191
193
  * Gets the background color of the action.
192
- * @param callback The callback parameter should be a function that looks like this:
193
- * (result: ColorArray) => {...}
194
194
  */
195
195
  export function getBadgeBackgroundColor(details: TabDetails, callback: (result: ColorArray) => void): void;
196
196
  /**
@@ -205,8 +205,6 @@ declare namespace chrome.action {
205
205
  * Gets the badge text of the action. If no tab is specified, the non-tab-specific badge text is returned.
206
206
  * If displayActionCountAsBadgeText is enabled, a placeholder text will be returned unless the
207
207
  * declarativeNetRequestFeedback permission is present or tab-specific badge text was provided.
208
- * @param callback The callback parameter should be a function that looks like this:
209
- * (result: string) => {...}
210
208
  */
211
209
  export function getBadgeText(details: TabDetails, callback: (result: string) => void): void;
212
210
 
@@ -222,8 +220,6 @@ declare namespace chrome.action {
222
220
  /**
223
221
  * Since Chrome 88.
224
222
  * Gets the html document set as the popup for this action.
225
- * @param callback The callback parameter should be a function that looks like this:
226
- * (result: string) => {...}
227
223
  */
228
224
  export function getPopup(details: TabDetails, callback: (result: string) => void): void;
229
225
 
@@ -237,8 +233,6 @@ declare namespace chrome.action {
237
233
  /**
238
234
  * Since Chrome 88.
239
235
  * Gets the title of the action.
240
- * @param callback The callback parameter should be a function that looks like this:
241
- * (result: string) => {...}
242
236
  */
243
237
  export function getTitle(details: TabDetails, callback: (result: string) => void): void;
244
238
 
@@ -252,8 +246,6 @@ declare namespace chrome.action {
252
246
  /**
253
247
  * Since Chrome 91.
254
248
  * Returns the user-specified settings relating to an extension's action.
255
- * @param callback The callback parameter should be a function that looks like this:
256
- * (userSettings: UserSettings) => {...}
257
249
  */
258
250
  export function getUserSettings(callback: (userSettings: UserSettings) => void): void;
259
251
 
@@ -277,10 +269,9 @@ declare namespace chrome.action {
277
269
  * Since Chrome 99+.
278
270
  * Opens the extension's popup.
279
271
  * @param options Specifies options for opening the popup.
280
- * @param callback The callback parameter should be a function that looks like this:
281
- * () => {...}
282
272
  */
283
- export function openPopup(options?: OpenPopupOptions, callback?: () => void): void;
273
+ export function openPopup(callback: () => void): void;
274
+ export function openPopup(options: OpenPopupOptions, callback: () => void): void;
284
275
 
285
276
  /**
286
277
  * Since Chrome 88.
@@ -292,10 +283,8 @@ declare namespace chrome.action {
292
283
  /**
293
284
  * Since Chrome 88.
294
285
  * Sets the background color for the badge.
295
- * @param callback The callback parameter should be a function that looks like this:
296
- * () => {...}
297
286
  */
298
- export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails, callback?: () => void): void;
287
+ export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails, callback: () => void): void;
299
288
 
300
289
  /**
301
290
  * Since Chrome 88.
@@ -307,19 +296,17 @@ declare namespace chrome.action {
307
296
  /**
308
297
  * Since Chrome 88.
309
298
  * Sets the badge text for the action. The badge is displayed on top of the icon.
310
- * @param callback The callback parameter should be a function that looks like this:
311
- * () => {...}
312
299
  */
313
- export function setBadgeText(details: BadgeTextDetails, callback?: () => void): void;
300
+ export function setBadgeText(details: BadgeTextDetails, callback: () => void): void;
314
301
 
315
302
  /**
316
303
  * Since Chrome 88.
317
304
  * Sets the icon for the action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element,
318
305
  * or as dictionary of either one of those. Either the path or the imageData property must be specified.
319
- * @param callback The callback parameter should be a function that looks like this:
320
- * () => {...}
306
+ * @return The `setIcon` method provides its result via callback or returned as a `Promise` (MV3 only). Since Chrome 96.
321
307
  */
322
- export function setIcon(details: TabIconDetails, callback?: () => void): void;
308
+ export function setIcon(details: TabIconDetails): Promise<void>
309
+ export function setIcon(details: TabIconDetails, callback: () => void): void;
323
310
 
324
311
  /**
325
312
  * Since Chrome 88.
@@ -331,10 +318,8 @@ declare namespace chrome.action {
331
318
  /**
332
319
  * Since Chrome 88.
333
320
  * Sets the html document to be opened as a popup when the user clicks on the action's icon.
334
- * @param callback The callback parameter should be a function that looks like this:
335
- * () => {...}
336
321
  */
337
- export function setPopup(details: PopupDetails, callback?: () => void): void;
322
+ export function setPopup(details: PopupDetails, callback: () => void): void;
338
323
 
339
324
  /**
340
325
  * Since Chrome 88.
@@ -346,10 +331,8 @@ declare namespace chrome.action {
346
331
  /**
347
332
  * Since Chrome 88.
348
333
  * Sets the title of the action. This shows up in the tooltip.
349
- * @param callback The callback parameter should be a function that looks like this:
350
- * () => {...}
351
334
  */
352
- export function setTitle(details: TitleDetails, callback?: () => void): void;
335
+ export function setTitle(details: TitleDetails, callback: () => void): void;
353
336
 
354
337
  /** Fired when an action icon is clicked. This event will not fire if the action has a popup. */
355
338
  export var onClicked: BrowserClickedEvent;
@@ -401,8 +384,6 @@ declare namespace chrome.alarms {
401
384
  export function create(name: string, alarmInfo: AlarmCreateInfo): void;
402
385
  /**
403
386
  * Gets an array of all the alarms.
404
- * @param callback The callback parameter should be a function that looks like this:
405
- * function(array of Alarm alarms) {...};
406
387
  */
407
388
  export function getAll(callback: (alarms: Alarm[]) => void): void;
408
389
  /**
@@ -418,10 +399,8 @@ declare namespace chrome.alarms {
418
399
  export function clearAll(): Promise<boolean>;
419
400
  /**
420
401
  * Clears all alarms.
421
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
422
- * function(boolean wasCleared) {...};
423
402
  */
424
- export function clearAll(callback?: (wasCleared: boolean) => void): void;
403
+ export function clearAll(callback: (wasCleared: boolean) => void): void;
425
404
  /**
426
405
  * Clears the alarm with the given name.
427
406
  * @param name The name of the alarm to clear. Defaults to the empty string.
@@ -431,14 +410,11 @@ declare namespace chrome.alarms {
431
410
  /**
432
411
  * Clears the alarm with the given name.
433
412
  * @param name The name of the alarm to clear. Defaults to the empty string.
434
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
435
- * function(boolean wasCleared) {...};
436
413
  */
437
- export function clear(name?: string, callback?: (wasCleared: boolean) => void): void;
414
+ export function clear(callback: (wasCleared: boolean) => void): void;
415
+ export function clear(name: string, callback: (wasCleared: boolean) => void): void;
438
416
  /**
439
417
  * Clears the alarm without a name.
440
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
441
- * function(boolean wasCleared) {...};
442
418
  */
443
419
  export function clear(callback: (wasCleared: boolean) => void): void;
444
420
  /**
@@ -448,8 +424,6 @@ declare namespace chrome.alarms {
448
424
  export function clear(): Promise<void>;
449
425
  /**
450
426
  * Retrieves details about the specified alarm.
451
- * @param callback The callback parameter should be a function that looks like this:
452
- * function( Alarm alarm) {...};
453
427
  */
454
428
  export function get(callback: (alarm: Alarm) => void): void;
455
429
  /**
@@ -460,8 +434,6 @@ declare namespace chrome.alarms {
460
434
  /**
461
435
  * Retrieves details about the specified alarm.
462
436
  * @param name The name of the alarm to get. Defaults to the empty string.
463
- * @param callback The callback parameter should be a function that looks like this:
464
- * function( Alarm alarm) {...};
465
437
  */
466
438
  export function get(name: string, callback: (alarm: Alarm) => void): void;
467
439
  /**
@@ -614,8 +586,6 @@ declare namespace chrome.bookmarks {
614
586
  /**
615
587
  * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
616
588
  * @param query A string of words and quoted phrases that are matched against bookmark URLs and titles.
617
- * @param callback The callback parameter should be a function that looks like this:
618
- * function(array of BookmarkTreeNode results) {...};
619
589
  */
620
590
  export function search(query: string, callback: (results: BookmarkTreeNode[]) => void): void;
621
591
  /**
@@ -627,8 +597,6 @@ declare namespace chrome.bookmarks {
627
597
  /**
628
598
  * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
629
599
  * @param query An object with one or more of the properties query, url, and title specified. Bookmarks matching all specified properties will be produced.
630
- * @param callback The callback parameter should be a function that looks like this:
631
- * function(array of BookmarkTreeNode results) {...};
632
600
  */
633
601
  export function search(query: BookmarkSearchQuery, callback: (results: BookmarkTreeNode[]) => void): void;
634
602
  /**
@@ -639,8 +607,6 @@ declare namespace chrome.bookmarks {
639
607
  export function search(query: BookmarkSearchQuery): Promise<BookmarkTreeNode[]>;
640
608
  /**
641
609
  * Retrieves the entire Bookmarks hierarchy.
642
- * @param callback The callback parameter should be a function that looks like this:
643
- * function(array of BookmarkTreeNode results) {...};
644
610
  */
645
611
  export function getTree(callback: (results: BookmarkTreeNode[]) => void): void;
646
612
  /**
@@ -651,8 +617,6 @@ declare namespace chrome.bookmarks {
651
617
  /**
652
618
  * Retrieves the recently added bookmarks.
653
619
  * @param numberOfItems The maximum number of items to return.
654
- * @param callback The callback parameter should be a function that looks like this:
655
- * function(array of BookmarkTreeNode results) {...};
656
620
  */
657
621
  export function getRecent(numberOfItems: number, callback: (results: BookmarkTreeNode[]) => void): void;
658
622
  /**
@@ -664,8 +628,6 @@ declare namespace chrome.bookmarks {
664
628
  /**
665
629
  * Retrieves the specified BookmarkTreeNode.
666
630
  * @param id A single string-valued id
667
- * @param callback The callback parameter should be a function that looks like this:
668
- * function(array of BookmarkTreeNode results) {...};
669
631
  */
670
632
  export function get(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
671
633
  /**
@@ -677,8 +639,6 @@ declare namespace chrome.bookmarks {
677
639
  /**
678
640
  * Retrieves the specified BookmarkTreeNode.
679
641
  * @param idList An array of string-valued ids
680
- * @param callback The callback parameter should be a function that looks like this:
681
- * function(array of BookmarkTreeNode results) {...};
682
642
  */
683
643
  export function get(idList: string[], callback: (results: BookmarkTreeNode[]) => void): void;
684
644
  /**
@@ -694,10 +654,8 @@ declare namespace chrome.bookmarks {
694
654
  export function create(bookmark: BookmarkCreateArg): Promise<BookmarkTreeNode>;
695
655
  /**
696
656
  * Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.
697
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
698
- * function( BookmarkTreeNode result) {...};
699
657
  */
700
- export function create(bookmark: BookmarkCreateArg, callback?: (result: BookmarkTreeNode) => void): void;
658
+ export function create(bookmark: BookmarkCreateArg, callback: (result: BookmarkTreeNode) => void): void;
701
659
  /**
702
660
  * Moves the specified BookmarkTreeNode to the provided location.
703
661
  * @return The `move` method provides its result via callback or returned as a `Promise` (MV3 only).
@@ -708,13 +666,11 @@ declare namespace chrome.bookmarks {
708
666
  ): Promise<BookmarkTreeNode>;
709
667
  /**
710
668
  * Moves the specified BookmarkTreeNode to the provided location.
711
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
712
- * function( BookmarkTreeNode result) {...};
713
669
  */
714
670
  export function move(
715
671
  id: string,
716
672
  destination: BookmarkDestinationArg,
717
- callback?: (result: BookmarkTreeNode) => void,
673
+ callback: (result: BookmarkTreeNode) => void,
718
674
  ): void;
719
675
  /**
720
676
  * Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. Note: Currently, only 'title' and 'url' are supported.
@@ -726,13 +682,11 @@ declare namespace chrome.bookmarks {
726
682
  ): Promise<BookmarkTreeNode>;
727
683
  /**
728
684
  * Updates the properties of a bookmark or folder. Specify only the properties that you want to change; unspecified properties will be left unchanged. Note: Currently, only 'title' and 'url' are supported.
729
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
730
- * function( BookmarkTreeNode result) {...};
731
685
  */
732
686
  export function update(
733
687
  id: string,
734
688
  changes: BookmarkChangesArg,
735
- callback?: (result: BookmarkTreeNode) => void,
689
+ callback: (result: BookmarkTreeNode) => void,
736
690
  ): void;
737
691
  /**
738
692
  * Removes a bookmark or an empty bookmark folder.
@@ -741,14 +695,10 @@ declare namespace chrome.bookmarks {
741
695
  export function remove(id: string): Promise<void>;
742
696
  /**
743
697
  * Removes a bookmark or an empty bookmark folder.
744
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
745
- * function() {...};
746
698
  */
747
- export function remove(id: string, callback?: Function): void;
699
+ export function remove(id: string, callback: Function): void;
748
700
  /**
749
701
  * Retrieves the children of the specified BookmarkTreeNode id.
750
- * @param callback The callback parameter should be a function that looks like this:
751
- * function(array of BookmarkTreeNode results) {...};
752
702
  */
753
703
  export function getChildren(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
754
704
  /**
@@ -760,8 +710,6 @@ declare namespace chrome.bookmarks {
760
710
  * Since Chrome 14.
761
711
  * Retrieves part of the Bookmarks hierarchy, starting at the specified node.
762
712
  * @param id The ID of the root of the subtree to retrieve.
763
- * @param callback The callback parameter should be a function that looks like this:
764
- * function(array of BookmarkTreeNode results) {...};
765
713
  */
766
714
  export function getSubTree(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
767
715
  /**
@@ -778,10 +726,8 @@ declare namespace chrome.bookmarks {
778
726
  export function removeTree(id: string): Promise<void>;
779
727
  /**
780
728
  * Recursively removes a bookmark folder.
781
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
782
- * function() {...};
783
729
  */
784
- export function removeTree(id: string, callback?: Function): void;
730
+ export function removeTree(id: string, callback: Function): void;
785
731
 
786
732
  /** Fired when a bookmark or folder is removed. When a folder is removed recursively, a single notification is fired for the folder, and none for its contents. */
787
733
  export var onRemoved: BookmarkRemovedEvent;
@@ -867,7 +813,8 @@ declare namespace chrome.browserAction {
867
813
  * @param tabId The id of the tab for which you want to modify the browser action.
868
814
  * @param callback Supported since Chrome 67
869
815
  */
870
- export function enable(tabId?: number, callback?: () => void): void;
816
+ export function enable(callback: () => void): void;
817
+ export function enable(tabId: number, callback: () => void): void;
871
818
  /**
872
819
  * Sets the background color for the badge.
873
820
  * @return The `setBadgeBackgroundColor` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -877,7 +824,7 @@ declare namespace chrome.browserAction {
877
824
  * Sets the background color for the badge.
878
825
  * @param callback Supported since Chrome 67
879
826
  */
880
- export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails, callback?: () => void): void;
827
+ export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails, callback: () => void): void;
881
828
  /**
882
829
  * Sets the badge text for the browser action. The badge is displayed on top of the icon.
883
830
  * @return The `setBadgeText` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -887,7 +834,7 @@ declare namespace chrome.browserAction {
887
834
  * Sets the badge text for the browser action. The badge is displayed on top of the icon.
888
835
  * @param callback Supported since Chrome 67
889
836
  */
890
- export function setBadgeText(details: BadgeTextDetails, callback?: () => void): void;
837
+ export function setBadgeText(details: BadgeTextDetails, callback: () => void): void;
891
838
  /**
892
839
  * Sets the title of the browser action. This shows up in the tooltip.
893
840
  * @return The `setTitle` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -897,7 +844,7 @@ declare namespace chrome.browserAction {
897
844
  * Sets the title of the browser action. This shows up in the tooltip.
898
845
  * @param callback Supported since Chrome 67
899
846
  */
900
- export function setTitle(details: TitleDetails, callback?: () => void): void;
847
+ export function setTitle(details: TitleDetails, callback: () => void): void;
901
848
  /**
902
849
  * Since Chrome 19.
903
850
  * Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned.
@@ -919,7 +866,7 @@ declare namespace chrome.browserAction {
919
866
  * Sets the html document to be opened as a popup when the user clicks on the browser action's icon.
920
867
  * @param callback Supported since Chrome 67
921
868
  */
922
- export function setPopup(details: PopupDetails, callback?: () => void): void;
869
+ export function setPopup(details: PopupDetails, callback: () => void): void;
923
870
  /**
924
871
  * Since Chrome 22.
925
872
  * Disables the browser action for a tab.
@@ -933,12 +880,11 @@ declare namespace chrome.browserAction {
933
880
  * @param tabId The id of the tab for which you want to modify the browser action.
934
881
  * @param callback Supported since Chrome 67
935
882
  */
936
- export function disable(tabId?: number, callback?: () => void): void;
883
+ export function disable(callback: () => void): void;
884
+ export function disable(tabId: number, callback: () => void): void;
937
885
  /**
938
886
  * Since Chrome 19.
939
887
  * Gets the title of the browser action.
940
- * @param callback The callback parameter should be a function that looks like this:
941
- * function(string result) {...};
942
888
  */
943
889
  export function getTitle(details: TabDetails, callback: (result: string) => void): void;
944
890
  /**
@@ -950,8 +896,6 @@ declare namespace chrome.browserAction {
950
896
  /**
951
897
  * Since Chrome 19.
952
898
  * Gets the background color of the browser action.
953
- * @param callback The callback parameter should be a function that looks like this:
954
- * function( ColorArray result) {...};
955
899
  */
956
900
  export function getBadgeBackgroundColor(details: TabDetails, callback: (result: ColorArray) => void): void;
957
901
  /**
@@ -963,8 +907,6 @@ declare namespace chrome.browserAction {
963
907
  /**
964
908
  * Since Chrome 19.
965
909
  * Gets the html document set as the popup for this browser action.
966
- * @param callback The callback parameter should be a function that looks like this:
967
- * function(string result) {...};
968
910
  */
969
911
  export function getPopup(details: TabDetails, callback: (result: string) => void): void;
970
912
  /**
@@ -975,10 +917,8 @@ declare namespace chrome.browserAction {
975
917
  export function getPopup(details: TabDetails): Promise<string>;
976
918
  /**
977
919
  * Sets the icon for the browser action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
978
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
979
- * function() {...};
980
920
  */
981
- export function setIcon(details: TabIconDetails, callback?: Function): void;
921
+ export function setIcon(details: TabIconDetails, callback: Function): void;
982
922
 
983
923
  /** Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup. */
984
924
  export var onClicked: BrowserClickedEvent;
@@ -1094,8 +1034,6 @@ declare namespace chrome.browsingData {
1094
1034
  /**
1095
1035
  * Since Chrome 26.
1096
1036
  * 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.
1097
- * @param callback The callback parameter should be a function that looks like this:
1098
- * function(object result) {...};
1099
1037
  */
1100
1038
  export function settings(callback: (result: SettingsResult) => void): void;
1101
1039
  /**
@@ -1112,10 +1050,8 @@ declare namespace chrome.browsingData {
1112
1050
  *
1113
1051
  * Clears plugins' data.
1114
1052
  * @param callback Called when plugins' data has been cleared.
1115
- * If you specify the callback parameter, it should be a function that looks like this:
1116
- * function() {...};
1117
1053
  */
1118
- export function removePluginData(options: RemovalOptions, callback?: () => void): void;
1054
+ export function removePluginData(options: RemovalOptions, callback: () => void): void;
1119
1055
  /**
1120
1056
  * Since Chrome 72.
1121
1057
  * Clears websites' service workers.
@@ -1126,10 +1062,8 @@ declare namespace chrome.browsingData {
1126
1062
  * Since Chrome 72.
1127
1063
  * Clears websites' service workers.
1128
1064
  * @param callback Called when the browser's service workers have been cleared.
1129
- * If you specify the callback parameter, it should be a function that looks like this:
1130
- * function() {...};
1131
1065
  */
1132
- export function removeServiceWorkers(options: RemovalOptions, callback?: () => void): void;
1066
+ export function removeServiceWorkers(options: RemovalOptions, callback: () => void): void;
1133
1067
  /**
1134
1068
  * Clears the browser's stored form data (autofill).
1135
1069
  * @return The `removeFormData` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1138,10 +1072,8 @@ declare namespace chrome.browsingData {
1138
1072
  /**
1139
1073
  * Clears the browser's stored form data (autofill).
1140
1074
  * @param callback Called when the browser's form data has been cleared.
1141
- * If you specify the callback parameter, it should be a function that looks like this:
1142
- * function() {...};
1143
1075
  */
1144
- export function removeFormData(options: RemovalOptions, callback?: () => void): void;
1076
+ export function removeFormData(options: RemovalOptions, callback: () => void): void;
1145
1077
  /**
1146
1078
  * Clears websites' file system data.
1147
1079
  * @return The `removeFileSystems` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1150,10 +1082,8 @@ declare namespace chrome.browsingData {
1150
1082
  /**
1151
1083
  * Clears websites' file system data.
1152
1084
  * @param callback Called when websites' file systems have been cleared.
1153
- * If you specify the callback parameter, it should be a function that looks like this:
1154
- * function() {...};
1155
1085
  */
1156
- export function removeFileSystems(options: RemovalOptions, callback?: () => void): void;
1086
+ export function removeFileSystems(options: RemovalOptions, callback: () => void): void;
1157
1087
  /**
1158
1088
  * Clears various types of browsing data stored in a user's profile.
1159
1089
  * @param dataToRemove The set of data types to remove.
@@ -1164,10 +1094,8 @@ declare namespace chrome.browsingData {
1164
1094
  * Clears various types of browsing data stored in a user's profile.
1165
1095
  * @param dataToRemove The set of data types to remove.
1166
1096
  * @param callback Called when deletion has completed.
1167
- * If you specify the callback parameter, it should be a function that looks like this:
1168
- * function() {...};
1169
1097
  */
1170
- export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback?: () => void): void;
1098
+ export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback: () => void): void;
1171
1099
  /**
1172
1100
  * Clears the browser's stored passwords.
1173
1101
  * @return The `removePasswords` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1176,22 +1104,18 @@ declare namespace chrome.browsingData {
1176
1104
  /**
1177
1105
  * Clears the browser's stored passwords.
1178
1106
  * @param callback Called when the browser's passwords have been cleared.
1179
- * If you specify the callback parameter, it should be a function that looks like this:
1180
- * function() {...};
1181
1107
  */
1182
- export function removePasswords(options: RemovalOptions, callback?: () => void): void;
1108
+ export function removePasswords(options: RemovalOptions, callback: () => void): void;
1183
1109
  /**
1184
1110
  * Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
1185
1111
  * @return The `removeCookies` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1186
1112
  */
1187
- export function removeCookies(options: RemovalOptions, callback?: () => void): Promise<void>;
1113
+ export function removeCookies(options: RemovalOptions): Promise<void>;
1188
1114
  /**
1189
1115
  * Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
1190
1116
  * @param callback Called when the browser's cookies and server-bound certificates have been cleared.
1191
- * If you specify the callback parameter, it should be a function that looks like this:
1192
- * function() {...};
1193
1117
  */
1194
- export function removeCookies(options: RemovalOptions, callback?: () => void): void;
1118
+ export function removeCookies(options: RemovalOptions, callback: () => void): void;
1195
1119
  /**
1196
1120
  * Clears websites' WebSQL data.
1197
1121
  * @return The `removeWebSQL` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1200,10 +1124,8 @@ declare namespace chrome.browsingData {
1200
1124
  /**
1201
1125
  * Clears websites' WebSQL data.
1202
1126
  * @param callback Called when websites' WebSQL databases have been cleared.
1203
- * If you specify the callback parameter, it should be a function that looks like this:
1204
- * function() {...};
1205
1127
  */
1206
- export function removeWebSQL(options: RemovalOptions, callback?: () => void): void;
1128
+ export function removeWebSQL(options: RemovalOptions, callback: () => void): void;
1207
1129
  /**
1208
1130
  * Clears websites' appcache data.
1209
1131
  * @return The `removeAppcache` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1212,20 +1134,16 @@ declare namespace chrome.browsingData {
1212
1134
  /**
1213
1135
  * Clears websites' appcache data.
1214
1136
  * @param callback Called when websites' appcache data has been cleared.
1215
- * If you specify the callback parameter, it should be a function that looks like this:
1216
- * function() {...};
1217
1137
  */
1218
- export function removeAppcache(options: RemovalOptions, callback?: () => void): void;
1138
+ export function removeAppcache(options: RemovalOptions, callback: () => void): void;
1219
1139
  /** Clears websites' cache storage data.
1220
1140
  * @return The `removeCacheStorage` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1221
1141
  */
1222
1142
  export function removeCacheStorage(options: RemovalOptions): Promise<void>
1223
1143
  /** Clears websites' cache storage data.
1224
1144
  * @param callback Called when websites' appcache data has been cleared.
1225
- * If you specify the callback parameter, it should be a function that looks like this:
1226
- * function() {...};
1227
1145
  */
1228
- export function removeCacheStorage(options: RemovalOptions, callback?: () => void): void
1146
+ export function removeCacheStorage(options: RemovalOptions, callback: () => void): void
1229
1147
  /**
1230
1148
  * Clears the browser's list of downloaded files (not the downloaded files themselves).
1231
1149
  * @return The `removeDownloads` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1234,10 +1152,8 @@ declare namespace chrome.browsingData {
1234
1152
  /**
1235
1153
  * Clears the browser's list of downloaded files (not the downloaded files themselves).
1236
1154
  * @param callback Called when the browser's list of downloaded files has been cleared.
1237
- * If you specify the callback parameter, it should be a function that looks like this:
1238
- * function() {...};
1239
1155
  */
1240
- export function removeDownloads(options: RemovalOptions, callback?: () => void): void;
1156
+ export function removeDownloads(options: RemovalOptions, callback: () => void): void;
1241
1157
  /**
1242
1158
  * Clears websites' local storage data.
1243
1159
  * @return The `removeLocalStorage` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1246,10 +1162,8 @@ declare namespace chrome.browsingData {
1246
1162
  /**
1247
1163
  * Clears websites' local storage data.
1248
1164
  * @param callback Called when websites' local storage has been cleared.
1249
- * If you specify the callback parameter, it should be a function that looks like this:
1250
- * function() {...};
1251
1165
  */
1252
- export function removeLocalStorage(options: RemovalOptions, callback?: () => void): void;
1166
+ export function removeLocalStorage(options: RemovalOptions, callback: () => void): void;
1253
1167
  /**
1254
1168
  * Clears the browser's cache.
1255
1169
  * @return The `removeCache` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1258,10 +1172,8 @@ declare namespace chrome.browsingData {
1258
1172
  /**
1259
1173
  * Clears the browser's cache.
1260
1174
  * @param callback Called when the browser's cache has been cleared.
1261
- * If you specify the callback parameter, it should be a function that looks like this:
1262
- * function() {...};
1263
1175
  */
1264
- export function removeCache(options: RemovalOptions, callback?: () => void): void;
1176
+ export function removeCache(options: RemovalOptions, callback: () => void): void;
1265
1177
  /**
1266
1178
  * Clears the browser's history.
1267
1179
  * @return The `removeHistory` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1270,10 +1182,8 @@ declare namespace chrome.browsingData {
1270
1182
  /**
1271
1183
  * Clears the browser's history.
1272
1184
  * @param callback Called when the browser's history has cleared.
1273
- * If you specify the callback parameter, it should be a function that looks like this:
1274
- * function() {...};
1275
1185
  */
1276
- export function removeHistory(options: RemovalOptions, callback?: () => void): void;
1186
+ export function removeHistory(options: RemovalOptions, callback: () => void): void;
1277
1187
  /**
1278
1188
  * Clears websites' IndexedDB data.
1279
1189
  * @return The `removeIndexedDB` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1282,10 +1192,8 @@ declare namespace chrome.browsingData {
1282
1192
  /**
1283
1193
  * Clears websites' IndexedDB data.
1284
1194
  * @param callback Called when websites' IndexedDB data has been cleared.
1285
- * If you specify the callback parameter, it should be a function that looks like this:
1286
- * function() {...};
1287
1195
  */
1288
- export function removeIndexedDB(options: RemovalOptions, callback?: () => void): void;
1196
+ export function removeIndexedDB(options: RemovalOptions, callback: () => void): void;
1289
1197
  }
1290
1198
 
1291
1199
  ////////////////////
@@ -1316,8 +1224,6 @@ declare namespace chrome.commands {
1316
1224
  /**
1317
1225
  * Returns all the registered extension commands for this extension and their shortcut (if active).
1318
1226
  * @param callback Called to return the registered commands.
1319
- * If you specify the callback parameter, it should be a function that looks like this:
1320
- * function(array of Command commands) {...};
1321
1227
  */
1322
1228
  export function getAll(callback: (commands: Command[]) => void): void;
1323
1229
 
@@ -1433,26 +1339,22 @@ declare namespace chrome.contentSettings {
1433
1339
  export interface ContentSetting {
1434
1340
  /**
1435
1341
  * Clear all content setting rules set by this extension.
1436
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
1437
- * function() {...};
1438
1342
  */
1439
1343
  clear(details: ClearDetails, callback?: () => void): void;
1440
1344
  /**
1441
1345
  * Applies a new content setting rule.
1442
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
1443
- * function() {...};
1444
1346
  */
1445
1347
  set(details: SetDetails, callback?: () => void): void;
1446
- /**
1447
- * @param callback The callback parameter should be a function that looks like this:
1448
- * function(array of ResourceIdentifier resourceIdentifiers) {...};
1449
- * Parameter resourceIdentifiers: A list of resource identifiers for this content type, or undefined if this content type does not use resource identifiers.
1450
- */
1451
- getResourceIdentifiers(callback: (resourceIdentifiers?: ResourceIdentifier[]) => void): void;
1348
+ getResourceIdentifiers(
1349
+ callback: (
1350
+ /**
1351
+ * A list of resource identifiers for this content type, or undefined if this content type does not use resource identifiers.
1352
+ */
1353
+ resourceIdentifiers?: ResourceIdentifier[]
1354
+ ) => void
1355
+ ): void;
1452
1356
  /**
1453
1357
  * Gets the current content setting for a given pair of URLs.
1454
- * @param callback The callback parameter should be a function that looks like this:
1455
- * function(object details) {...};
1456
1358
  */
1457
1359
  get(details: GetDetails, callback: (details: ReturnedDetails) => void): void;
1458
1360
  }
@@ -1813,8 +1715,6 @@ declare namespace chrome.contextMenus {
1813
1715
  /**
1814
1716
  * Removes all context menu items added by this extension.
1815
1717
  * @param callback Called when removal is complete.
1816
- * If you specify the callback parameter, it should be a function that looks like this:
1817
- * function() {...};
1818
1718
  */
1819
1719
  export function removeAll(callback?: () => void): void;
1820
1720
  /**
@@ -1828,8 +1728,6 @@ declare namespace chrome.contextMenus {
1828
1728
  * @param id The ID of the item to update.
1829
1729
  * @param updateProperties The properties to update. Accepts the same values as the create function.
1830
1730
  * @param callback Called when the context menu has been updated.
1831
- * If you specify the callback parameter, it should be a function that looks like this:
1832
- * function() {...};
1833
1731
  */
1834
1732
  export function update(id: string, updateProperties: UpdateProperties, callback?: () => void): void;
1835
1733
  /**
@@ -1837,24 +1735,18 @@ declare namespace chrome.contextMenus {
1837
1735
  * @param id The ID of the item to update.
1838
1736
  * @param updateProperties The properties to update. Accepts the same values as the create function.
1839
1737
  * @param callback Called when the context menu has been updated.
1840
- * If you specify the callback parameter, it should be a function that looks like this:
1841
- * function() {...};
1842
1738
  */
1843
1739
  export function update(id: number, updateProperties: UpdateProperties, callback?: () => void): void;
1844
1740
  /**
1845
1741
  * Removes a context menu item.
1846
1742
  * @param menuItemId The ID of the context menu item to remove.
1847
1743
  * @param callback Called when the context menu has been removed.
1848
- * If you specify the callback parameter, it should be a function that looks like this:
1849
- * function() {...};
1850
1744
  */
1851
1745
  export function remove(menuItemId: string, callback?: () => void): void;
1852
1746
  /**
1853
1747
  * Removes a context menu item.
1854
1748
  * @param menuItemId The ID of the context menu item to remove.
1855
1749
  * @param callback Called when the context menu has been removed.
1856
- * If you specify the callback parameter, it should be a function that looks like this:
1857
- * function() {...};
1858
1750
  */
1859
1751
  export function remove(menuItemId: number, callback?: () => void): void;
1860
1752
 
@@ -1979,8 +1871,6 @@ declare namespace chrome.cookies {
1979
1871
 
1980
1872
  /**
1981
1873
  * Lists all existing cookie stores.
1982
- * @param callback The callback parameter should be a function that looks like this:
1983
- * function(array of CookieStore cookieStores) {...};
1984
1874
  * Parameter cookieStores: All the existing cookie stores.
1985
1875
  */
1986
1876
  export function getAllCookieStores(callback: (cookieStores: CookieStore[]) => void): void;
@@ -1992,8 +1882,6 @@ declare namespace chrome.cookies {
1992
1882
  /**
1993
1883
  * Retrieves all cookies from a single cookie store that match the given information. The cookies returned will be sorted, with those with the longest path first. If multiple cookies have the same path length, those with the earliest creation time will be first.
1994
1884
  * @param details Information to filter the cookies being retrieved.
1995
- * @param callback The callback parameter should be a function that looks like this:
1996
- * function(array of Cookie cookies) {...};
1997
1885
  * Parameter cookies: All the existing, unexpired cookies that match the given cookie info.
1998
1886
  */
1999
1887
  export function getAll(details: GetAllDetails, callback: (cookies: Cookie[]) => void): void;
@@ -2012,11 +1900,9 @@ declare namespace chrome.cookies {
2012
1900
  /**
2013
1901
  * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
2014
1902
  * @param details Details about the cookie being set.
2015
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
2016
- * function( Cookie cookie) {...};
2017
1903
  * Optional parameter cookie: Contains details about the cookie that's been set. If setting failed for any reason, this will be "null", and "chrome.runtime.lastError" will be set.
2018
1904
  */
2019
- export function set(details: SetDetails, callback?: (cookie: Cookie | null) => void): void;
1905
+ export function set(details: SetDetails, callback: (cookie: Cookie | null) => void): void;
2020
1906
  /**
2021
1907
  * Deletes a cookie by name.
2022
1908
  * @param details Information to identify the cookie to remove.
@@ -2026,15 +1912,11 @@ declare namespace chrome.cookies {
2026
1912
  /**
2027
1913
  * Deletes a cookie by name.
2028
1914
  * @param details Information to identify the cookie to remove.
2029
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
2030
- * function(object details) {...};
2031
1915
  */
2032
1916
  export function remove(details: Details, callback?: (details: Details) => void): void;
2033
1917
  /**
2034
1918
  * Retrieves information about a single cookie. If more than one cookie of the same name exists for the given URL, the one with the longest path will be returned. For cookies with the same path length, the cookie with the earliest creation time will be returned.
2035
1919
  * @param details Details to identify the cookie being retrieved.
2036
- * @param callback The callback parameter should be a function that looks like this:
2037
- * function( Cookie cookie) {...};
2038
1920
  * Parameter cookie: Contains details about the cookie. This parameter is null if no such cookie was found.
2039
1921
  */
2040
1922
  export function get(details: Details, callback: (cookie: Cookie | null) => void): void;
@@ -2125,11 +2007,9 @@ declare module chrome {
2125
2007
  * Attaches debugger to the given target.
2126
2008
  * @param target Debugging target to which you want to attach.
2127
2009
  * @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.
2128
- * @param callback Called once the attach operation succeeds or fails. Callback receives no arguments. If the attach fails, runtime.lastError will be set to the error message.
2129
- * If you specify the callback parameter, it should be a function that looks like this:
2130
- * function() {...};
2010
+ * @param callback Called once the attach operation succeeds or fails. If the attach fails, runtime.lastError will be set to the error message.
2131
2011
  */
2132
- export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void;
2012
+ export function attach(target: Debuggee, requiredVersion: string, callback: () => void): void;
2133
2013
  /**
2134
2014
  * Detaches debugger from the given target.
2135
2015
  * @param target Debugging target from which you want to detach.
@@ -2139,11 +2019,9 @@ declare module chrome {
2139
2019
  /**
2140
2020
  * Detaches debugger from the given target.
2141
2021
  * @param target Debugging target from which you want to detach.
2142
- * @param callback Called once the detach operation succeeds or fails. Callback receives no arguments. If the detach fails, runtime.lastError will be set to the error message.
2143
- * If you specify the callback parameter, it should be a function that looks like this:
2144
- * function() {...};
2022
+ * @param callback Called once the detach operation succeeds or fails. If the detach fails, runtime.lastError will be set to the error message.
2145
2023
  */
2146
- export function detach(target: Debuggee, callback?: () => void): void;
2024
+ export function detach(target: Debuggee, callback: () => void): void;
2147
2025
  /**
2148
2026
  * Sends given command to the debugging target.
2149
2027
  * @param target Debugging target to which you want to send the command.
@@ -2164,8 +2042,6 @@ declare module chrome {
2164
2042
  * @param commandParams Since Chrome 22.
2165
2043
  * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method.
2166
2044
  * @param callback Response body. If an error occurs while posting the message, the callback will be called with no arguments and runtime.lastError will be set to the error message.
2167
- * If you specify the callback parameter, it should be a function that looks like this:
2168
- * function(object result) {...};
2169
2045
  */
2170
2046
  export function sendCommand(
2171
2047
  target: Debuggee,
@@ -2182,8 +2058,6 @@ declare module chrome {
2182
2058
  /**
2183
2059
  * Since Chrome 28.
2184
2060
  * Returns the list of available debug targets.
2185
- * @param callback The callback parameter should be a function that looks like this:
2186
- * function(array of TargetInfo result) {...};
2187
2061
  * Parameter result: Array of TargetInfo objects corresponding to the available debug targets.
2188
2062
  */
2189
2063
  export function getTargets(callback: (result: TargetInfo[]) => void): void;
@@ -2415,8 +2289,6 @@ declare namespace chrome.desktopCapture {
2415
2289
  /**
2416
2290
  * Shows desktop media picker UI with the specified set of sources.
2417
2291
  * @param sources Set of sources that should be shown to the user.
2418
- * @param callback The callback parameter should be a function that looks like this:
2419
- * function(string streamId) {...};
2420
2292
  * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used.
2421
2293
  */
2422
2294
  export function chooseDesktopMedia(sources: string[], callback: (streamId: string, options: StreamOptions) => void): number;
@@ -2424,8 +2296,6 @@ declare namespace chrome.desktopCapture {
2424
2296
  * Shows desktop media picker UI with the specified set of sources.
2425
2297
  * @param sources Set of sources that should be shown to the user.
2426
2298
  * @param targetTab Optional tab for which the stream is created. If not specified then the resulting stream can be used only by the calling extension. The stream can only be used by frames in the given tab whose security origin matches tab.url.
2427
- * @param callback The callback parameter should be a function that looks like this:
2428
- * function(string streamId) {...};
2429
2299
  * Parameter streamId: An opaque string that can be passed to getUserMedia() API to generate media stream that corresponds to the source selected by the user. If user didn't select any source (i.e. canceled the prompt) then the callback is called with an empty streamId. The created streamId can be used only once and expires after a few seconds when it is not used.
2430
2300
  */
2431
2301
  export function chooseDesktopMedia(
@@ -2450,27 +2320,36 @@ declare namespace chrome.desktopCapture {
2450
2320
  declare namespace chrome.devtools.inspectedWindow {
2451
2321
  /** A resource within the inspected page, such as a document, a script, or an image. */
2452
2322
  export interface Resource {
2453
- /** The URL of the resource. */
2454
- url: string;
2455
- /**
2456
- * Gets the content of the resource.
2457
- * @param callback A function that receives resource content when the request completes.
2458
- * The callback parameter should be a function that looks like this:
2459
- * function(string content, string encoding) {...};
2460
- * Parameter content: Content of the resource (potentially encoded).
2461
- * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported.
2462
- */
2463
- getContent(callback: (content: string, encoding: string) => void): void;
2464
- /**
2465
- * Sets the content of the resource.
2466
- * @param content New content of the resource. Only resources with the text type are currently supported.
2467
- * @param commit True if the user has finished editing the resource, and the new content of the resource should be persisted; false if this is a minor change sent in progress of the user editing the resource.
2468
- * @param callback A function called upon request completion.
2469
- * If you specify the callback parameter, it should be a function that looks like this:
2470
- * function(object error) {...};
2471
- * Optional parameter error: Set to undefined if the resource content was set successfully; describes error otherwise.
2472
- */
2473
- setContent(content: string, commit: boolean, callback?: (error: Object) => void): void;
2323
+ /** The URL of the resource. */
2324
+ url: string;
2325
+ /**
2326
+ * Gets the content of the resource.
2327
+ * @param callback A function that receives resource content when the request completes.
2328
+ */
2329
+ getContent(
2330
+ callback: (
2331
+ /** Content of the resource (potentially encoded) */
2332
+ content: string,
2333
+ /** Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. */
2334
+ encoding: string
2335
+ ) => void
2336
+ ): void;
2337
+ /**
2338
+ * Sets the content of the resource.
2339
+ * @param content New content of the resource. Only resources with the text type are currently supported.
2340
+ * @param commit True if the user has finished editing the resource, and the new content of the resource should be persisted; false if this is a minor change sent in progress of the user editing the resource.
2341
+ * @param callback A function called upon request completion.
2342
+ */
2343
+ setContent(
2344
+ content: string,
2345
+ commit: boolean,
2346
+ callback?: (
2347
+ /**
2348
+ * Set to undefined if the resource content was set successfully; describes error otherwise.
2349
+ */
2350
+ error?: Object
2351
+ ) => void
2352
+ ): void;
2474
2353
  }
2475
2354
 
2476
2355
  export interface ReloadOptions {
@@ -2517,8 +2396,6 @@ declare namespace chrome.devtools.inspectedWindow {
2517
2396
  * Evaluates a JavaScript expression in the context of the main frame of the inspected page. The expression must evaluate to a JSON-compliant object, otherwise an exception is thrown. The eval function can report either a DevTools-side error or a JavaScript exception that occurs during evaluation. In either case, the result parameter of the callback is undefined. In the case of a DevTools-side error, the isException parameter is non-null and has isError set to true and code set to an error code. In the case of a JavaScript error, isException is set to true and value is set to the string value of thrown object.
2518
2397
  * @param expression An expression to evaluate.
2519
2398
  * @param callback A function called when evaluation completes.
2520
- * If you specify the callback parameter, it should be a function that looks like this:
2521
- * function(object result, object exceptionInfo) {...};
2522
2399
  * Parameter result: The result of evaluation.
2523
2400
  * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression.
2524
2401
  */
@@ -2531,8 +2408,6 @@ declare namespace chrome.devtools.inspectedWindow {
2531
2408
  * @param expression An expression to evaluate.
2532
2409
  * @param options The options parameter can contain one or more options.
2533
2410
  * @param callback A function called when evaluation completes.
2534
- * If you specify the callback parameter, it should be a function that looks like this:
2535
- * function(object result, object exceptionInfo) {...};
2536
2411
  * Parameter result: The result of evaluation.
2537
2412
  * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression.
2538
2413
  */
@@ -2544,8 +2419,6 @@ declare namespace chrome.devtools.inspectedWindow {
2544
2419
  /**
2545
2420
  * Retrieves the list of resources from the inspected page.
2546
2421
  * @param callback A function that receives the list of resources when the request completes.
2547
- * The callback parameter should be a function that looks like this:
2548
- * function(array of Resource resources) {...};
2549
2422
  */
2550
2423
  export function getResources(callback: (resources: Resource[]) => void): void;
2551
2424
 
@@ -2578,15 +2451,18 @@ declare namespace chrome.devtools.network {
2578
2451
  export interface HARLog extends HARFormatLog { }
2579
2452
  /** Represents a network request for a document resource (script, image and so on). See HAR Specification for reference. */
2580
2453
  export interface Request extends chrome.devtools.network.HAREntry {
2581
- /**
2582
- * Returns content of the response body.
2583
- * @param callback A function that receives the response body when the request completes.
2584
- * The callback parameter should be a function that looks like this:
2585
- * function(string content, string encoding) {...};
2586
- * Parameter content: Content of the response body (potentially encoded).
2587
- * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported.
2588
- */
2589
- getContent(callback: (content: string, encoding: string) => void): void;
2454
+ /**
2455
+ * Returns content of the response body.
2456
+ * @param callback A function that receives the response body when the request completes.
2457
+ */
2458
+ getContent(
2459
+ callback: (
2460
+ /** Content of the response body (potentially encoded) */
2461
+ content: string,
2462
+ /** Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported */
2463
+ encoding: string
2464
+ ) => void
2465
+ ): void;
2590
2466
  }
2591
2467
 
2592
2468
  export interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> { }
@@ -2596,8 +2472,6 @@ declare namespace chrome.devtools.network {
2596
2472
  /**
2597
2473
  * Returns HAR log that contains all known network requests.
2598
2474
  * @param callback A function that receives the HAR log when the request completes.
2599
- * The callback parameter should be a function that looks like this:
2600
- * function(object harLog) {...};
2601
2475
  * Parameter harLog: A HAR log. See HAR specification for details.
2602
2476
  */
2603
2477
  export function getHAR(callback: (harLog: HARLog) => void): void;
@@ -2658,17 +2532,20 @@ declare namespace chrome.devtools.panels {
2658
2532
 
2659
2533
  /** Represents the Elements panel. */
2660
2534
  export interface ElementsPanel {
2661
- /**
2662
- * Creates a pane within panel's sidebar.
2663
- * @param title Text that is displayed in sidebar caption.
2664
- * @param callback A callback invoked when the sidebar is created.
2665
- * If you specify the callback parameter, it should be a function that looks like this:
2666
- * function( ExtensionSidebarPane result) {...};
2667
- * Parameter result: An ExtensionSidebarPane object for created sidebar pane.
2668
- */
2669
- createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => void): void;
2670
- /** Fired when an object is selected in the panel. */
2671
- onSelectionChanged: SelectionChangedEvent;
2535
+ /**
2536
+ * Creates a pane within panel's sidebar.
2537
+ * @param title Text that is displayed in sidebar caption.
2538
+ * @param callback A callback invoked when the sidebar is created.
2539
+ */
2540
+ createSidebarPane(
2541
+ title: string,
2542
+ callback?: (
2543
+ /** An ExtensionSidebarPane object for created sidebar pane */
2544
+ result: ExtensionSidebarPane
2545
+ ) => void
2546
+ ): void;
2547
+ /** Fired when an object is selected in the panel. */
2548
+ onSelectionChanged: SelectionChangedEvent;
2672
2549
  }
2673
2550
 
2674
2551
  /**
@@ -2680,11 +2557,14 @@ declare namespace chrome.devtools.panels {
2680
2557
  * Creates a pane within panel's sidebar.
2681
2558
  * @param title Text that is displayed in sidebar caption.
2682
2559
  * @param callback A callback invoked when the sidebar is created.
2683
- * If you specify the callback parameter, it should be a function that looks like this:
2684
- * function( ExtensionSidebarPane result) {...};
2685
- * Parameter result: An ExtensionSidebarPane object for created sidebar pane.
2686
2560
  */
2687
- createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => void): void;
2561
+ createSidebarPane(
2562
+ title: string,
2563
+ callback?: (
2564
+ /** An ExtensionSidebarPane object for created sidebar pane. */
2565
+ result: ExtensionSidebarPane
2566
+ ) => void
2567
+ ): void;
2688
2568
  /** Fired when an object is selected in the panel. */
2689
2569
  onSelectionChanged: SelectionChangedEvent;
2690
2570
  }
@@ -2706,16 +2586,12 @@ declare namespace chrome.devtools.panels {
2706
2586
  * @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch.
2707
2587
  * @param rootTitle An optional title for the root of the expression tree.
2708
2588
  * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results.
2709
- * If you specify the callback parameter, it should be a function that looks like this:
2710
- * function() {...};
2711
2589
  */
2712
2590
  setExpression(expression: string, rootTitle?: string, callback?: () => void): void;
2713
2591
  /**
2714
2592
  * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.
2715
2593
  * @param expression An expression to be evaluated in context of the inspected page. JavaScript objects and DOM nodes are displayed in an expandable tree similar to the console/watch.
2716
2594
  * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results.
2717
- * If you specify the callback parameter, it should be a function that looks like this:
2718
- * function() {...};
2719
2595
  */
2720
2596
  setExpression(expression: string, callback?: () => void): void;
2721
2597
  /**
@@ -2723,16 +2599,12 @@ declare namespace chrome.devtools.panels {
2723
2599
  * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
2724
2600
  * @param rootTitle An optional title for the root of the expression tree.
2725
2601
  * @param callback A callback invoked after the sidebar is updated with the object.
2726
- * If you specify the callback parameter, it should be a function that looks like this:
2727
- * function() {...};
2728
2602
  */
2729
2603
  setObject(jsonObject: Object, rootTitle?: string, callback?: () => void): void;
2730
2604
  /**
2731
2605
  * Sets a JSON-compliant object to be displayed in the sidebar pane.
2732
2606
  * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
2733
2607
  * @param callback A callback invoked after the sidebar is updated with the object.
2734
- * If you specify the callback parameter, it should be a function that looks like this:
2735
- * function() {...};
2736
2608
  */
2737
2609
  setObject(jsonObject: Object, callback?: () => void): void;
2738
2610
  /**
@@ -2760,8 +2632,6 @@ declare namespace chrome.devtools.panels {
2760
2632
  * @param iconPath Path of the panel's icon relative to the extension directory.
2761
2633
  * @param pagePath Path of the panel's HTML page relative to the extension directory.
2762
2634
  * @param callback A function that is called when the panel is created.
2763
- * If you specify the callback parameter, it should be a function that looks like this:
2764
- * function( ExtensionPanel panel) {...};
2765
2635
  * Parameter panel: An ExtensionPanel object representing the created panel.
2766
2636
  */
2767
2637
  export function create(
@@ -2773,8 +2643,6 @@ declare namespace chrome.devtools.panels {
2773
2643
  /**
2774
2644
  * Specifies the function to be called when the user clicks a resource link in the Developer Tools window. To unset the handler, either call the method with no parameters or pass null as the parameter.
2775
2645
  * @param callback A function that is called when the user clicks on a valid resource link in Developer Tools window. Note that if the user clicks an invalid URL or an XHR, this function is not called.
2776
- * If you specify the callback parameter, it should be a function that looks like this:
2777
- * function( devtools.inspectedWindow.Resource resource) {...};
2778
2646
  * Parameter resource: A devtools.inspectedWindow.Resource object for the resource that was clicked.
2779
2647
  */
2780
2648
  export function setOpenResourceHandler(
@@ -2786,8 +2654,6 @@ declare namespace chrome.devtools.panels {
2786
2654
  * @param url The URL of the resource to open.
2787
2655
  * @param lineNumber Specifies the line number to scroll to when the resource is loaded.
2788
2656
  * @param callback A function that is called when the resource has been successfully loaded.
2789
- * If you specify the callback parameter, it should be a function that looks like this:
2790
- * function() {...};
2791
2657
  */
2792
2658
  export function openResource(url: string, lineNumber: number, callback: () => void): void;
2793
2659
 
@@ -2826,8 +2692,6 @@ declare namespace chrome.documentScan {
2826
2692
  * Performs a document scan. On success, the PNG data will be sent to the callback.
2827
2693
  * @param options Object containing scan parameters.
2828
2694
  * @param callback Called with the result and data from the scan.
2829
- * The callback parameter should be a function that looks like this:
2830
- * function(object result) {...};
2831
2695
  */
2832
2696
  export function scan(options: DocumentScanOptions, callback: (result: DocumentScanCallbackArg) => void): void;
2833
2697
  }
@@ -3057,8 +2921,6 @@ declare namespace chrome.downloads {
3057
2921
  export function search(query: DownloadQuery): Promise<DownloadItem[]>;
3058
2922
  /**
3059
2923
  * 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.
3060
- * @param callback The callback parameter should be a function that looks like this:
3061
- * function(array of DownloadItem results) {...};
3062
2924
  */
3063
2925
  export function search(query: DownloadQuery, callback: (results: DownloadItem[]) => void): void;
3064
2926
  /**
@@ -3071,10 +2933,8 @@ declare namespace chrome.downloads {
3071
2933
  * 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.
3072
2934
  * @param downloadId The id of the download to pause.
3073
2935
  * @param callback Called when the pause request is completed.
3074
- * If you specify the callback parameter, it should be a function that looks like this:
3075
- * function() {...};
3076
2936
  */
3077
- export function pause(downloadId: number, callback?: () => void): void;
2937
+ export function pause(downloadId: number, callback: () => void): void;
3078
2938
  /**
3079
2939
  * 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.
3080
2940
  * @param downloadId The identifier for the download.
@@ -3085,16 +2945,12 @@ declare namespace chrome.downloads {
3085
2945
  * 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.
3086
2946
  * @param downloadId The identifier for the download.
3087
2947
  * @param callback A URL to an image that represents the download.
3088
- * The callback parameter should be a function that looks like this:
3089
- * function(string iconURL) {...};
3090
2948
  */
3091
2949
  export function getFileIcon(downloadId: number, callback: (iconURL: string) => void): void;
3092
2950
  /**
3093
2951
  * 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.
3094
2952
  * @param downloadId The identifier for the download.
3095
2953
  * @param callback A URL to an image that represents the download.
3096
- * The callback parameter should be a function that looks like this:
3097
- * function(string iconURL) {...};
3098
2954
  */
3099
2955
  export function getFileIcon(
3100
2956
  downloadId: number,
@@ -3111,10 +2967,8 @@ declare namespace chrome.downloads {
3111
2967
  * 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.
3112
2968
  * @param downloadId The id of the download to resume.
3113
2969
  * @param callback Called when the resume request is completed.
3114
- * If you specify the callback parameter, it should be a function that looks like this:
3115
- * function() {...};
3116
2970
  */
3117
- export function resume(downloadId: number, callback?: () => void): void;
2971
+ export function resume(downloadId: number, callback: () => void): void;
3118
2972
  /**
3119
2973
  * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore.
3120
2974
  * @param downloadId The id of the download to cancel.
@@ -3125,10 +2979,8 @@ declare namespace chrome.downloads {
3125
2979
  * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore.
3126
2980
  * @param downloadId The id of the download to cancel.
3127
2981
  * @param callback Called when the cancel request is completed.
3128
- * If you specify the callback parameter, it should be a function that looks like this:
3129
- * function() {...};
3130
2982
  */
3131
- export function cancel(downloadId: number, callback?: () => void): void;
2983
+ export function cancel(downloadId: number, callback: () => void): void;
3132
2984
  /**
3133
2985
  * 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.
3134
2986
  * @param options What to download and how.
@@ -3139,10 +2991,8 @@ declare namespace chrome.downloads {
3139
2991
  * 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.
3140
2992
  * @param options What to download and how.
3141
2993
  * @param callback Called with the id of the new DownloadItem.
3142
- * If you specify the callback parameter, it should be a function that looks like this:
3143
- * function(integer downloadId) {...};
3144
2994
  */
3145
- export function download(options: DownloadOptions, callback?: (downloadId: number) => void): void;
2995
+ export function download(options: DownloadOptions, callback: (downloadId: number) => void): void;
3146
2996
  /**
3147
2997
  * Open the downloaded file now if the DownloadItem is complete; otherwise returns an error through runtime.lastError. Requires the "downloads.open" permission in addition to the "downloads" permission. An onChanged event will fire when the item is opened for the first time.
3148
2998
  * @param downloadId The identifier for the downloaded file.
@@ -3162,8 +3012,6 @@ declare namespace chrome.downloads {
3162
3012
  export function erase(query: DownloadQuery): Promise<number[]>;
3163
3013
  /**
3164
3014
  * 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.
3165
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
3166
- * function(array of integer erasedIds) {...};
3167
3015
  */
3168
3016
  export function erase(query: DownloadQuery, callback: (erasedIds: number[]) => void): void;
3169
3017
  /**
@@ -3173,8 +3021,6 @@ declare namespace chrome.downloads {
3173
3021
  export function removeFile(downloadId: number): Promise<void>;
3174
3022
  /**
3175
3023
  * Remove the downloaded file if it exists and the DownloadItem is complete; otherwise return an error through runtime.lastError.
3176
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
3177
- * function() {...};
3178
3024
  */
3179
3025
  export function removeFile(downloadId: number, callback?: () => void): void;
3180
3026
  /**
@@ -3187,8 +3033,6 @@ declare namespace chrome.downloads {
3187
3033
  * 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.
3188
3034
  * @param downloadId The identifier for the DownloadItem.
3189
3035
  * @param callback Called when the danger prompt dialog closes.
3190
- * If you specify the callback parameter, it should be a function that looks like this:
3191
- * function() {...};
3192
3036
  */
3193
3037
  export function acceptDanger(downloadId: number, callback: () => void): void;
3194
3038
  /** Initiate dragging the downloaded file to another application. Call in a javascript ondragstart handler. */
@@ -3242,8 +3086,6 @@ declare namespace chrome.enterprise.platformKeys {
3242
3086
  /**
3243
3087
  * Returns the available Tokens. In a regular user's session the list will always contain the user's token with id "user". If a system-wide TPM token is available, the returned list will also contain the system-wide token with id "system". The system-wide token will be the same for all sessions on this device (device in the sense of e.g. a Chromebook).
3244
3088
  * @param callback Invoked by getTokens with the list of available Tokens.
3245
- * The callback parameter should be a function that looks like this:
3246
- * function(array of Token tokens) {...};
3247
3089
  * Parameter tokens: The list of available tokens.
3248
3090
  */
3249
3091
  export function getTokens(callback: (tokens: Token[]) => void): void;
@@ -3251,8 +3093,6 @@ declare namespace chrome.enterprise.platformKeys {
3251
3093
  * Returns the list of all client certificates available from the given token. Can be used to check for the existence and expiration of client certificates that are usable for a certain authentication.
3252
3094
  * @param tokenId The id of a Token returned by getTokens.
3253
3095
  * @param callback Called back with the list of the available certificates.
3254
- * The callback parameter should be a function that looks like this:
3255
- * function(array of ArrayBuffer certificates) {...};
3256
3096
  * Parameter certificates: The list of certificates, each in DER encoding of a X.509 certificate.
3257
3097
  */
3258
3098
  export function getCertificates(tokenId: string, callback: (certificates: ArrayBuffer[]) => void): void;
@@ -3261,8 +3101,6 @@ declare namespace chrome.enterprise.platformKeys {
3261
3101
  * @param tokenId The id of a Token returned by getTokens.
3262
3102
  * @param certificate The DER encoding of a X.509 certificate.
3263
3103
  * @param callback Called back when this operation is finished.
3264
- * If you specify the callback parameter, it should be a function that looks like this:
3265
- * function() {...};
3266
3104
  */
3267
3105
  export function importCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void;
3268
3106
  /**
@@ -3270,8 +3108,6 @@ declare namespace chrome.enterprise.platformKeys {
3270
3108
  * @param tokenId The id of a Token returned by getTokens.
3271
3109
  * @param certificate The DER encoding of a X.509 certificate.
3272
3110
  * @param callback Called back when this operation is finished.
3273
- * If you specify the callback parameter, it should be a function that looks like this:
3274
- * function() {...};
3275
3111
  */
3276
3112
  export function removeCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void;
3277
3113
  /**
@@ -3287,8 +3123,6 @@ declare namespace chrome.enterprise.platformKeys {
3287
3123
  * @param challenge A challenge as emitted by the Verified Access Web API.
3288
3124
  * @param registerKey If set, the current Enterprise Machine Key is registered with the "system" token and relinquishes the Enterprise Machine Key role. The key can then be associated with a certificate and used like any other signing key. This key is 2048-bit RSA. Subsequent calls to this function will then generate a new Enterprise Machine Key. Since Chrome 59.
3289
3125
  * @param callback Called back with the challenge response.
3290
- * The callback parameter should be a function that looks like this:
3291
- * function(ArrayBuffer response) {...};
3292
3126
  * @since Chrome 50.
3293
3127
  */
3294
3128
  export function challengeMachineKey(
@@ -3310,8 +3144,6 @@ declare namespace chrome.enterprise.platformKeys {
3310
3144
  * @param challenge A challenge as emitted by the Verified Access Web API.
3311
3145
  * @param registerKey If set, the current Enterprise User Key is registered with the "user" token and relinquishes the Enterprise User Key role. The key can then be associated with a certificate and used like any other signing key. This key is 2048-bit RSA. Subsequent calls to this function will then generate a new Enterprise User Key.
3312
3146
  * @param callback Called back with the challenge response.
3313
- * The callback parameter should be a function that looks like this:
3314
- * function(ArrayBuffer response) {...};
3315
3147
  * @since Chrome 50.
3316
3148
  */
3317
3149
  export function challengeUserKey(
@@ -3335,8 +3167,6 @@ declare namespace chrome.enterprise.deviceAttributes {
3335
3167
  /**
3336
3168
  * @description Fetches the value of the device identifier of the directory API, that is generated by the server and identifies the cloud record of the device for querying in the cloud directory API.
3337
3169
  * @param callback Called with the device identifier of the directory API when received.
3338
- * The callback parameter should be a function that looks like this:
3339
- * function(string deviceId) {...};
3340
3170
  */
3341
3171
  export function getDirectoryDeviceId(callback: (deviceId: string) => void): void;
3342
3172
  /**
@@ -3397,8 +3227,6 @@ declare namespace chrome.enterprise.networkingAttributes {
3397
3227
  /**
3398
3228
  * Retrieves the network details of the device's default network. If the user is not affiliated or the device is not connected to a network, runtime.lastError will be set with a failure reason.
3399
3229
  * @param callback Called with the device's default network's NetworkDetails.
3400
- * The callback parameter should be a function that looks like this:
3401
- * function(NetworkDetails networkAddresses) {...};
3402
3230
  */
3403
3231
  export function getNetworkDetails(callback: (networkDetails: NetworkDetails) => void): void;
3404
3232
  }
@@ -3468,20 +3296,25 @@ declare namespace chrome.events {
3468
3296
  /**
3469
3297
  * Returns currently registered rules.
3470
3298
  * @param callback Called with registered rules.
3471
- * The callback parameter should be a function that looks like this:
3472
- * function(array of Rule rules) {...};
3473
- * Parameter rules: Rules that were registered, the optional parameters are filled with values.
3474
3299
  */
3475
- getRules(callback: (rules: Rule[]) => void): void;
3300
+ getRules(
3301
+ callback: (
3302
+ /** Rules that were registered, the optional parameters are filled with values */
3303
+ rules: Rule[]
3304
+ ) => void
3305
+ ): void;
3476
3306
  /**
3477
3307
  * Returns currently registered rules.
3478
3308
  * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are returned.
3479
3309
  * @param callback Called with registered rules.
3480
- * The callback parameter should be a function that looks like this:
3481
- * function(array of Rule rules) {...};
3482
- * Parameter rules: Rules that were registered, the optional parameters are filled with values.
3483
3310
  */
3484
- getRules(ruleIdentifiers: string[], callback: (rules: Rule[]) => void): void;
3311
+ getRules(
3312
+ ruleIdentifiers: string[],
3313
+ callback: (
3314
+ /** Rules that were registered, the optional parameters are filled with values */
3315
+ rules: Rule[]
3316
+ ) => void
3317
+ ): void;
3485
3318
  /**
3486
3319
  * @param callback Listener whose registration status shall be tested.
3487
3320
  */
@@ -3490,31 +3323,28 @@ declare namespace chrome.events {
3490
3323
  * Unregisters currently registered rules.
3491
3324
  * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are unregistered.
3492
3325
  * @param callback Called when rules were unregistered.
3493
- * If you specify the callback parameter, it should be a function that looks like this:
3494
- * function() {...};
3495
3326
  */
3496
3327
  removeRules(ruleIdentifiers?: string[], callback?: () => void): void;
3497
3328
  /**
3498
3329
  * Unregisters currently registered rules.
3499
3330
  * @param callback Called when rules were unregistered.
3500
- * If you specify the callback parameter, it should be a function that looks like this:
3501
- * function() {...};
3502
3331
  */
3503
3332
  removeRules(callback?: () => void): void;
3504
3333
  /**
3505
3334
  * Registers rules to handle events.
3506
3335
  * @param rules Rules to be registered. These do not replace previously registered rules.
3507
3336
  * @param callback Called with registered rules.
3508
- * If you specify the callback parameter, it should be a function that looks like this:
3509
- * function(array of Rule rules) {...};
3510
- * Parameter rules: Rules that were registered, the optional parameters are filled with values.
3511
3337
  */
3512
- addRules(rules: Rule[], callback?: (rules: Rule[]) => void): void;
3338
+ addRules(
3339
+ rules: Rule[],
3340
+ callback?: (
3341
+ /** Rules that were registered, the optional parameters are filled with values */
3342
+ rules: Rule[]
3343
+ ) => void
3344
+ ): void;
3513
3345
  /**
3514
3346
  * Deregisters an event listener callback from an event.
3515
3347
  * @param callback Listener that shall be unregistered.
3516
- * The callback parameter should be a function that looks like this:
3517
- * function() {...};
3518
3348
  */
3519
3349
  removeListener(callback: T): void;
3520
3350
  hasListeners(): boolean;
@@ -3525,8 +3355,6 @@ declare namespace chrome.events {
3525
3355
  /**
3526
3356
  * Registers an event listener callback to an event.
3527
3357
  * @param callback Called when an event occurs. The parameters of this function depend on the type of event.
3528
- * The callback parameter should be a function that looks like this:
3529
- * function() {...};
3530
3358
  */
3531
3359
  addListener(callback: T): void;
3532
3360
  }
@@ -3616,8 +3444,6 @@ declare namespace chrome.extension {
3616
3444
  /**
3617
3445
  * Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.
3618
3446
  * Since Chrome 12.
3619
- * @param callback The callback parameter should be a function that looks like this:
3620
- * function(boolean isAllowedAccess) {...};
3621
3447
  * Parameter isAllowedAccess: True if the extension can access the 'file://' scheme, false otherwise.
3622
3448
  */
3623
3449
  export function isAllowedFileSchemeAccess(callback: (isAllowedAccess: boolean) => void): void;
@@ -3630,8 +3456,6 @@ declare namespace chrome.extension {
3630
3456
  /**
3631
3457
  * Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.
3632
3458
  * Since Chrome 12.
3633
- * @param callback The callback parameter should be a function that looks like this:
3634
- * function(boolean isAllowedAccess) {...};
3635
3459
  * Parameter isAllowedAccess: True if the extension has access to Incognito mode, false otherwise.
3636
3460
  */
3637
3461
  export function isAllowedIncognitoAccess(callback: (isAllowedAccess: boolean) => void): void;
@@ -3714,8 +3538,6 @@ declare namespace chrome.fileBrowserHandler {
3714
3538
  * Since Chrome 21.
3715
3539
  * @param selectionParams Parameters that will be used while selecting the file.
3716
3540
  * @param callback Function called upon completion.
3717
- * The callback parameter should be a function that looks like this:
3718
- * function(object result) {...};
3719
3541
  * Parameter result: Result of the method.
3720
3542
  */
3721
3543
  export function selectFile(selectionParams: SelectionParams, callback: (result: SelectionResult) => void): void;
@@ -4074,31 +3896,23 @@ declare namespace chrome.fileSystemProvider {
4074
3896
  * Depending on the type of the file system being mounted, the source option must be set appropriately.
4075
3897
  * In case of an error, runtime.lastError will be set with a corresponding error code.
4076
3898
  * @param callback A generic result callback to indicate success or failure.
4077
- * If you specify the callback parameter, it should be a function that looks like this:
4078
- * function() {...};
4079
3899
  */
4080
3900
  export function mount(options: MountOptions, callback?: () => void): void;
4081
3901
  /**
4082
3902
  * Unmounts a file system with the given fileSystemId. It must be called after onUnmountRequested is invoked. Also, the providing extension can decide to perform unmounting if not requested (eg. in case of lost connection, or a file error).
4083
3903
  * In case of an error, runtime.lastError will be set with a corresponding error code.
4084
3904
  * @param callback A generic result callback to indicate success or failure.
4085
- * If you specify the callback parameter, it should be a function that looks like this:
4086
- * function() {...};
4087
3905
  */
4088
3906
  export function unmount(options: UnmountOptions, callback?: () => void): void;
4089
3907
  /**
4090
3908
  * Returns all file systems mounted by the extension.
4091
3909
  * @param callback Callback to receive the result of getAll function.
4092
- * The callback parameter should be a function that looks like this:
4093
- * function(array of FileSystemInfo fileSystems) {...};
4094
3910
  */
4095
3911
  export function getAll(callback: (fileSystems: FileSystemInfo[]) => void): void;
4096
3912
  /**
4097
3913
  * Returns information about a file system with the passed fileSystemId.
4098
3914
  * @since Since Chrome 42.
4099
3915
  * @param callback Callback to receive the result of get function.
4100
- * The callback parameter should be a function that looks like this:
4101
- * function(FileSystemInfo fileSystem) {...};
4102
3916
  */
4103
3917
  export function get(fileSystemId: string, callback: (fileSystem: FileSystemInfo) => void): void;
4104
3918
  /**
@@ -4109,8 +3923,6 @@ declare namespace chrome.fileSystemProvider {
4109
3923
  * Note that if a parent directory is removed, then all descendant entries are also removed, and if they are watched, then the API must be notified about the fact. Also, if a directory is renamed, then all descendant entries are in fact removed, as there is no entry under their original paths anymore.
4110
3924
  * In case of an error, runtime.lastError will be set will a corresponding error code.
4111
3925
  * @param callback A generic result callback to indicate success or failure.
4112
- * If you specify the callback parameter, it should be a function that looks like this:
4113
- * function() {...};
4114
3926
  */
4115
3927
  export function notify(options: NotificationOptions, callback: () => void): void;
4116
3928
 
@@ -4249,10 +4061,8 @@ declare namespace chrome.fontSettings {
4249
4061
  export function setDefaultFontSize(details: DefaultFontSizeDetails): Promise<void>
4250
4062
  /**
4251
4063
  * Sets the default font size.
4252
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4253
- * function() {...};
4254
4064
  */
4255
- export function setDefaultFontSize(details: DefaultFontSizeDetails, callback?: Function): void;
4065
+ export function setDefaultFontSize(details: DefaultFontSizeDetails, callback: Function): void;
4256
4066
  /**
4257
4067
  * Gets the font for a given script and generic font family.
4258
4068
  * @return The `getFont` method provides its result via callback or returned as a `Promise` (MV3 only).
@@ -4260,10 +4070,8 @@ declare namespace chrome.fontSettings {
4260
4070
  export function getFont(details: FontDetails): Promise<FontDetailsResult>
4261
4071
  /**
4262
4072
  * Gets the font for a given script and generic font family.
4263
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4264
- * function(object details) {...};
4265
4073
  */
4266
- export function getFont(details: FontDetails, callback?: (details: FontDetailsResult) => void): void;
4074
+ export function getFont(details: FontDetails, callback: (details: FontDetailsResult) => void): void;
4267
4075
  /**
4268
4076
  * Gets the default font size.
4269
4077
  * @param details This parameter is currently unused.
@@ -4273,10 +4081,9 @@ declare namespace chrome.fontSettings {
4273
4081
  /**
4274
4082
  * Gets the default font size.
4275
4083
  * @param details This parameter is currently unused.
4276
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4277
- * function(object details) {...};
4278
4084
  */
4279
- export function getDefaultFontSize(details?: Object, callback?: (options: FontSizeDetails) => void): void;
4085
+ export function getDefaultFontSize(callback: (options: FontSizeDetails) => void): void;
4086
+ export function getDefaultFontSize(details: Object, callback: (options: FontSizeDetails) => void): void;
4280
4087
  /**
4281
4088
  * Gets the minimum font size.
4282
4089
  * @param details This parameter is currently unused.
@@ -4286,10 +4093,9 @@ declare namespace chrome.fontSettings {
4286
4093
  /**
4287
4094
  * Gets the minimum font size.
4288
4095
  * @param details This parameter is currently unused.
4289
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4290
- * function(object details) {...};
4291
4096
  */
4292
- export function getMinimumFontSize(details?: object, callback?: (options: FontSizeDetails) => void): void;
4097
+ export function getMinimumFontSize(callback: (options: FontSizeDetails) => void): void;
4098
+ export function getMinimumFontSize(details: object, callback: (options: FontSizeDetails) => void): void;
4293
4099
  /**
4294
4100
  * Sets the minimum font size.
4295
4101
  * @return The `setMinimumFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4297,10 +4103,8 @@ declare namespace chrome.fontSettings {
4297
4103
  export function setMinimumFontSize(details: SetFontSizeDetails): Promise<void>;
4298
4104
  /**
4299
4105
  * Sets the minimum font size.
4300
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4301
- * function() {...};
4302
4106
  */
4303
- export function setMinimumFontSize(details: SetFontSizeDetails, callback?: Function): void;
4107
+ export function setMinimumFontSize(details: SetFontSizeDetails, callback: Function): void;
4304
4108
  /**
4305
4109
  * Gets the default size for fixed width fonts.
4306
4110
  * @param details This parameter is currently unused.
@@ -4310,10 +4114,9 @@ declare namespace chrome.fontSettings {
4310
4114
  /**
4311
4115
  * Gets the default size for fixed width fonts.
4312
4116
  * @param details This parameter is currently unused.
4313
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4314
- * function(object details) {...};
4315
4117
  */
4316
- export function getDefaultFixedFontSize(details?: Object, callback?: (details: FontSizeDetails) => void): void;
4118
+ export function getDefaultFixedFontSize(callback: (details: FontSizeDetails) => void): void;
4119
+ export function getDefaultFixedFontSize(details: Object, callback: (details: FontSizeDetails) => void): void;
4317
4120
  /**
4318
4121
  * Clears the default font size set by this extension, if any.
4319
4122
  * @param details This parameter is currently unused.
@@ -4323,10 +4126,9 @@ declare namespace chrome.fontSettings {
4323
4126
  /**
4324
4127
  * Clears the default font size set by this extension, if any.
4325
4128
  * @param details This parameter is currently unused.
4326
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4327
- * function() {...};
4328
4129
  */
4329
- export function clearDefaultFontSize(details?: Object, callback?: Function): void;
4130
+ export function clearDefaultFontSize(callback: Function): void;
4131
+ export function clearDefaultFontSize(details: Object, callback: Function): void;
4330
4132
  /**
4331
4133
  * Sets the default size for fixed width fonts.
4332
4134
  * @return The `setDefaultFixedFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4334,10 +4136,8 @@ declare namespace chrome.fontSettings {
4334
4136
  export function setDefaultFixedFontSize(details: SetFontSizeDetails): Promise<void>;
4335
4137
  /**
4336
4138
  * Sets the default size for fixed width fonts.
4337
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4338
- * function() {...};
4339
4139
  */
4340
- export function setDefaultFixedFontSize(details: SetFontSizeDetails, callback?: Function): void;
4140
+ export function setDefaultFixedFontSize(details: SetFontSizeDetails, callback: Function): void;
4341
4141
  /**
4342
4142
  * Clears the font set by this extension, if any.
4343
4143
  * @return The `clearFont` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4345,10 +4145,8 @@ declare namespace chrome.fontSettings {
4345
4145
  export function clearFont(details: FontDetails): Promise<void>;
4346
4146
  /**
4347
4147
  * Clears the font set by this extension, if any.
4348
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4349
- * function() {...};
4350
4148
  */
4351
- export function clearFont(details: FontDetails, callback?: Function): void;
4149
+ export function clearFont(details: FontDetails, callback: Function): void;
4352
4150
  /**
4353
4151
  * Sets the font for a given script and generic font family.
4354
4152
  * @return The `setFont` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4356,10 +4154,8 @@ declare namespace chrome.fontSettings {
4356
4154
  export function setFont(details: SetFontDetails): Promise<void>;
4357
4155
  /**
4358
4156
  * Sets the font for a given script and generic font family.
4359
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4360
- * function(object details) {...};
4361
4157
  */
4362
- export function setFont(details: SetFontDetails, callback?: Function): void;
4158
+ export function setFont(details: SetFontDetails, callback: Function): void;
4363
4159
  /**
4364
4160
  * Clears the minimum font size set by this extension, if any.
4365
4161
  * @param details This parameter is currently unused.
@@ -4369,10 +4165,9 @@ declare namespace chrome.fontSettings {
4369
4165
  /**
4370
4166
  * Clears the minimum font size set by this extension, if any.
4371
4167
  * @param details This parameter is currently unused.
4372
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4373
- * function() {...};
4374
4168
  */
4375
- export function clearMinimumFontSize(details?: Object, callback?: Function): void;
4169
+ export function clearMinimumFontSize(callback: Function): void;
4170
+ export function clearMinimumFontSize(details: Object, callback: Function): void;
4376
4171
  /**
4377
4172
  * Gets a list of fonts on the system.
4378
4173
  * @return The `getFontList` method provides its result via callback or returned as a `Promise` (MV3 only).
@@ -4380,10 +4175,8 @@ declare namespace chrome.fontSettings {
4380
4175
  export function getFontList(): Promise<FontName[]>;
4381
4176
  /**
4382
4177
  * Gets a list of fonts on the system.
4383
- * @param callback The callback parameter should be a function that looks like this:
4384
- * function(array of FontName results) {...};
4385
4178
  */
4386
- export function getFontList(callback?: (results: FontName[]) => void): void;
4179
+ export function getFontList(callback: (results: FontName[]) => void): void;
4387
4180
  /**
4388
4181
  * Clears the default fixed font size set by this extension, if any.
4389
4182
  * @param details This parameter is currently unused.
@@ -4393,10 +4186,8 @@ declare namespace chrome.fontSettings {
4393
4186
  /**
4394
4187
  * Clears the default fixed font size set by this extension, if any.
4395
4188
  * @param details This parameter is currently unused.
4396
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4397
- * function() {...};
4398
4189
  */
4399
- export function clearDefaultFixedFontSize(details: Object, callback?: Function): void;
4190
+ export function clearDefaultFixedFontSize(details: Object, callback: Function): void;
4400
4191
 
4401
4192
  /** Fired when the default fixed font size setting changes. */
4402
4193
  export var onDefaultFixedFontSizeChanged: DefaultFixedFontSizeChangedEvent;
@@ -4466,24 +4257,18 @@ declare namespace chrome.gcm {
4466
4257
  * Registers the application with GCM. The registration ID will be returned by the callback. If register is called again with the same list of senderIds, the same registration ID will be returned.
4467
4258
  * @param senderIds A list of server IDs that are allowed to send messages to the application. It should contain at least one and no more than 100 sender IDs.
4468
4259
  * @param callback Function called when registration completes. It should check runtime.lastError for error when registrationId is empty.
4469
- * The callback parameter should be a function that looks like this:
4470
- * function(string registrationId) {...};
4471
4260
  * Parameter registrationId: A registration ID assigned to the application by the GCM.
4472
4261
  */
4473
4262
  export function register(senderIds: string[], callback: (registrationId: string) => void): void;
4474
4263
  /**
4475
4264
  * Unregisters the application from GCM.
4476
4265
  * @param callback A function called after the unregistration completes. Unregistration was successful if runtime.lastError is not set.
4477
- * The callback parameter should be a function that looks like this:
4478
- * function() {...};
4479
4266
  */
4480
4267
  export function unregister(callback: () => void): void;
4481
4268
  /**
4482
4269
  * Sends a message according to its contents.
4483
4270
  * @param message A message to send to the other party via GCM.
4484
4271
  * @param callback A function called after the message is successfully queued for sending. runtime.lastError should be checked, to ensure a message was sent without problems.
4485
- * The callback parameter should be a function that looks like this:
4486
- * function(string messageId) {...};
4487
4272
  * Parameter messageId: The ID of the message that the callback was issued for.
4488
4273
  */
4489
4274
  export function send(message: OutgoingMessage, callback: (messageId: string) => void): void;
@@ -4576,10 +4361,8 @@ declare namespace chrome.history {
4576
4361
  export function search(query: HistoryQuery): Promise<HistoryItem[]>;
4577
4362
  /**
4578
4363
  * Searches the history for the last visit time of each page matching the query.
4579
- * @param callback The callback parameter should be a function that looks like this:
4580
- * function(array of HistoryItem results) {...};
4581
4364
  */
4582
- export function search(query: HistoryQuery, callback?: (results: HistoryItem[]) => void): void;
4365
+ export function search(query: HistoryQuery, callback: (results: HistoryItem[]) => void): void;
4583
4366
  /**
4584
4367
  * Adds a URL to the history at the current time with a transition type of "link".
4585
4368
  * @return The `addUrl` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4587,10 +4370,8 @@ declare namespace chrome.history {
4587
4370
  export function addUrl(details: Url): Promise<void>;
4588
4371
  /**
4589
4372
  * Adds a URL to the history at the current time with a transition type of "link".
4590
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4591
- * function() {...};
4592
4373
  */
4593
- export function addUrl(details: Url, callback?: () => void): void;
4374
+ export function addUrl(details: Url, callback: () => void): void;
4594
4375
  /**
4595
4376
  * 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.
4596
4377
  * @return The `deleteRange` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4598,10 +4379,8 @@ declare namespace chrome.history {
4598
4379
  export function deleteRange(range: Range): Promise<void>;
4599
4380
  /**
4600
4381
  * 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.
4601
- * @param callback The callback parameter should be a function that looks like this:
4602
- * function() {...};
4603
4382
  */
4604
- export function deleteRange(range: Range, callback?: () => void): void;
4383
+ export function deleteRange(range: Range, callback: () => void): void;
4605
4384
  /**
4606
4385
  * Deletes all items from the history.
4607
4386
  * @return The `deleteAll` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4609,8 +4388,6 @@ declare namespace chrome.history {
4609
4388
  export function deleteAll(): Promise<void>;
4610
4389
  /**
4611
4390
  * Deletes all items from the history.
4612
- * @param callback The callback parameter should be a function that looks like this:
4613
- * function() {...};
4614
4391
  */
4615
4392
  export function deleteAll(callback: () => void): void;
4616
4393
  /**
@@ -4620,8 +4397,6 @@ declare namespace chrome.history {
4620
4397
  export function getVisits(details: Url): Promise<VisitItem[]>;
4621
4398
  /**
4622
4399
  * Retrieves information about visits to a URL.
4623
- * @param callback The callback parameter should be a function that looks like this:
4624
- * function(array of VisitItem results) {...};
4625
4400
  */
4626
4401
  export function getVisits(details: Url, callback: (results: VisitItem[]) => void): void;
4627
4402
  /**
@@ -4631,10 +4406,8 @@ declare namespace chrome.history {
4631
4406
  export function deleteUrl(details: Url): Promise<void>;
4632
4407
  /**
4633
4408
  * Removes all occurrences of the given URL from the history.
4634
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4635
- * function() {...};
4636
4409
  */
4637
- export function deleteUrl(details: Url, callback?: () => void): void;
4410
+ export function deleteUrl(details: Url, callback: () => void): void;
4638
4411
 
4639
4412
  /** Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded. */
4640
4413
  export var onVisited: HistoryVisitedEvent;
@@ -4678,8 +4451,6 @@ declare namespace chrome.i18n {
4678
4451
  export function getAcceptLanguages(): Promise<string[]>;
4679
4452
  /**
4680
4453
  * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage.
4681
- * @param callback The callback parameter should be a function that looks like this:
4682
- * function(array of string languages) {...};
4683
4454
  * Parameter languages: Array of the accept languages of the browser, such as en-US,en,zh-CN
4684
4455
  */
4685
4456
  export function getAcceptLanguages(callback: (languages: string[]) => void): void;
@@ -4703,7 +4474,6 @@ declare namespace chrome.i18n {
4703
4474
  export function detectLanguage(text: string): Promise<LanguageDetectionResult>;
4704
4475
  /** Detects the language of the provided text using CLD.
4705
4476
  * @param text User input string to be translated.
4706
- * @param callback The callback parameter should be a function that looks like this: function(object result) {...};
4707
4477
  */
4708
4478
  export function detectLanguage(text: string, callback: (result: LanguageDetectionResult) => void): void;
4709
4479
  }
@@ -4807,8 +4577,6 @@ declare namespace chrome.identity {
4807
4577
  * If `callback` is not provided, the function returns a Promise when the state has been cleared.
4808
4578
  * @since Chrome 87.
4809
4579
  * @param callback Called when the state has been cleared.
4810
- * The parameter should be a function that looks like this:
4811
- * () => {...};
4812
4580
  */
4813
4581
  export function clearAllCachedAuthTokens(): Promise<void>;
4814
4582
  export function clearAllCachedAuthTokens(callback: () => void): void;
@@ -4828,8 +4596,6 @@ declare namespace chrome.identity {
4828
4596
  * If `callback` is not provided, the function returns a Promise that resolves with the token.
4829
4597
  * @param details Token options.
4830
4598
  * @param callback Called with an OAuth2 access token as specified by the manifest, or undefined if there was an error.
4831
- * If you specify the callback parameter, it should be a function that looks like this:
4832
- * function(string token) {...};
4833
4599
  */
4834
4600
  export function getAuthToken(details: TokenDetails): Promise<GetAuthTokenResult>;
4835
4601
  export function getAuthToken(details: TokenDetails, callback: (token?: string, grantedScopes?: string[]) => void): void;
@@ -4853,8 +4619,6 @@ declare namespace chrome.identity {
4853
4619
  * If `callback` is not provided, the function returns a Promise when the state has been removed from the cache.
4854
4620
  * @param details Token information.
4855
4621
  * @param callback Called when the token has been removed from the cache.
4856
- * If you specify the callback parameter, it should be a function that looks like this:
4857
- * function() {...};
4858
4622
  */
4859
4623
  export function removeCachedAuthToken(details: TokenInformation): Promise<void>;
4860
4624
  export function removeCachedAuthToken(details: TokenInformation, callback: () => void): void;
@@ -4865,8 +4629,6 @@ declare namespace chrome.identity {
4865
4629
  * For a good user experience it is important interactive auth flows are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no context. In particular, do not launch an interactive auth flow when your app is first launched.
4866
4630
  * @param details WebAuth flow options.
4867
4631
  * @param callback Optional. Called with the URL redirected back to your application.
4868
- * The callback parameter should be a function that looks like this:
4869
- * function(string responseUrl) {...};
4870
4632
  */
4871
4633
  export function launchWebAuthFlow(details: WebAuthFlowOptions, callback: (responseUrl?: string) => void): void;
4872
4634
  export function launchWebAuthFlow(details: WebAuthFlowOptions): Promise<string | undefined>;
@@ -4902,8 +4664,6 @@ declare namespace chrome.idle {
4902
4664
  * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise.
4903
4665
  * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected.
4904
4666
  * Since Chrome 25.
4905
- * @param callback The callback parameter should be a function that looks like this:
4906
- * function( IdleState newState) {...};
4907
4667
  */
4908
4668
  export function queryState(detectionIntervalInSeconds: number, callback: (newState: IdleState) => void): void;
4909
4669
  /**
@@ -4914,8 +4674,6 @@ declare namespace chrome.idle {
4914
4674
  export function setDetectionInterval(intervalInSeconds: number): void;
4915
4675
  /**
4916
4676
  * Gets the time, in seconds, it takes until the screen is locked automatically while idle. Returns a zero duration if the screen is never locked automatically. Currently supported on Chrome OS only.
4917
- * @param callback The callback parameter should be a function that looks like this:
4918
- * function(integer delay) {...};
4919
4677
  * Parameter delay: Time, in seconds, until the screen is locked automatically while idle. This is zero if the screen never locks automatically.
4920
4678
  */
4921
4679
  export function getAutoLockDelay(callback: (delay: number) => void): void;
@@ -5249,44 +5007,32 @@ declare namespace chrome.input.ime {
5249
5007
 
5250
5008
  /**
5251
5009
  * Adds the provided menu items to the language menu when this IME is active.
5252
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5253
- * function() {...};
5254
5010
  */
5255
5011
  export function setMenuItems(parameters: ImeParameters, callback?: () => void): void;
5256
5012
  /**
5257
5013
  * Commits the provided text to the current input.
5258
5014
  * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.
5259
- * If you specify the callback parameter, it should be a function that looks like this:
5260
- * function(boolean success) {...};
5261
5015
  */
5262
5016
  export function commitText(parameters: CommitTextParameters, callback?: (success: boolean) => void): void;
5263
5017
  /**
5264
5018
  * Sets the current candidate list. This fails if this extension doesn't own the active IME
5265
5019
  * @param callback Called when the operation completes.
5266
- * If you specify the callback parameter, it should be a function that looks like this:
5267
- * function(boolean success) {...};
5268
5020
  */
5269
5021
  export function setCandidates(parameters: CandidatesParameters, callback?: (success: boolean) => void): void;
5270
5022
  /**
5271
5023
  * Set the current composition. If this extension does not own the active IME, this fails.
5272
5024
  * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.
5273
- * If you specify the callback parameter, it should be a function that looks like this:
5274
- * function(boolean success) {...};
5275
5025
  */
5276
5026
  export function setComposition(parameters: CompositionParameters, callback?: (success: boolean) => void): void;
5277
5027
  /**
5278
5028
  * Updates the state of the MenuItems specified
5279
5029
  * @param callback Called when the operation completes
5280
- * If you specify the callback parameter, it should be a function that looks like this:
5281
- * function() {...};
5282
5030
  */
5283
5031
  export function updateMenuItems(parameters: MenuItemParameters, callback?: () => void): void;
5284
5032
  /**
5285
5033
  * Shows/Hides an assistive window with the given properties.
5286
5034
  * @param parameters
5287
5035
  * @param callback Called when the operation completes.
5288
- * If you specify the callback parameter, it should be a function that looks like this:
5289
- * function(boolean success) {...};
5290
5036
  */
5291
5037
  export function setAssistiveWindowProperties(
5292
5038
  parameters: {
@@ -5299,8 +5045,6 @@ declare namespace chrome.input.ime {
5299
5045
  * Highlights/Unhighlights a button in an assistive window.
5300
5046
  * @param parameters
5301
5047
  * @param callback Called when the operation completes. On failure, chrome.runtime.lastError is set.
5302
- * If you specify the callback parameter, it should be a function that looks like this:
5303
- * function() {...};
5304
5048
  */
5305
5049
  export function setAssistiveWindowButtonHighlighted(
5306
5050
  parameters: {
@@ -5315,8 +5059,6 @@ declare namespace chrome.input.ime {
5315
5059
  /**
5316
5060
  * Sets the properties of the candidate window. This fails if the extension doesn't own the active IME
5317
5061
  * @param callback Called when the operation completes.
5318
- * If you specify the callback parameter, it should be a function that looks like this:
5319
- * function(boolean success) {...};
5320
5062
  */
5321
5063
  export function setCandidateWindowProperties(
5322
5064
  parameters: CandidateWindowParameter,
@@ -5325,8 +5067,6 @@ declare namespace chrome.input.ime {
5325
5067
  /**
5326
5068
  * Clear the current composition. If this extension does not own the active IME, this fails.
5327
5069
  * @param callback Called when the operation completes with a boolean indicating if the text was accepted or not. On failure, chrome.runtime.lastError is set.
5328
- * If you specify the callback parameter, it should be a function that looks like this:
5329
- * function(boolean success) {...};
5330
5070
  */
5331
5071
  export function clearComposition(
5332
5072
  parameters: ClearCompositionParameters,
@@ -5335,8 +5075,6 @@ declare namespace chrome.input.ime {
5335
5075
  /**
5336
5076
  * Set the position of the cursor in the candidate window. This is a no-op if this extension does not own the active IME.
5337
5077
  * @param callback Called when the operation completes
5338
- * If you specify the callback parameter, it should be a function that looks like this:
5339
- * function(boolean success) {...};
5340
5078
  */
5341
5079
  export function setCursorPosition(
5342
5080
  parameters: CursorPositionParameters,
@@ -5346,8 +5084,6 @@ declare namespace chrome.input.ime {
5346
5084
  * Sends the key events. This function is expected to be used by virtual keyboards. When key(s) on a virtual keyboard is pressed by a user, this function is used to propagate that event to the system.
5347
5085
  * @since Chrome 33.
5348
5086
  * @param callback Called when the operation completes.
5349
- * If you specify the callback parameter, it should be a function that looks like this:
5350
- * function() {...};
5351
5087
  */
5352
5088
  export function sendKeyEvents(parameters: SendKeyEventParameters, callback?: () => void): void;
5353
5089
  /**
@@ -5566,10 +5302,8 @@ declare namespace chrome.management {
5566
5302
  * Enables or disables an app or extension.
5567
5303
  * @param id This should be the id from an item of management.ExtensionInfo.
5568
5304
  * @param enabled Whether this item should be enabled or disabled.
5569
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5570
- * function() {...};
5571
5305
  */
5572
- export function setEnabled(id: string, enabled: boolean, callback?: () => void): void;
5306
+ export function setEnabled(id: string, enabled: boolean, callback: () => void): void;
5573
5307
  /**
5574
5308
  * Returns a list of permission warnings for the given extension id.
5575
5309
  * @since Chrome 15.
@@ -5581,10 +5315,8 @@ declare namespace chrome.management {
5581
5315
  * Returns a list of permission warnings for the given extension id.
5582
5316
  * @since Chrome 15.
5583
5317
  * @param id The ID of an already installed extension.
5584
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5585
- * function(array of string permissionWarnings) {...};
5586
5318
  */
5587
- export function getPermissionWarningsById(id: string, callback?: (permissionWarnings: string[]) => void): void;
5319
+ export function getPermissionWarningsById(id: string, callback: (permissionWarnings: string[]) => void): void;
5588
5320
  /**
5589
5321
  * Returns information about the installed extension, app, or theme that has the given ID.
5590
5322
  * @since Chrome 9.
@@ -5596,10 +5328,8 @@ declare namespace chrome.management {
5596
5328
  * Returns information about the installed extension, app, or theme that has the given ID.
5597
5329
  * @since Chrome 9.
5598
5330
  * @param id The ID from an item of management.ExtensionInfo.
5599
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5600
- * function( ExtensionInfo result) {...};
5601
5331
  */
5602
- export function get(id: string, callback?: (result: ExtensionInfo) => void): void;
5332
+ export function get(id: string, callback: (result: ExtensionInfo) => void): void;
5603
5333
  /**
5604
5334
  * Returns a list of information about installed extensions and apps.
5605
5335
  * @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
@@ -5607,10 +5337,8 @@ declare namespace chrome.management {
5607
5337
  export function getAll(): Promise<ExtensionInfo[]>;
5608
5338
  /**
5609
5339
  * Returns a list of information about installed extensions and apps.
5610
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5611
- * function(array of ExtensionInfo result) {...};
5612
5340
  */
5613
- export function getAll(callback?: (result: ExtensionInfo[]) => void): void;
5341
+ export function getAll(callback: (result: ExtensionInfo[]) => void): void;
5614
5342
  /**
5615
5343
  * Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest.
5616
5344
  * @since Chrome 15.
@@ -5624,12 +5352,10 @@ declare namespace chrome.management {
5624
5352
  * Returns a list of permission warnings for the given extension manifest string. Note: This function can be used without requesting the 'management' permission in the manifest.
5625
5353
  * @since Chrome 15.
5626
5354
  * @param manifestStr Extension manifest JSON string.
5627
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5628
- * function(array of string permissionWarnings) {...};
5629
5355
  */
5630
5356
  export function getPermissionWarningsByManifest(
5631
5357
  manifestStr: string,
5632
- callback?: (permissionwarnings: string[]) => void,
5358
+ callback: (permissionwarnings: string[]) => void,
5633
5359
  ): void;
5634
5360
  /**
5635
5361
  * Launches an application.
@@ -5640,10 +5366,8 @@ declare namespace chrome.management {
5640
5366
  /**
5641
5367
  * Launches an application.
5642
5368
  * @param id The extension id of the application.
5643
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5644
- * function() {...};
5645
5369
  */
5646
- export function launchApp(id: string, callback?: () => void): void;
5370
+ export function launchApp(id: string, callback: () => void): void;
5647
5371
  /**
5648
5372
  * Uninstalls a currently installed app or extension.
5649
5373
  * @since Chrome 21.
@@ -5655,10 +5379,9 @@ declare namespace chrome.management {
5655
5379
  * Uninstalls a currently installed app or extension.
5656
5380
  * @since Chrome 21.
5657
5381
  * @param id This should be the id from an item of management.ExtensionInfo.
5658
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5659
- * function() {...};
5660
5382
  */
5661
- export function uninstall(id: string, options?: UninstallOptions, callback?: () => void): void;
5383
+ export function uninstall(id: string, callback: () => void): void;
5384
+ export function uninstall(id: string, options: UninstallOptions, callback: () => void): void;
5662
5385
  /**
5663
5386
  * Uninstalls a currently installed app or extension.
5664
5387
  * @deprecated since Chrome 21. The options parameter was added to this function.
@@ -5670,10 +5393,8 @@ declare namespace chrome.management {
5670
5393
  * Uninstalls a currently installed app or extension.
5671
5394
  * @deprecated since Chrome 21. The options parameter was added to this function.
5672
5395
  * @param id This should be the id from an item of management.ExtensionInfo.
5673
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5674
- * function() {...};
5675
5396
  */
5676
- export function uninstall(id: string, callback?: () => void): void;
5397
+ export function uninstall(id: string, callback: () => void): void;
5677
5398
  /**
5678
5399
  * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest.
5679
5400
  * @since Chrome 39.
@@ -5683,10 +5404,8 @@ declare namespace chrome.management {
5683
5404
  /**
5684
5405
  * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest.
5685
5406
  * @since Chrome 39.
5686
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5687
- * function( ExtensionInfo result) {...};
5688
5407
  */
5689
- export function getSelf(callback?: (result: ExtensionInfo) => void): void;
5408
+ export function getSelf(callback: (result: ExtensionInfo) => void): void;
5690
5409
  /**
5691
5410
  * Uninstalls the calling extension.
5692
5411
  * Note: This function can be used without requesting the 'management' permission in the manifest.
@@ -5698,10 +5417,9 @@ declare namespace chrome.management {
5698
5417
  * Uninstalls the calling extension.
5699
5418
  * Note: This function can be used without requesting the 'management' permission in the manifest.
5700
5419
  * @since Chrome 26.
5701
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5702
- * function() {...};
5703
5420
  */
5704
- export function uninstallSelf(options?: UninstallOptions, callback?: () => void): void;
5421
+ export function uninstallSelf(callback: () => void): void;
5422
+ export function uninstallSelf(options: UninstallOptions, callback: () => void): void;
5705
5423
  /**
5706
5424
  * Uninstalls the calling extension.
5707
5425
  * Note: This function can be used without requesting the 'management' permission in the manifest.
@@ -5713,10 +5431,8 @@ declare namespace chrome.management {
5713
5431
  * Uninstalls the calling extension.
5714
5432
  * Note: This function can be used without requesting the 'management' permission in the manifest.
5715
5433
  * @since Chrome 26.
5716
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5717
- * function() {...};
5718
5434
  */
5719
- export function uninstallSelf(callback?: () => void): void;
5435
+ export function uninstallSelf(callback: () => void): void;
5720
5436
  /**
5721
5437
  * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created.
5722
5438
  * @since Chrome 37.
@@ -5726,10 +5442,8 @@ declare namespace chrome.management {
5726
5442
  /**
5727
5443
  * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created.
5728
5444
  * @since Chrome 37.
5729
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5730
- * function() {...};
5731
5445
  */
5732
- export function createAppShortcut(id: string, callback?: () => void): void;
5446
+ export function createAppShortcut(id: string, callback: () => void): void;
5733
5447
  /**
5734
5448
  * Set the launch type of an app.
5735
5449
  * @since Chrome 37.
@@ -5743,10 +5457,8 @@ declare namespace chrome.management {
5743
5457
  * @since Chrome 37.
5744
5458
  * @param id This should be the id from an app item of management.ExtensionInfo.
5745
5459
  * @param launchType The target launch type. Always check and make sure this launch type is in ExtensionInfo.availableLaunchTypes, because the available launch types vary on different platforms and configurations.
5746
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5747
- * function() {...};
5748
5460
  */
5749
- export function setLaunchType(id: string, launchType: string, callback?: () => void): void;
5461
+ export function setLaunchType(id: string, launchType: string, callback: () => void): void;
5750
5462
  /**
5751
5463
  * Generate an app for a URL. Returns the generated bookmark app.
5752
5464
  * @since Chrome 37.
@@ -5760,10 +5472,8 @@ declare namespace chrome.management {
5760
5472
  * @since Chrome 37.
5761
5473
  * @param url The URL of a web page. The scheme of the URL can only be "http" or "https".
5762
5474
  * @param title The title of the generated app.
5763
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5764
- * function( ExtensionInfo result) {...};
5765
5475
  */
5766
- export function generateAppForLink(url: string, title: string, callback?: (result: ExtensionInfo) => void): void;
5476
+ export function generateAppForLink(url: string, title: string, callback: (result: ExtensionInfo) => void): void;
5767
5477
 
5768
5478
  /** Fired when an app or extension has been disabled. */
5769
5479
  export var onDisabled: ManagementDisabledEvent;
@@ -5806,8 +5516,6 @@ declare namespace chrome.networking.config {
5806
5516
  * Allows an extension to define network filters for the networks it can handle. A call to this function will remove all filters previously installed by the extension before setting the new list.
5807
5517
  * @param networks Network filters to set. Every NetworkInfo must either have the SSID or HexSSID set. Other fields will be ignored.
5808
5518
  * @param callback Called back when this operation is finished.
5809
- * The callback parameter should be a function that looks like this:
5810
- * function() {...};
5811
5519
  */
5812
5520
  export function setNetworkFilter(networks: NetworkInfo[], callback: () => void): void;
5813
5521
  /**
@@ -5819,8 +5527,6 @@ declare namespace chrome.networking.config {
5819
5527
  * rejected: The extension handled this network, tried to authenticate, however was rejected by the server.
5820
5528
  * failed: The extension handled this network, tried to authenticate, however failed due to an unspecified error.
5821
5529
  * @param callback Called back when this operation is finished.
5822
- * If you specify the callback parameter, it should be a function that looks like this:
5823
- * function() {...};
5824
5530
  */
5825
5531
  export function finishAuthentication(GUID: string, result: string, callback?: () => void): void;
5826
5532
 
@@ -5962,8 +5668,6 @@ declare namespace chrome.notifications {
5962
5668
  * @param options Contents of the notification.
5963
5669
  * @param callback Returns the notification id (either supplied or generated) that represents the created notification.
5964
5670
  * The callback is required before Chrome 42.
5965
- * If you specify the callback parameter, it should be a function that looks like this:
5966
- * function(string notificationId) {...};
5967
5671
  */
5968
5672
  export function create(
5969
5673
  notificationId: string,
@@ -5977,8 +5681,6 @@ declare namespace chrome.notifications {
5977
5681
  * @param options Contents of the notification.
5978
5682
  * @param callback Returns the notification id (either supplied or generated) that represents the created notification.
5979
5683
  * The callback is required before Chrome 42.
5980
- * If you specify the callback parameter, it should be a function that looks like this:
5981
- * function(string notificationId) {...};
5982
5684
  */
5983
5685
  export function create(options: NotificationOptions<true>, callback?: (notificationId: string) => void): void;
5984
5686
  /**
@@ -5987,8 +5689,6 @@ declare namespace chrome.notifications {
5987
5689
  * @param options Contents of the notification to update to.
5988
5690
  * @param callback Called to indicate whether a matching notification existed.
5989
5691
  * The callback is required before Chrome 42.
5990
- * If you specify the callback parameter, it should be a function that looks like this:
5991
- * function(boolean wasUpdated) {...};
5992
5692
  */
5993
5693
  export function update(
5994
5694
  notificationId: string,
@@ -6000,24 +5700,18 @@ declare namespace chrome.notifications {
6000
5700
  * @param notificationId The id of the notification to be cleared. This is returned by notifications.create method.
6001
5701
  * @param callback Called to indicate whether a matching notification existed.
6002
5702
  * The callback is required before Chrome 42.
6003
- * If you specify the callback parameter, it should be a function that looks like this:
6004
- * function(boolean wasCleared) {...};
6005
5703
  */
6006
5704
  export function clear(notificationId: string, callback?: (wasCleared: boolean) => void): void;
6007
5705
  /**
6008
5706
  * Retrieves all the notifications.
6009
5707
  * @since Chrome 29.
6010
5708
  * @param callback Returns the set of notification_ids currently in the system.
6011
- * The callback parameter should be a function that looks like this:
6012
- * function(object notifications) {...};
6013
5709
  */
6014
5710
  export function getAll(callback: (notifications: Object) => void): void;
6015
5711
  /**
6016
5712
  * Retrieves whether the user has enabled notifications from this app or extension.
6017
5713
  * @since Chrome 32.
6018
5714
  * @param callback Returns the current permission level.
6019
- * The callback parameter should be a function that looks like this:
6020
- * function( PermissionLevel level) {...};
6021
5715
  */
6022
5716
  export function getPermissionLevel(callback: (level: string) => void): void;
6023
5717
  }
@@ -6239,21 +5933,15 @@ declare namespace chrome.pageAction {
6239
5933
  /**
6240
5934
  * Gets the title of the page action.
6241
5935
  * @since Chrome 19.
6242
- * @param callback The callback parameter should be a function that looks like this:
6243
- * function(string result) {...};
6244
5936
  */
6245
5937
  export function getTitle(details: GetDetails, callback: (result: string) => void): void;
6246
5938
  /**
6247
5939
  * Gets the html document set as the popup for this page action.
6248
5940
  * @since Chrome 19.
6249
- * @param callback The callback parameter should be a function that looks like this:
6250
- * function(string result) {...};
6251
5941
  */
6252
5942
  export function getPopup(details: GetDetails, callback: (result: string) => void): void;
6253
5943
  /**
6254
5944
  * Sets the icon for the page action. The icon can be specified either as the path to an image file or as the pixel data from a canvas element, or as dictionary of either one of those. Either the path or the imageData property must be specified.
6255
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
6256
- * function() {...};
6257
5945
  */
6258
5946
  export function setIcon(details: IconDetails, callback?: () => void): void;
6259
5947
 
@@ -6278,8 +5966,6 @@ declare namespace chrome.pageCapture {
6278
5966
  /**
6279
5967
  * Saves the content of the tab with given id as MHTML.
6280
5968
  * @param callback Called when the MHTML has been generated.
6281
- * The callback parameter should be a function that looks like this:
6282
- * function(binary mhtmlData) {...};
6283
5969
  * Parameter mhtmlData: The MHTML data as a Blob.
6284
5970
  */
6285
5971
  export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: Blob) => void): void;
@@ -6307,21 +5993,11 @@ declare namespace chrome.permissions {
6307
5993
  }
6308
5994
 
6309
5995
  export interface PermissionsRemovedEvent {
6310
- /**
6311
- * @param callback The callback parameter should be a function that looks like this:
6312
- * function( Permissions permissions) {...};
6313
- * Parameter permissions: The permissions that have been removed.
6314
- */
6315
- addListener(callback: (permissions: Permissions) => void): void;
5996
+ addListener(callback: (/** The permissions that have been removed*/ permissions: Permissions) => void): void;
6316
5997
  }
6317
5998
 
6318
5999
  export interface PermissionsAddedEvent {
6319
- /**
6320
- * @param callback The callback parameter should be a function that looks like this:
6321
- * function( Permissions permissions) {...};
6322
- * Parameter permissions: The newly acquired permissions.
6323
- */
6324
- addListener(callback: (permissions: Permissions) => void): void;
6000
+ addListener(callback: (/** The newly-acquired permissions*/ permissions: Permissions) => void): void;
6325
6001
  }
6326
6002
 
6327
6003
  /**
@@ -6331,8 +6007,6 @@ declare namespace chrome.permissions {
6331
6007
  export function contains(permissions: Permissions): Promise<boolean>;
6332
6008
  /**
6333
6009
  * Checks if the extension has the specified permissions.
6334
- * @param callback The callback parameter should be a function that looks like this:
6335
- * function(boolean result) {...};
6336
6010
  * Parameter result: True if the extension has the specified permissions.
6337
6011
  */
6338
6012
  export function contains(permissions: Permissions, callback: (result: boolean) => void): void;
@@ -6343,9 +6017,6 @@ declare namespace chrome.permissions {
6343
6017
  export function getAll(): Promise<Permissions>;
6344
6018
  /**
6345
6019
  * Gets the extension's current set of permissions.
6346
- * @param callback The callback parameter should be a function that looks like this:
6347
- * function( Permissions permissions) {...};
6348
- * Parameter permissions: The extension's active permissions.
6349
6020
  */
6350
6021
  export function getAll(callback: (permissions: Permissions) => void): void;
6351
6022
  /**
@@ -6355,8 +6026,6 @@ declare namespace chrome.permissions {
6355
6026
  export function request(permissions: Permissions): Promise<boolean>;
6356
6027
  /**
6357
6028
  * Requests access to the specified permissions. These permissions must be defined in the optional_permissions field of the manifest. If there are any problems requesting the permissions, runtime.lastError will be set.
6358
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
6359
- * function(boolean granted) {...};
6360
6029
  * Parameter granted: True if the user granted the specified permissions.
6361
6030
  */
6362
6031
  export function request(permissions: Permissions, callback?: (granted: boolean) => void): void;
@@ -6367,8 +6036,6 @@ declare namespace chrome.permissions {
6367
6036
  export function remove(permissions: Permissions): Promise<boolean>;
6368
6037
  /**
6369
6038
  * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set.
6370
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
6371
- * function(boolean removed) {...};
6372
6039
  * Parameter removed: True if the permissions were removed.
6373
6040
  */
6374
6041
  export function remove(permissions: Permissions, callback?: (removed: boolean) => void): void;
@@ -6434,8 +6101,6 @@ declare namespace chrome.platformKeys {
6434
6101
 
6435
6102
  /**
6436
6103
  * This function filters from a list of client certificates the ones that are known to the platform, match request and for which the extension has permission to access the certificate and its private key. If interactive is true, the user is presented a dialog where they can select from matching certificates and grant the extension access to the certificate. The selected/filtered client certificates will be passed to callback.
6437
- * @param callback The callback parameter should be a function that looks like this:
6438
- * function(array of Match matches) {...};
6439
6104
  * Parameter matches: The list of certificates that match the request, that the extension has permission for and, if interactive is true, that were selected by the user.
6440
6105
  */
6441
6106
  export function selectClientCertificates(
@@ -6447,8 +6112,6 @@ declare namespace chrome.platformKeys {
6447
6112
  * @param certificate The certificate of a Match returned by selectClientCertificates.
6448
6113
  * @param parameters Determines signature/hash algorithm parameters additionally to the parameters fixed by the key itself. The same parameters are accepted as by WebCrypto's importKey function, e.g. RsaHashedImportParams for a RSASSA-PKCS1-v1_5 key. For RSASSA-PKCS1-v1_5 keys, additionally the parameters { 'hash': { 'name': 'none' } } are supported. The sign function will then apply PKCS#1 v1.5 padding and but not hash the given data.
6449
6114
  * @param callback The public and private CryptoKey of a certificate which can only be used with platformKeys.subtleCrypto.
6450
- * The callback parameter should be a function that looks like this:
6451
- * function(object publicKey, object privateKey) {...};
6452
6115
  * Optional parameter privateKey: Might be null if this extension does not have access to it.
6453
6116
  */
6454
6117
  export function getKeyPair(
@@ -6462,8 +6125,6 @@ declare namespace chrome.platformKeys {
6462
6125
  * @param parameters Provides signature and hash algorithm parameters, in addition to those fixed by the key itself. The same parameters are accepted as by WebCrypto's importKey function, e.g. RsaHashedImportParams for a RSASSA-PKCS1-v1_5 key. For RSASSA-PKCS1-v1_5 keys, we need to also pass a "hash" parameter { "hash": { "name": string } }. The "hash" parameter represents the name of the hashing algorithm to be used in the digest operation before a sign. It is possible to pass "none" as the hash name, in which case the sign function will apply PKCS#1 v1.5 padding and but not hash the given data.
6463
6126
  * Currently, this function only supports the "RSASSA-PKCS1-v1_5" algorithm with one of the hashing algorithms "none", "SHA-1", "SHA-256", "SHA-384", and "SHA-512".
6464
6127
  * @param callback The public and private CryptoKey of a certificate which can only be used with platformKeys.subtleCrypto.
6465
- * The callback parameter should be a function that looks like this:
6466
- * function(object publicKey, object privateKey) {...};
6467
6128
  * Optional parameter privateKey: Might be null if this extension does not have access to it.
6468
6129
  * @since Chrome 85.
6469
6130
  */
@@ -6476,8 +6137,6 @@ declare namespace chrome.platformKeys {
6476
6137
  export function subtleCrypto(): SubtleCrypto;
6477
6138
  /**
6478
6139
  * Checks whether details.serverCertificateChain can be trusted for details.hostname according to the trust settings of the platform. Note: The actual behavior of the trust verification is not fully specified and might change in the future. The API implementation verifies certificate expiration, validates the certification path and checks trust by a known CA. The implementation is supposed to respect the EKU serverAuth and to support subject alternative names.
6479
- * @param callback The callback parameter should be a function that looks like this:
6480
- * function(object result) {...};
6481
6140
  */
6482
6141
  export function verifyTLSServerCertificate(
6483
6142
  details: ServerCertificateVerificationDetails,
@@ -6724,8 +6383,6 @@ declare namespace chrome.search {
6724
6383
  /**
6725
6384
  * Used to query the default search provider. In case of an error, runtime.lastError will be set.
6726
6385
  * @param options search configuration options.
6727
- * @param callback The callback parameter should be a function that looks like this:
6728
- * function() => {...}
6729
6386
  */
6730
6387
  export function query(options: QueryInfo, callback: () => void): void;
6731
6388
 
@@ -6836,8 +6493,6 @@ declare namespace chrome.serial {
6836
6493
  * @since Chrome 33.
6837
6494
  * @description Returns information about available serial devices on the system. The list is regenerated each time this method is called.
6838
6495
  * @param callback Called with the list of DeviceInfo objects.
6839
- * The callback parameter should be a function that looks like this:
6840
- * function(array of object ports) {...};
6841
6496
  */
6842
6497
  export function getDevices(callback: (ports: DeviceInfo[]) => void): void;
6843
6498
 
@@ -6847,8 +6502,6 @@ declare namespace chrome.serial {
6847
6502
  * @param path The system path of the serial port to open.
6848
6503
  * @param options Port configuration options.
6849
6504
  * @param callback Called when the connection has been opened.
6850
- * The callback parameter should be a function that looks like this:
6851
- * function( ConnectionInfo connectionInfo) {...};
6852
6505
  */
6853
6506
  export function connect(
6854
6507
  path: string,
@@ -6862,8 +6515,6 @@ declare namespace chrome.serial {
6862
6515
  * @param connectionId The id of the opened connection.
6863
6516
  * @param options Port configuration options.
6864
6517
  * @param callback Called when the configuation has completed.
6865
- * The callback parameter should be a function that looks like this:
6866
- * function(boolean result) {...};
6867
6518
  */
6868
6519
  export function update(connectionId: number, options: ConnectionOptions, callback: (result: boolean) => void): void;
6869
6520
 
@@ -6872,8 +6523,6 @@ declare namespace chrome.serial {
6872
6523
  * @description Disconnects from a serial port.
6873
6524
  * @param connectionId The id of the opened connection.
6874
6525
  * @param callback Called when the connection has been closed.
6875
- * The callback parameter should be a function that looks like this:
6876
- * function(boolean result) {...};
6877
6526
  */
6878
6527
  export function disconnect(connectionId: number, callback: (result: boolean) => void): void;
6879
6528
 
@@ -6883,8 +6532,6 @@ declare namespace chrome.serial {
6883
6532
  * @param connectionId The id of the opened connection.
6884
6533
  * @param paused Flag to indicate whether to pause or unpause.
6885
6534
  * @param callback Called when the connection has been successfully paused or unpaused.
6886
- * The callback parameter should be a function that looks like this:
6887
- * function() {...};
6888
6535
  */
6889
6536
  export function setPaused(connectionId: number, paused: boolean, callback: () => void): void;
6890
6537
 
@@ -6892,8 +6539,6 @@ declare namespace chrome.serial {
6892
6539
  * @since Chrome 33.
6893
6540
  * @description Retrieves the state of a given connection.
6894
6541
  * @param callback Called with connection state information when available.
6895
- * The callback parameter should be a function that looks like this:
6896
- * function( ConnectionInfo connectionInfo) {...};
6897
6542
  */
6898
6543
  export function getInfo(callback: (connectionInfos: ConnectionInfo[]) => void): void;
6899
6544
 
@@ -6901,8 +6546,6 @@ declare namespace chrome.serial {
6901
6546
  * @since Chrome 33.
6902
6547
  * @description Retrieves the list of currently opened serial port connections owned by the application.
6903
6548
  * @param callback Called with the list of connections when available.
6904
- * The callback parameter should be a function that looks like this:
6905
- * function(array of ConnectionInfo connectionInfos) {...};
6906
6549
  */
6907
6550
  export function getConnections(callback: (connectionInfos: ConnectionInfo[]) => void): void;
6908
6551
 
@@ -6912,8 +6555,6 @@ declare namespace chrome.serial {
6912
6555
  * @param connectionId The id of the connection.
6913
6556
  * @param data The data to send.
6914
6557
  * @param callback Called when the operation has completed.
6915
- * The callback parameter should be a function that looks like this:
6916
- * function(object sendInfo) {...};
6917
6558
  */
6918
6559
  export function send(connectionId: number, data: ArrayBuffer, callback: (sendInfo: object) => void): void;
6919
6560
 
@@ -6921,8 +6562,6 @@ declare namespace chrome.serial {
6921
6562
  * @description Flushes all bytes in the given connection's input and output buffers.
6922
6563
  * @param connectionId The id of the connection.
6923
6564
  * @param callback
6924
- * The callback parameter should be a function that looks like this:
6925
- * function(boolean result) {...};
6926
6565
  */
6927
6566
  export function flush(connectionId: number, callback: (result: boolean) => void): void;
6928
6567
 
@@ -6930,8 +6569,6 @@ declare namespace chrome.serial {
6930
6569
  * @description Retrieves the state of control signals on a given connection.
6931
6570
  * @param connectionId The id of the connection.
6932
6571
  * @param callback Called when the control signals are available.
6933
- * The callback parameter should be a function that looks like this:
6934
- * function(object signals) {...};
6935
6572
  */
6936
6573
  export function getControlSignals(connectionId: number, callback: (signals: object) => void): void;
6937
6574
 
@@ -6942,8 +6579,6 @@ declare namespace chrome.serial {
6942
6579
  * boolean: (optional) dtr - DTR (Data Terminal Ready).
6943
6580
  * boolean: (optional) rts - RTS (Request To Send).
6944
6581
  * @param callback Called once the control signals have been set.
6945
- * The callback parameter should be a function that looks like this:
6946
- * function(boolean result) {...};
6947
6582
  */
6948
6583
  export function setControlSignals(connectionId: number, signals: object, callback: (result: boolean) => void): void;
6949
6584
 
@@ -6952,8 +6587,6 @@ declare namespace chrome.serial {
6952
6587
  * @description Suspends character transmission on a given connection and places the transmission line in a break state until the clearBreak is called.
6953
6588
  * @param connectionId The id of the connection.
6954
6589
  * @param callback
6955
- * The callback parameter should be a function that looks like this:
6956
- * function(boolean result) {...};
6957
6590
  */
6958
6591
  export function setBreak(connectionId: number, callback: (result: boolean) => void): void;
6959
6592
 
@@ -6962,8 +6595,6 @@ declare namespace chrome.serial {
6962
6595
  * @description Restore character transmission on a given connection and place the transmission line in a nonbreak state.
6963
6596
  * @param connectionId The id of the connection.
6964
6597
  * @param callback
6965
- * The callback parameter should be a function that looks like this:
6966
- * function(boolean result) {...};
6967
6598
  */
6968
6599
  export function clearBreak(connectionId: number, callback: (result: boolean) => void): void;
6969
6600
  }
@@ -6980,8 +6611,6 @@ declare namespace chrome.serial.onReceive {
6980
6611
  * @since Chrome 33.
6981
6612
  * @description Event raised when data has been read from the connection.
6982
6613
  * @param callback
6983
- * The callback parameter should be a function that looks like this:
6984
- * function(OnReceiveInfo info) {...};
6985
6614
  */
6986
6615
  export function addListener(callback: (info: OnReceiveInfo) => void): void;
6987
6616
  }
@@ -7020,8 +6649,6 @@ declare namespace chrome.serial.onReceiveError {
7020
6649
  * @description Event raised when an error occurred while the runtime was waiting for data on the serial port.
7021
6650
  * Once this event is raised, the connection may be set to paused. A "timeout" error does not pause the connection.
7022
6651
  * @param callback
7023
- * The callback parameter should be a function that looks like this:
7024
- * function(OnReceiveErrorInfo info) {...};
7025
6652
  */
7026
6653
  export function addListener(callback: (info: OnReceiveErrorInfo) => void): void;
7027
6654
  }
@@ -7829,7 +7456,7 @@ declare namespace chrome.scripting {
7829
7456
  * @param callback
7830
7457
  * Invoked upon completion of the injection. The resulting array contains the result of execution for each frame where the injection succeeded.
7831
7458
  */
7832
- export function executeScript<Args extends any[], Result>(injection: ScriptInjection<Args, Result>, callback?: (results: InjectionResult<Awaited<Result>>[]) => void): void;
7459
+ export function executeScript<Args extends any[], Result>(injection: ScriptInjection<Args, Result>, callback: (results: InjectionResult<Awaited<Result>>[]) => void): void;
7833
7460
 
7834
7461
  /**
7835
7462
  * Inserts a CSS stylesheet into a target context. If multiple frames are specified, unsuccessful injections are ignored.
@@ -7846,7 +7473,7 @@ declare namespace chrome.scripting {
7846
7473
  * @param callback
7847
7474
  * Invoked upon completion of the injection.
7848
7475
  */
7849
- export function insertCSS(injection: CSSInjection, callback?: () => void): void;
7476
+ export function insertCSS(injection: CSSInjection, callback: () => void): void;
7850
7477
 
7851
7478
  /**
7852
7479
  * Removes a CSS stylesheet that was previously inserted by this extension from a target context.
@@ -7869,7 +7496,7 @@ declare namespace chrome.scripting {
7869
7496
  * Invoked upon completion of the removal.
7870
7497
  * @since Chrome 90
7871
7498
  */
7872
- export function removeCSS(injection: CSSInjection, callback?: () => void): void;
7499
+ export function removeCSS(injection: CSSInjection, callback: () => void): void;
7873
7500
 
7874
7501
  /**
7875
7502
  * Registers one or more content scripts.
@@ -7882,7 +7509,7 @@ declare namespace chrome.scripting {
7882
7509
  * @param scripts
7883
7510
  * @param callback
7884
7511
  */
7885
- export function registerContentScripts(scripts: RegisteredContentScript[], callback?: () => void): void;
7512
+ export function registerContentScripts(scripts: RegisteredContentScript[], callback: () => void): void;
7886
7513
 
7887
7514
  /**
7888
7515
  * Unregister one or more content scripts.
@@ -7896,7 +7523,8 @@ declare namespace chrome.scripting {
7896
7523
  * @param filter
7897
7524
  * @param callback
7898
7525
  */
7899
- export function unregisterContentScripts(filter?: ContentScriptFilter, callback?: () => void): void;
7526
+ export function unregisterContentScripts(callback: () => void): void;
7527
+ export function unregisterContentScripts(filter: ContentScriptFilter, callback: () => void): void;
7900
7528
 
7901
7529
  /**
7902
7530
  * Returns all the content scripts registered with scripting.registerContentScripts()
@@ -7911,7 +7539,8 @@ declare namespace chrome.scripting {
7911
7539
  * @param filter
7912
7540
  * @param callback
7913
7541
  */
7914
- export function getRegisteredContentScripts(filter?: ContentScriptFilter, callback?: (scripts: RegisteredContentScript[]) => void): void;
7542
+ export function getRegisteredContentScripts(callback: (scripts: RegisteredContentScript[]) => void): void;
7543
+ export function getRegisteredContentScripts(filter: ContentScriptFilter, callback: (scripts: RegisteredContentScript[]) => void): void;
7915
7544
  }
7916
7545
 
7917
7546
  ////////////////////
@@ -8062,7 +7691,7 @@ declare namespace chrome.storage {
8062
7691
  * @param callback Optional.
8063
7692
  * Callback on success, or on failure (in which case runtime.lastError will be set).
8064
7693
  */
8065
- clear(callback?: () => void): void;
7694
+ clear(callback: () => void): void;
8066
7695
  /**
8067
7696
  * Sets multiple items.
8068
7697
  * @param items An object which gives each key/value pair to update storage with. Any other key/value pairs in storage will not be affected.
@@ -8078,7 +7707,7 @@ declare namespace chrome.storage {
8078
7707
  * @param callback Optional.
8079
7708
  * Callback on success, or on failure (in which case runtime.lastError will be set).
8080
7709
  */
8081
- set(items: { [key: string]: any }, callback?: () => void): void;
7710
+ set(items: { [key: string]: any }, callback: () => void): void;
8082
7711
  /**
8083
7712
  * Removes one or more items from storage.
8084
7713
  * @param keys A single key or a list of keys for items to remove.
@@ -8093,7 +7722,7 @@ declare namespace chrome.storage {
8093
7722
  * @param callback Optional.
8094
7723
  * Callback on success, or on failure (in which case runtime.lastError will be set).
8095
7724
  */
8096
- remove(keys: string | string[], callback?: () => void): void;
7725
+ remove(keys: string | string[], callback: () => void): void;
8097
7726
  /**
8098
7727
  * Gets the entire contents of storage.
8099
7728
  * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set).
@@ -8836,7 +8465,7 @@ declare namespace chrome.system.display {
8836
8465
  * @param info The information about display properties that should be changed. A property will be changed only if a new value for it is specified in |info|.
8837
8466
  * @param [callback] Empty function called when the function finishes. To find out whether the function succeeded, runtime.lastError should be queried.
8838
8467
  */
8839
- export function setDisplayProperties(id: string, info: DisplayPropertiesInfo, callback?: () => void): void;
8468
+ export function setDisplayProperties(id: string, info: DisplayPropertiesInfo, callback: () => void): void;
8840
8469
 
8841
8470
  /**
8842
8471
  * requires(CrOS Kiosk apps | WebUI) This is only available to Chrome OS Kiosk apps and Web UI.
@@ -8862,7 +8491,7 @@ declare namespace chrome.system.display {
8862
8491
  * @param layouts The layout information, required for all displays except the primary display.
8863
8492
  * @param callback Empty function called when the function finishes. To find out whether the function succeeded, runtime.lastError should be queried.
8864
8493
  */
8865
- export function setDisplayLayout(layouts: DisplayLayout[], callback?: () => void): void;
8494
+ export function setDisplayLayout(layouts: DisplayLayout[], callback: () => void): void;
8866
8495
 
8867
8496
  /**
8868
8497
  * requires(CrOS Kiosk apps | WebUI) This is only available to Chrome OS Kiosk apps and Web UI.
@@ -9681,7 +9310,7 @@ declare namespace chrome.tabs {
9681
9310
  * @param callback Optional.
9682
9311
  * Parameter tab: Details about the created tab. Will contain the ID of the new tab.
9683
9312
  */
9684
- export function create(createProperties: CreateProperties, callback?: (tab: Tab) => void): void;
9313
+ export function create(createProperties: CreateProperties, callback: (tab: Tab) => void): void;
9685
9314
  /**
9686
9315
  * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows.
9687
9316
  * @param tabId The tab to move.
@@ -9694,7 +9323,7 @@ declare namespace chrome.tabs {
9694
9323
  * @param callback Optional.
9695
9324
  * Parameter tab: Details about the moved tab.
9696
9325
  */
9697
- export function move(tabId: number, moveProperties: MoveProperties, callback?: (tab: Tab) => void): void;
9326
+ export function move(tabId: number, moveProperties: MoveProperties, callback: (tab: Tab) => void): void;
9698
9327
  /**
9699
9328
  * Moves one or more tabs to a new position within its window, or to a new window. Note that tabs can only be moved to and from normal (window.type === "normal") windows.
9700
9329
  * @param tabIds The tabs to move.
@@ -9707,7 +9336,7 @@ declare namespace chrome.tabs {
9707
9336
  * @param callback Optional.
9708
9337
  * Parameter tabs: Details about the moved tabs.
9709
9338
  */
9710
- export function move(tabIds: number[], moveProperties: MoveProperties, callback?: (tabs: Tab[]) => void): void;
9339
+ export function move(tabIds: number[], moveProperties: MoveProperties, callback: (tabs: Tab[]) => void): void;
9711
9340
  /**
9712
9341
  * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
9713
9342
  * @return The `update` method provides its result via callback or returned as a `Promise` (MV3 only). Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
@@ -9718,7 +9347,7 @@ declare namespace chrome.tabs {
9718
9347
  * @param callback Optional.
9719
9348
  * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
9720
9349
  */
9721
- export function update(updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void;
9350
+ export function update(updateProperties: UpdateProperties, callback: (tab?: Tab) => void): void;
9722
9351
  /**
9723
9352
  * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
9724
9353
  * @param tabId Defaults to the selected tab of the current window.
@@ -9731,7 +9360,7 @@ declare namespace chrome.tabs {
9731
9360
  * @param callback Optional.
9732
9361
  * Optional parameter tab: Details about the updated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
9733
9362
  */
9734
- export function update(tabId: number, updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void;
9363
+ export function update(tabId: number, updateProperties: UpdateProperties, callback: (tab?: Tab) => void): void;
9735
9364
  /**
9736
9365
  * Closes a tab.
9737
9366
  * @param tabId The tab to close.
@@ -9742,7 +9371,7 @@ declare namespace chrome.tabs {
9742
9371
  * Closes a tab.
9743
9372
  * @param tabId The tab to close.
9744
9373
  */
9745
- export function remove(tabId: number, callback?: Function): void;
9374
+ export function remove(tabId: number, callback: Function): void;
9746
9375
  /**
9747
9376
  * Closes several tabs.
9748
9377
  * @param tabIds The list of tabs to close.
@@ -9753,7 +9382,7 @@ declare namespace chrome.tabs {
9753
9382
  * Closes several tabs.
9754
9383
  * @param tabIds The list of tabs to close.
9755
9384
  */
9756
- export function remove(tabIds: number[], callback?: Function): void;
9385
+ export function remove(tabIds: number[], callback: Function): void;
9757
9386
  /**
9758
9387
  * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
9759
9388
  * @param callback
@@ -9836,7 +9465,7 @@ declare namespace chrome.tabs {
9836
9465
  * Reload the selected tab of the current window.
9837
9466
  * @since Chrome 16.
9838
9467
  */
9839
- export function reload(reloadProperties: ReloadProperties, callback?: () => void): void;
9468
+ export function reload(reloadProperties: ReloadProperties, callback: () => void): void;
9840
9469
  /**
9841
9470
  * Reload the selected tab of the current window.
9842
9471
  * @since Chrome 16.
@@ -9847,7 +9476,7 @@ declare namespace chrome.tabs {
9847
9476
  * Reload the selected tab of the current window.
9848
9477
  * @since Chrome 16.
9849
9478
  */
9850
- export function reload(callback?: () => void): void;
9479
+ export function reload(callback: () => void): void;
9851
9480
  /**
9852
9481
  * Duplicates a tab.
9853
9482
  * @since Chrome 23.
@@ -9862,7 +9491,7 @@ declare namespace chrome.tabs {
9862
9491
  * @param callback Optional.
9863
9492
  * Optional parameter tab: Details about the duplicated tab. The tabs.Tab object doesn't contain url, title and favIconUrl if the "tabs" permission has not been requested.
9864
9493
  */
9865
- export function duplicate(tabId: number, callback?: (tab?: Tab) => void): void;
9494
+ export function duplicate(tabId: number, callback: (tab?: Tab) => void): void;
9866
9495
  /**
9867
9496
  * Sends a single message to the content script(s) in the specified tab, with an optional callback to run when a response is sent back. The runtime.onMessage event is fired in each content script running in the specified tab for the current extension.
9868
9497
  * @since Chrome 20.
@@ -9914,7 +9543,7 @@ declare namespace chrome.tabs {
9914
9543
  * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
9915
9544
  * @param callback Optional. Called when all the CSS has been inserted.
9916
9545
  */
9917
- export function insertCSS(details: InjectDetails, callback?: Function): void;
9546
+ export function insertCSS(details: InjectDetails, callback: Function): void;
9918
9547
  /**
9919
9548
  * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
9920
9549
  * @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
@@ -9928,7 +9557,7 @@ declare namespace chrome.tabs {
9928
9557
  * @param details Details of the script or CSS to inject. Either the code or the file property must be set, but both may not be set at the same time.
9929
9558
  * @param callback Optional. Called when all the CSS has been inserted.
9930
9559
  */
9931
- export function insertCSS(tabId: number, details: InjectDetails, callback?: Function): void;
9560
+ export function insertCSS(tabId: number, details: InjectDetails, callback: Function): void;
9932
9561
  /**
9933
9562
  * Highlights the given tabs.
9934
9563
  * @since Chrome 16.
@@ -9941,7 +9570,7 @@ declare namespace chrome.tabs {
9941
9570
  * @param callback Optional.
9942
9571
  * Parameter window: Contains details about the window whose tabs were highlighted.
9943
9572
  */
9944
- export function highlight(highlightInfo: HighlightInfo, callback?: (window: chrome.windows.Window) => void): void;
9573
+ export function highlight(highlightInfo: HighlightInfo, callback: (window: chrome.windows.Window) => void): void;
9945
9574
  /**
9946
9575
  * Gets all tabs that have the specified properties, or all tabs if no properties are specified.
9947
9576
  * @since Chrome 16.
@@ -9990,7 +9619,7 @@ declare namespace chrome.tabs {
9990
9619
  * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab.
9991
9620
  * @param callback Optional. Called after the zoom factor has been changed.
9992
9621
  */
9993
- export function setZoom(zoomFactor: number, callback?: () => void): void;
9622
+ export function setZoom(zoomFactor: number, callback: () => void): void;
9994
9623
  /**
9995
9624
  * Zooms a specified tab.
9996
9625
  * @since Chrome 42.
@@ -10006,7 +9635,7 @@ declare namespace chrome.tabs {
10006
9635
  * @param zoomFactor The new zoom factor. Use a value of 0 here to set the tab to its current default zoom factor. Values greater than zero specify a (possibly non-default) zoom factor for the tab.
10007
9636
  * @param callback Optional. Called after the zoom factor has been changed.
10008
9637
  */
10009
- export function setZoom(tabId: number, zoomFactor: number, callback?: () => void): void;
9638
+ export function setZoom(tabId: number, zoomFactor: number, callback: () => void): void;
10010
9639
  /**
10011
9640
  * Gets the current zoom factor of a specified tab.
10012
9641
  * @since Chrome 42.
@@ -10048,7 +9677,7 @@ declare namespace chrome.tabs {
10048
9677
  * @param zoomSettings Defines how zoom changes are handled and at what scope.
10049
9678
  * @param callback Optional. Called after the zoom settings have been changed.
10050
9679
  */
10051
- export function setZoomSettings(zoomSettings: ZoomSettings, callback?: () => void): void;
9680
+ export function setZoomSettings(zoomSettings: ZoomSettings, callback: () => void): void;
10052
9681
  /**
10053
9682
  * Sets the zoom settings for a specified tab, which define how zoom changes are handled. These settings are reset to defaults upon navigating the tab.
10054
9683
  * @since Chrome 42.
@@ -10064,7 +9693,7 @@ declare namespace chrome.tabs {
10064
9693
  * @param zoomSettings Defines how zoom changes are handled and at what scope.
10065
9694
  * @param callback Optional. Called after the zoom settings have been changed.
10066
9695
  */
10067
- export function setZoomSettings(tabId: number, zoomSettings: ZoomSettings, callback?: () => void): void;
9696
+ export function setZoomSettings(tabId: number, zoomSettings: ZoomSettings, callback: () => void): void;
10068
9697
  /**
10069
9698
  * Gets the current zoom settings of a specified tab.
10070
9699
  * @since Chrome 42.
@@ -10106,7 +9735,8 @@ declare namespace chrome.tabs {
10106
9735
  * @param tabId Optional. The ID of the tab to be discarded. If specified, the tab will be discarded unless it's active or already discarded. If omitted, the browser will discard the least important tab. This can fail if no discardable tabs exist.
10107
9736
  * @param callback Called after the operation is completed.
10108
9737
  */
10109
- export function discard(tabId?: number, callback?: (tab: Tab) => void): void;
9738
+ export function discard(callback: (tab: Tab) => void): void;
9739
+ export function discard(tabId: number, callback: (tab: Tab) => void): void;
10110
9740
  /**
10111
9741
  * Go foward to the next page, if one is available.
10112
9742
  * @since Chrome 72.
@@ -10118,7 +9748,7 @@ declare namespace chrome.tabs {
10118
9748
  * @since Chrome 72.
10119
9749
  * @param callback Optional. Called after the operation is completed.
10120
9750
  */
10121
- export function goForward(callback?: () => void): void;
9751
+ export function goForward(callback: () => void): void;
10122
9752
  /**
10123
9753
  * Go foward to the next page, if one is available.
10124
9754
  * @since Chrome 72.
@@ -10132,7 +9762,7 @@ declare namespace chrome.tabs {
10132
9762
  * @param tabId Optional. The ID of the tab to navigate forward; defaults to the selected tab of the current window.
10133
9763
  * @param callback Optional. Called after the operation is completed.
10134
9764
  */
10135
- export function goForward(tabId: number, callback?: () => void): void;
9765
+ export function goForward(tabId: number, callback: () => void): void;
10136
9766
  /**
10137
9767
  * Go back to the previous page, if one is available.
10138
9768
  * @since Chrome 72.
@@ -10144,7 +9774,7 @@ declare namespace chrome.tabs {
10144
9774
  * @since Chrome 72.
10145
9775
  * @param callback Optional. Called after the operation is completed.
10146
9776
  */
10147
- export function goBack(callback?: () => void): void;
9777
+ export function goBack(callback: () => void): void;
10148
9778
  /**
10149
9779
  * Go back to the previous page, if one is available.
10150
9780
  * @since Chrome 72.
@@ -10158,7 +9788,7 @@ declare namespace chrome.tabs {
10158
9788
  * @param tabId Optional. The ID of the tab to navigate back; defaults to the selected tab of the current window.
10159
9789
  * @param callback Optional. Called after the operation is completed.
10160
9790
  */
10161
- export function goBack(tabId: number, callback?: () => void): void;
9791
+ export function goBack(tabId: number, callback: () => void): void;
10162
9792
  /**
10163
9793
  * Adds one or more tabs to a specified group, or if no group is specified, adds the given tabs to a newly created group.
10164
9794
  * @since Chrome 88
@@ -10179,7 +9809,7 @@ declare namespace chrome.tabs {
10179
9809
  * @param options Configurations object
10180
9810
  * @param callback Optional.
10181
9811
  */
10182
- export function group(options: GroupOptions, callback?: (groupId: number) => void): void
9812
+ export function group(options: GroupOptions, callback: (groupId: number) => void): void
10183
9813
  /**
10184
9814
  * Removes one or more tabs from their respective groups. If any groups become empty, they are deleted
10185
9815
  * @since Chrome 88
@@ -10193,7 +9823,7 @@ declare namespace chrome.tabs {
10193
9823
  * @param tabIds The tabs to ungroup.
10194
9824
  * @param callback Optional. Called after the operation is completed.
10195
9825
  */
10196
- export function ungroup(tabIds: number | number[], callback?: () => void): void
9826
+ export function ungroup(tabIds: number | number[], callback: () => void): void
10197
9827
  /**
10198
9828
  * Fired when the highlighted or selected tabs in a window changes.
10199
9829
  * @since Chrome 18.
@@ -10334,7 +9964,7 @@ declare namespace chrome.tabGroups {
10334
9964
  * @param moveProperties Information on how to move the group.
10335
9965
  * @param callback Optional.
10336
9966
  */
10337
- export function move(groupId: number, moveProperties: MoveProperties, callback?: (group: TabGroup) => void): void;
9967
+ export function move(groupId: number, moveProperties: MoveProperties, callback: (group: TabGroup) => void): void;
10338
9968
 
10339
9969
  /**
10340
9970
  * Gets all groups that have the specified properties, or all groups if no properties are specified.
@@ -10364,7 +9994,7 @@ declare namespace chrome.tabGroups {
10364
9994
  * @param updateProperties Information on how to update the group.
10365
9995
  * @param callback Optional.
10366
9996
  */
10367
- export function update(groupId: number, updateProperties: UpdateProperties, callback?: (group: TabGroup) => void): void;
9997
+ export function update(groupId: number, updateProperties: UpdateProperties, callback: (group: TabGroup) => void): void;
10368
9998
 
10369
9999
  export interface TabGroupCreatedEvent extends chrome.events.Event<(group: TabGroup) => void> { }
10370
10000
  export interface TabGroupMovedEvent extends chrome.events.Event<(group: TabGroup) => void> { }
@@ -11634,7 +11264,7 @@ declare namespace chrome.windows {
11634
11264
  * @param callback
11635
11265
  * Optional parameter window: Contains details about the created window.
11636
11266
  */
11637
- export function create(callback?: (window?: chrome.windows.Window) => void): void;
11267
+ export function create(callback: (window?: chrome.windows.Window) => void): void;
11638
11268
  /**
11639
11269
  * Creates (opens) a new browser with any optional sizing, position or default URL provided.
11640
11270
  * @param CreateData
@@ -11647,7 +11277,7 @@ declare namespace chrome.windows {
11647
11277
  * @param callback
11648
11278
  * Optional parameter window: Contains details about the created window.
11649
11279
  */
11650
- export function create(createData: CreateData, callback?: (window?: chrome.windows.Window) => void): void;
11280
+ export function create(createData: CreateData, callback: (window?: chrome.windows.Window) => void): void;
11651
11281
  /**
11652
11282
  * Gets all windows.
11653
11283
  */
@@ -11680,7 +11310,7 @@ declare namespace chrome.windows {
11680
11310
  export function update(
11681
11311
  windowId: number,
11682
11312
  updateInfo: UpdateInfo,
11683
- callback?: (window: chrome.windows.Window) => void,
11313
+ callback: (window: chrome.windows.Window) => void,
11684
11314
  ): void;
11685
11315
  /**
11686
11316
  * Removes (closes) a window, and all the tabs inside it
@@ -11688,7 +11318,7 @@ declare namespace chrome.windows {
11688
11318
  */
11689
11319
  export function remove(windowId: number): Promise<void>;
11690
11320
  /** Removes (closes) a window, and all the tabs inside it. */
11691
- export function remove(windowId: number, callback?: Function): void;
11321
+ export function remove(windowId: number, callback: Function): void;
11692
11322
  /**
11693
11323
  * Gets the window that was most recently focused — typically the window 'on top'.
11694
11324
  */