@types/chrome 0.0.216 → 0.0.218

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 -621
  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,10 +296,8 @@ 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.
@@ -318,15 +305,7 @@ declare namespace chrome.action {
318
305
  * or as dictionary of either one of those. Either the path or the imageData property must be specified.
319
306
  * @return The `setIcon` method provides its result via callback or returned as a `Promise` (MV3 only). Since Chrome 96.
320
307
  */
321
- export function setIcon(details: TabIconDetails): Promise<void>;
322
-
323
- /**
324
- * Since Chrome 88.
325
- * 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,
326
- * or as dictionary of either one of those. Either the path or the imageData property must be specified.
327
- * @param callback The callback parameter should be a function that looks like this:
328
- * () => {...}
329
- */
308
+ export function setIcon(details: TabIconDetails): Promise<void>
330
309
  export function setIcon(details: TabIconDetails, callback: () => void): void;
331
310
 
332
311
  /**
@@ -339,10 +318,8 @@ declare namespace chrome.action {
339
318
  /**
340
319
  * Since Chrome 88.
341
320
  * Sets the html document to be opened as a popup when the user clicks on the action's icon.
342
- * @param callback The callback parameter should be a function that looks like this:
343
- * () => {...}
344
321
  */
345
- export function setPopup(details: PopupDetails, callback?: () => void): void;
322
+ export function setPopup(details: PopupDetails, callback: () => void): void;
346
323
 
347
324
  /**
348
325
  * Since Chrome 88.
@@ -354,10 +331,8 @@ declare namespace chrome.action {
354
331
  /**
355
332
  * Since Chrome 88.
356
333
  * Sets the title of the action. This shows up in the tooltip.
357
- * @param callback The callback parameter should be a function that looks like this:
358
- * () => {...}
359
334
  */
360
- export function setTitle(details: TitleDetails, callback?: () => void): void;
335
+ export function setTitle(details: TitleDetails, callback: () => void): void;
361
336
 
362
337
  /** Fired when an action icon is clicked. This event will not fire if the action has a popup. */
363
338
  export var onClicked: BrowserClickedEvent;
@@ -409,8 +384,6 @@ declare namespace chrome.alarms {
409
384
  export function create(name: string, alarmInfo: AlarmCreateInfo): void;
410
385
  /**
411
386
  * Gets an array of all the alarms.
412
- * @param callback The callback parameter should be a function that looks like this:
413
- * function(array of Alarm alarms) {...};
414
387
  */
415
388
  export function getAll(callback: (alarms: Alarm[]) => void): void;
416
389
  /**
@@ -426,10 +399,8 @@ declare namespace chrome.alarms {
426
399
  export function clearAll(): Promise<boolean>;
427
400
  /**
428
401
  * Clears all alarms.
429
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
430
- * function(boolean wasCleared) {...};
431
402
  */
432
- export function clearAll(callback?: (wasCleared: boolean) => void): void;
403
+ export function clearAll(callback: (wasCleared: boolean) => void): void;
433
404
  /**
434
405
  * Clears the alarm with the given name.
435
406
  * @param name The name of the alarm to clear. Defaults to the empty string.
@@ -439,14 +410,11 @@ declare namespace chrome.alarms {
439
410
  /**
440
411
  * Clears the alarm with the given name.
441
412
  * @param name The name of the alarm to clear. Defaults to the empty string.
442
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
443
- * function(boolean wasCleared) {...};
444
413
  */
445
- 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;
446
416
  /**
447
417
  * Clears the alarm without a name.
448
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
449
- * function(boolean wasCleared) {...};
450
418
  */
451
419
  export function clear(callback: (wasCleared: boolean) => void): void;
452
420
  /**
@@ -456,8 +424,6 @@ declare namespace chrome.alarms {
456
424
  export function clear(): Promise<void>;
457
425
  /**
458
426
  * Retrieves details about the specified alarm.
459
- * @param callback The callback parameter should be a function that looks like this:
460
- * function( Alarm alarm) {...};
461
427
  */
462
428
  export function get(callback: (alarm: Alarm) => void): void;
463
429
  /**
@@ -468,8 +434,6 @@ declare namespace chrome.alarms {
468
434
  /**
469
435
  * Retrieves details about the specified alarm.
470
436
  * @param name The name of the alarm to get. Defaults to the empty string.
471
- * @param callback The callback parameter should be a function that looks like this:
472
- * function( Alarm alarm) {...};
473
437
  */
474
438
  export function get(name: string, callback: (alarm: Alarm) => void): void;
475
439
  /**
@@ -622,8 +586,6 @@ declare namespace chrome.bookmarks {
622
586
  /**
623
587
  * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
624
588
  * @param query A string of words and quoted phrases that are matched against bookmark URLs and titles.
625
- * @param callback The callback parameter should be a function that looks like this:
626
- * function(array of BookmarkTreeNode results) {...};
627
589
  */
628
590
  export function search(query: string, callback: (results: BookmarkTreeNode[]) => void): void;
629
591
  /**
@@ -635,8 +597,6 @@ declare namespace chrome.bookmarks {
635
597
  /**
636
598
  * Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
637
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.
638
- * @param callback The callback parameter should be a function that looks like this:
639
- * function(array of BookmarkTreeNode results) {...};
640
600
  */
641
601
  export function search(query: BookmarkSearchQuery, callback: (results: BookmarkTreeNode[]) => void): void;
642
602
  /**
@@ -647,8 +607,6 @@ declare namespace chrome.bookmarks {
647
607
  export function search(query: BookmarkSearchQuery): Promise<BookmarkTreeNode[]>;
648
608
  /**
649
609
  * Retrieves the entire Bookmarks hierarchy.
650
- * @param callback The callback parameter should be a function that looks like this:
651
- * function(array of BookmarkTreeNode results) {...};
652
610
  */
653
611
  export function getTree(callback: (results: BookmarkTreeNode[]) => void): void;
654
612
  /**
@@ -659,8 +617,6 @@ declare namespace chrome.bookmarks {
659
617
  /**
660
618
  * Retrieves the recently added bookmarks.
661
619
  * @param numberOfItems The maximum number of items to return.
662
- * @param callback The callback parameter should be a function that looks like this:
663
- * function(array of BookmarkTreeNode results) {...};
664
620
  */
665
621
  export function getRecent(numberOfItems: number, callback: (results: BookmarkTreeNode[]) => void): void;
666
622
  /**
@@ -672,8 +628,6 @@ declare namespace chrome.bookmarks {
672
628
  /**
673
629
  * Retrieves the specified BookmarkTreeNode.
674
630
  * @param id A single string-valued id
675
- * @param callback The callback parameter should be a function that looks like this:
676
- * function(array of BookmarkTreeNode results) {...};
677
631
  */
678
632
  export function get(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
679
633
  /**
@@ -685,8 +639,6 @@ declare namespace chrome.bookmarks {
685
639
  /**
686
640
  * Retrieves the specified BookmarkTreeNode.
687
641
  * @param idList An array of string-valued ids
688
- * @param callback The callback parameter should be a function that looks like this:
689
- * function(array of BookmarkTreeNode results) {...};
690
642
  */
691
643
  export function get(idList: string[], callback: (results: BookmarkTreeNode[]) => void): void;
692
644
  /**
@@ -702,10 +654,8 @@ declare namespace chrome.bookmarks {
702
654
  export function create(bookmark: BookmarkCreateArg): Promise<BookmarkTreeNode>;
703
655
  /**
704
656
  * Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.
705
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
706
- * function( BookmarkTreeNode result) {...};
707
657
  */
708
- export function create(bookmark: BookmarkCreateArg, callback?: (result: BookmarkTreeNode) => void): void;
658
+ export function create(bookmark: BookmarkCreateArg, callback: (result: BookmarkTreeNode) => void): void;
709
659
  /**
710
660
  * Moves the specified BookmarkTreeNode to the provided location.
711
661
  * @return The `move` method provides its result via callback or returned as a `Promise` (MV3 only).
@@ -716,13 +666,11 @@ declare namespace chrome.bookmarks {
716
666
  ): Promise<BookmarkTreeNode>;
717
667
  /**
718
668
  * Moves the specified BookmarkTreeNode to the provided location.
719
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
720
- * function( BookmarkTreeNode result) {...};
721
669
  */
722
670
  export function move(
723
671
  id: string,
724
672
  destination: BookmarkDestinationArg,
725
- callback?: (result: BookmarkTreeNode) => void,
673
+ callback: (result: BookmarkTreeNode) => void,
726
674
  ): void;
727
675
  /**
728
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.
@@ -734,13 +682,11 @@ declare namespace chrome.bookmarks {
734
682
  ): Promise<BookmarkTreeNode>;
735
683
  /**
736
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.
737
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
738
- * function( BookmarkTreeNode result) {...};
739
685
  */
740
686
  export function update(
741
687
  id: string,
742
688
  changes: BookmarkChangesArg,
743
- callback?: (result: BookmarkTreeNode) => void,
689
+ callback: (result: BookmarkTreeNode) => void,
744
690
  ): void;
745
691
  /**
746
692
  * Removes a bookmark or an empty bookmark folder.
@@ -749,14 +695,10 @@ declare namespace chrome.bookmarks {
749
695
  export function remove(id: string): Promise<void>;
750
696
  /**
751
697
  * Removes a bookmark or an empty bookmark folder.
752
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
753
- * function() {...};
754
698
  */
755
- export function remove(id: string, callback?: Function): void;
699
+ export function remove(id: string, callback: Function): void;
756
700
  /**
757
701
  * Retrieves the children of the specified BookmarkTreeNode id.
758
- * @param callback The callback parameter should be a function that looks like this:
759
- * function(array of BookmarkTreeNode results) {...};
760
702
  */
761
703
  export function getChildren(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
762
704
  /**
@@ -768,8 +710,6 @@ declare namespace chrome.bookmarks {
768
710
  * Since Chrome 14.
769
711
  * Retrieves part of the Bookmarks hierarchy, starting at the specified node.
770
712
  * @param id The ID of the root of the subtree to retrieve.
771
- * @param callback The callback parameter should be a function that looks like this:
772
- * function(array of BookmarkTreeNode results) {...};
773
713
  */
774
714
  export function getSubTree(id: string, callback: (results: BookmarkTreeNode[]) => void): void;
775
715
  /**
@@ -786,10 +726,8 @@ declare namespace chrome.bookmarks {
786
726
  export function removeTree(id: string): Promise<void>;
787
727
  /**
788
728
  * Recursively removes a bookmark folder.
789
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
790
- * function() {...};
791
729
  */
792
- export function removeTree(id: string, callback?: Function): void;
730
+ export function removeTree(id: string, callback: Function): void;
793
731
 
794
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. */
795
733
  export var onRemoved: BookmarkRemovedEvent;
@@ -875,7 +813,8 @@ declare namespace chrome.browserAction {
875
813
  * @param tabId The id of the tab for which you want to modify the browser action.
876
814
  * @param callback Supported since Chrome 67
877
815
  */
878
- export function enable(tabId?: number, callback?: () => void): void;
816
+ export function enable(callback: () => void): void;
817
+ export function enable(tabId: number, callback: () => void): void;
879
818
  /**
880
819
  * Sets the background color for the badge.
881
820
  * @return The `setBadgeBackgroundColor` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -885,7 +824,7 @@ declare namespace chrome.browserAction {
885
824
  * Sets the background color for the badge.
886
825
  * @param callback Supported since Chrome 67
887
826
  */
888
- export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails, callback?: () => void): void;
827
+ export function setBadgeBackgroundColor(details: BadgeBackgroundColorDetails, callback: () => void): void;
889
828
  /**
890
829
  * Sets the badge text for the browser action. The badge is displayed on top of the icon.
891
830
  * @return The `setBadgeText` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -895,7 +834,7 @@ declare namespace chrome.browserAction {
895
834
  * Sets the badge text for the browser action. The badge is displayed on top of the icon.
896
835
  * @param callback Supported since Chrome 67
897
836
  */
898
- export function setBadgeText(details: BadgeTextDetails, callback?: () => void): void;
837
+ export function setBadgeText(details: BadgeTextDetails, callback: () => void): void;
899
838
  /**
900
839
  * Sets the title of the browser action. This shows up in the tooltip.
901
840
  * @return The `setTitle` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -905,7 +844,7 @@ declare namespace chrome.browserAction {
905
844
  * Sets the title of the browser action. This shows up in the tooltip.
906
845
  * @param callback Supported since Chrome 67
907
846
  */
908
- export function setTitle(details: TitleDetails, callback?: () => void): void;
847
+ export function setTitle(details: TitleDetails, callback: () => void): void;
909
848
  /**
910
849
  * Since Chrome 19.
911
850
  * Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned.
@@ -927,7 +866,7 @@ declare namespace chrome.browserAction {
927
866
  * Sets the html document to be opened as a popup when the user clicks on the browser action's icon.
928
867
  * @param callback Supported since Chrome 67
929
868
  */
930
- export function setPopup(details: PopupDetails, callback?: () => void): void;
869
+ export function setPopup(details: PopupDetails, callback: () => void): void;
931
870
  /**
932
871
  * Since Chrome 22.
933
872
  * Disables the browser action for a tab.
@@ -941,12 +880,11 @@ declare namespace chrome.browserAction {
941
880
  * @param tabId The id of the tab for which you want to modify the browser action.
942
881
  * @param callback Supported since Chrome 67
943
882
  */
944
- export function disable(tabId?: number, callback?: () => void): void;
883
+ export function disable(callback: () => void): void;
884
+ export function disable(tabId: number, callback: () => void): void;
945
885
  /**
946
886
  * Since Chrome 19.
947
887
  * Gets the title of the browser action.
948
- * @param callback The callback parameter should be a function that looks like this:
949
- * function(string result) {...};
950
888
  */
951
889
  export function getTitle(details: TabDetails, callback: (result: string) => void): void;
952
890
  /**
@@ -958,8 +896,6 @@ declare namespace chrome.browserAction {
958
896
  /**
959
897
  * Since Chrome 19.
960
898
  * Gets the background color of the browser action.
961
- * @param callback The callback parameter should be a function that looks like this:
962
- * function( ColorArray result) {...};
963
899
  */
964
900
  export function getBadgeBackgroundColor(details: TabDetails, callback: (result: ColorArray) => void): void;
965
901
  /**
@@ -971,8 +907,6 @@ declare namespace chrome.browserAction {
971
907
  /**
972
908
  * Since Chrome 19.
973
909
  * Gets the html document set as the popup for this browser action.
974
- * @param callback The callback parameter should be a function that looks like this:
975
- * function(string result) {...};
976
910
  */
977
911
  export function getPopup(details: TabDetails, callback: (result: string) => void): void;
978
912
  /**
@@ -983,10 +917,8 @@ declare namespace chrome.browserAction {
983
917
  export function getPopup(details: TabDetails): Promise<string>;
984
918
  /**
985
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.
986
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
987
- * function() {...};
988
920
  */
989
- export function setIcon(details: TabIconDetails, callback?: Function): void;
921
+ export function setIcon(details: TabIconDetails, callback: Function): void;
990
922
 
991
923
  /** Fired when a browser action icon is clicked. This event will not fire if the browser action has a popup. */
992
924
  export var onClicked: BrowserClickedEvent;
@@ -1102,8 +1034,6 @@ declare namespace chrome.browsingData {
1102
1034
  /**
1103
1035
  * Since Chrome 26.
1104
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.
1105
- * @param callback The callback parameter should be a function that looks like this:
1106
- * function(object result) {...};
1107
1037
  */
1108
1038
  export function settings(callback: (result: SettingsResult) => void): void;
1109
1039
  /**
@@ -1120,10 +1050,8 @@ declare namespace chrome.browsingData {
1120
1050
  *
1121
1051
  * Clears plugins' data.
1122
1052
  * @param callback Called when plugins' data has been cleared.
1123
- * If you specify the callback parameter, it should be a function that looks like this:
1124
- * function() {...};
1125
1053
  */
1126
- export function removePluginData(options: RemovalOptions, callback?: () => void): void;
1054
+ export function removePluginData(options: RemovalOptions, callback: () => void): void;
1127
1055
  /**
1128
1056
  * Since Chrome 72.
1129
1057
  * Clears websites' service workers.
@@ -1134,10 +1062,8 @@ declare namespace chrome.browsingData {
1134
1062
  * Since Chrome 72.
1135
1063
  * Clears websites' service workers.
1136
1064
  * @param callback Called when the browser's service workers have been cleared.
1137
- * If you specify the callback parameter, it should be a function that looks like this:
1138
- * function() {...};
1139
1065
  */
1140
- export function removeServiceWorkers(options: RemovalOptions, callback?: () => void): void;
1066
+ export function removeServiceWorkers(options: RemovalOptions, callback: () => void): void;
1141
1067
  /**
1142
1068
  * Clears the browser's stored form data (autofill).
1143
1069
  * @return The `removeFormData` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1146,10 +1072,8 @@ declare namespace chrome.browsingData {
1146
1072
  /**
1147
1073
  * Clears the browser's stored form data (autofill).
1148
1074
  * @param callback Called when the browser's form data has been cleared.
1149
- * If you specify the callback parameter, it should be a function that looks like this:
1150
- * function() {...};
1151
1075
  */
1152
- export function removeFormData(options: RemovalOptions, callback?: () => void): void;
1076
+ export function removeFormData(options: RemovalOptions, callback: () => void): void;
1153
1077
  /**
1154
1078
  * Clears websites' file system data.
1155
1079
  * @return The `removeFileSystems` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1158,10 +1082,8 @@ declare namespace chrome.browsingData {
1158
1082
  /**
1159
1083
  * Clears websites' file system data.
1160
1084
  * @param callback Called when websites' file systems have been cleared.
1161
- * If you specify the callback parameter, it should be a function that looks like this:
1162
- * function() {...};
1163
1085
  */
1164
- export function removeFileSystems(options: RemovalOptions, callback?: () => void): void;
1086
+ export function removeFileSystems(options: RemovalOptions, callback: () => void): void;
1165
1087
  /**
1166
1088
  * Clears various types of browsing data stored in a user's profile.
1167
1089
  * @param dataToRemove The set of data types to remove.
@@ -1172,10 +1094,8 @@ declare namespace chrome.browsingData {
1172
1094
  * Clears various types of browsing data stored in a user's profile.
1173
1095
  * @param dataToRemove The set of data types to remove.
1174
1096
  * @param callback Called when deletion has completed.
1175
- * If you specify the callback parameter, it should be a function that looks like this:
1176
- * function() {...};
1177
1097
  */
1178
- export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback?: () => void): void;
1098
+ export function remove(options: RemovalOptions, dataToRemove: DataTypeSet, callback: () => void): void;
1179
1099
  /**
1180
1100
  * Clears the browser's stored passwords.
1181
1101
  * @return The `removePasswords` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1184,22 +1104,18 @@ declare namespace chrome.browsingData {
1184
1104
  /**
1185
1105
  * Clears the browser's stored passwords.
1186
1106
  * @param callback Called when the browser's passwords have been cleared.
1187
- * If you specify the callback parameter, it should be a function that looks like this:
1188
- * function() {...};
1189
1107
  */
1190
- export function removePasswords(options: RemovalOptions, callback?: () => void): void;
1108
+ export function removePasswords(options: RemovalOptions, callback: () => void): void;
1191
1109
  /**
1192
1110
  * Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
1193
1111
  * @return The `removeCookies` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1194
1112
  */
1195
- export function removeCookies(options: RemovalOptions, callback?: () => void): Promise<void>;
1113
+ export function removeCookies(options: RemovalOptions): Promise<void>;
1196
1114
  /**
1197
1115
  * Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
1198
1116
  * @param callback Called when the browser's cookies and server-bound certificates have been cleared.
1199
- * If you specify the callback parameter, it should be a function that looks like this:
1200
- * function() {...};
1201
1117
  */
1202
- export function removeCookies(options: RemovalOptions, callback?: () => void): void;
1118
+ export function removeCookies(options: RemovalOptions, callback: () => void): void;
1203
1119
  /**
1204
1120
  * Clears websites' WebSQL data.
1205
1121
  * @return The `removeWebSQL` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1208,10 +1124,8 @@ declare namespace chrome.browsingData {
1208
1124
  /**
1209
1125
  * Clears websites' WebSQL data.
1210
1126
  * @param callback Called when websites' WebSQL databases have been cleared.
1211
- * If you specify the callback parameter, it should be a function that looks like this:
1212
- * function() {...};
1213
1127
  */
1214
- export function removeWebSQL(options: RemovalOptions, callback?: () => void): void;
1128
+ export function removeWebSQL(options: RemovalOptions, callback: () => void): void;
1215
1129
  /**
1216
1130
  * Clears websites' appcache data.
1217
1131
  * @return The `removeAppcache` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1220,20 +1134,16 @@ declare namespace chrome.browsingData {
1220
1134
  /**
1221
1135
  * Clears websites' appcache data.
1222
1136
  * @param callback Called when websites' appcache data has been cleared.
1223
- * If you specify the callback parameter, it should be a function that looks like this:
1224
- * function() {...};
1225
1137
  */
1226
- export function removeAppcache(options: RemovalOptions, callback?: () => void): void;
1138
+ export function removeAppcache(options: RemovalOptions, callback: () => void): void;
1227
1139
  /** Clears websites' cache storage data.
1228
1140
  * @return The `removeCacheStorage` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
1229
1141
  */
1230
1142
  export function removeCacheStorage(options: RemovalOptions): Promise<void>
1231
1143
  /** Clears websites' cache storage data.
1232
1144
  * @param callback Called when websites' appcache data has been cleared.
1233
- * If you specify the callback parameter, it should be a function that looks like this:
1234
- * function() {...};
1235
1145
  */
1236
- export function removeCacheStorage(options: RemovalOptions, callback?: () => void): void
1146
+ export function removeCacheStorage(options: RemovalOptions, callback: () => void): void
1237
1147
  /**
1238
1148
  * Clears the browser's list of downloaded files (not the downloaded files themselves).
1239
1149
  * @return The `removeDownloads` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1242,10 +1152,8 @@ declare namespace chrome.browsingData {
1242
1152
  /**
1243
1153
  * Clears the browser's list of downloaded files (not the downloaded files themselves).
1244
1154
  * @param callback Called when the browser's list of downloaded files has been cleared.
1245
- * If you specify the callback parameter, it should be a function that looks like this:
1246
- * function() {...};
1247
1155
  */
1248
- export function removeDownloads(options: RemovalOptions, callback?: () => void): void;
1156
+ export function removeDownloads(options: RemovalOptions, callback: () => void): void;
1249
1157
  /**
1250
1158
  * Clears websites' local storage data.
1251
1159
  * @return The `removeLocalStorage` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1254,10 +1162,8 @@ declare namespace chrome.browsingData {
1254
1162
  /**
1255
1163
  * Clears websites' local storage data.
1256
1164
  * @param callback Called when websites' local storage has been cleared.
1257
- * If you specify the callback parameter, it should be a function that looks like this:
1258
- * function() {...};
1259
1165
  */
1260
- export function removeLocalStorage(options: RemovalOptions, callback?: () => void): void;
1166
+ export function removeLocalStorage(options: RemovalOptions, callback: () => void): void;
1261
1167
  /**
1262
1168
  * Clears the browser's cache.
1263
1169
  * @return The `removeCache` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1266,10 +1172,8 @@ declare namespace chrome.browsingData {
1266
1172
  /**
1267
1173
  * Clears the browser's cache.
1268
1174
  * @param callback Called when the browser's cache has been cleared.
1269
- * If you specify the callback parameter, it should be a function that looks like this:
1270
- * function() {...};
1271
1175
  */
1272
- export function removeCache(options: RemovalOptions, callback?: () => void): void;
1176
+ export function removeCache(options: RemovalOptions, callback: () => void): void;
1273
1177
  /**
1274
1178
  * Clears the browser's history.
1275
1179
  * @return The `removeHistory` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1278,10 +1182,8 @@ declare namespace chrome.browsingData {
1278
1182
  /**
1279
1183
  * Clears the browser's history.
1280
1184
  * @param callback Called when the browser's history has cleared.
1281
- * If you specify the callback parameter, it should be a function that looks like this:
1282
- * function() {...};
1283
1185
  */
1284
- export function removeHistory(options: RemovalOptions, callback?: () => void): void;
1186
+ export function removeHistory(options: RemovalOptions, callback: () => void): void;
1285
1187
  /**
1286
1188
  * Clears websites' IndexedDB data.
1287
1189
  * @return The `removeIndexedDB` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -1290,10 +1192,8 @@ declare namespace chrome.browsingData {
1290
1192
  /**
1291
1193
  * Clears websites' IndexedDB data.
1292
1194
  * @param callback Called when websites' IndexedDB data has been cleared.
1293
- * If you specify the callback parameter, it should be a function that looks like this:
1294
- * function() {...};
1295
1195
  */
1296
- export function removeIndexedDB(options: RemovalOptions, callback?: () => void): void;
1196
+ export function removeIndexedDB(options: RemovalOptions, callback: () => void): void;
1297
1197
  }
1298
1198
 
1299
1199
  ////////////////////
@@ -1324,8 +1224,6 @@ declare namespace chrome.commands {
1324
1224
  /**
1325
1225
  * Returns all the registered extension commands for this extension and their shortcut (if active).
1326
1226
  * @param callback Called to return the registered commands.
1327
- * If you specify the callback parameter, it should be a function that looks like this:
1328
- * function(array of Command commands) {...};
1329
1227
  */
1330
1228
  export function getAll(callback: (commands: Command[]) => void): void;
1331
1229
 
@@ -1441,26 +1339,22 @@ declare namespace chrome.contentSettings {
1441
1339
  export interface ContentSetting {
1442
1340
  /**
1443
1341
  * Clear all content setting rules set by this extension.
1444
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
1445
- * function() {...};
1446
1342
  */
1447
1343
  clear(details: ClearDetails, callback?: () => void): void;
1448
1344
  /**
1449
1345
  * Applies a new content setting rule.
1450
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
1451
- * function() {...};
1452
1346
  */
1453
1347
  set(details: SetDetails, callback?: () => void): void;
1454
- /**
1455
- * @param callback The callback parameter should be a function that looks like this:
1456
- * function(array of ResourceIdentifier resourceIdentifiers) {...};
1457
- * Parameter resourceIdentifiers: A list of resource identifiers for this content type, or undefined if this content type does not use resource identifiers.
1458
- */
1459
- 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;
1460
1356
  /**
1461
1357
  * Gets the current content setting for a given pair of URLs.
1462
- * @param callback The callback parameter should be a function that looks like this:
1463
- * function(object details) {...};
1464
1358
  */
1465
1359
  get(details: GetDetails, callback: (details: ReturnedDetails) => void): void;
1466
1360
  }
@@ -1821,8 +1715,6 @@ declare namespace chrome.contextMenus {
1821
1715
  /**
1822
1716
  * Removes all context menu items added by this extension.
1823
1717
  * @param callback Called when removal is complete.
1824
- * If you specify the callback parameter, it should be a function that looks like this:
1825
- * function() {...};
1826
1718
  */
1827
1719
  export function removeAll(callback?: () => void): void;
1828
1720
  /**
@@ -1836,35 +1728,14 @@ declare namespace chrome.contextMenus {
1836
1728
  * @param id The ID of the item to update.
1837
1729
  * @param updateProperties The properties to update. Accepts the same values as the create function.
1838
1730
  * @param callback Called when the context menu has been updated.
1839
- * If you specify the callback parameter, it should be a function that looks like this:
1840
- * function() {...};
1841
- */
1842
- export function update(id: string, updateProperties: UpdateProperties, callback?: () => void): void;
1843
- /**
1844
- * Updates a previously created context menu item.
1845
- * @param id The ID of the item to update.
1846
- * @param updateProperties The properties to update. Accepts the same values as the create function.
1847
- * @param callback Called when the context menu has been updated.
1848
- * If you specify the callback parameter, it should be a function that looks like this:
1849
- * function() {...};
1850
- */
1851
- export function update(id: number, updateProperties: UpdateProperties, callback?: () => void): void;
1852
- /**
1853
- * Removes a context menu item.
1854
- * @param menuItemId The ID of the context menu item to remove.
1855
- * @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
1731
  */
1859
- export function remove(menuItemId: string, callback?: () => void): void;
1732
+ export function update(id: string | number, updateProperties: UpdateProperties, callback?: () => void): void;
1860
1733
  /**
1861
1734
  * Removes a context menu item.
1862
1735
  * @param menuItemId The ID of the context menu item to remove.
1863
1736
  * @param callback Called when the context menu has been removed.
1864
- * If you specify the callback parameter, it should be a function that looks like this:
1865
- * function() {...};
1866
1737
  */
1867
- export function remove(menuItemId: number, callback?: () => void): void;
1738
+ export function remove(menuItemId: string | number, callback?: () => void): void;
1868
1739
 
1869
1740
  /**
1870
1741
  * Since Chrome 21.
@@ -1987,8 +1858,6 @@ declare namespace chrome.cookies {
1987
1858
 
1988
1859
  /**
1989
1860
  * Lists all existing cookie stores.
1990
- * @param callback The callback parameter should be a function that looks like this:
1991
- * function(array of CookieStore cookieStores) {...};
1992
1861
  * Parameter cookieStores: All the existing cookie stores.
1993
1862
  */
1994
1863
  export function getAllCookieStores(callback: (cookieStores: CookieStore[]) => void): void;
@@ -2000,8 +1869,6 @@ declare namespace chrome.cookies {
2000
1869
  /**
2001
1870
  * 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.
2002
1871
  * @param details Information to filter the cookies being retrieved.
2003
- * @param callback The callback parameter should be a function that looks like this:
2004
- * function(array of Cookie cookies) {...};
2005
1872
  * Parameter cookies: All the existing, unexpired cookies that match the given cookie info.
2006
1873
  */
2007
1874
  export function getAll(details: GetAllDetails, callback: (cookies: Cookie[]) => void): void;
@@ -2020,11 +1887,9 @@ declare namespace chrome.cookies {
2020
1887
  /**
2021
1888
  * Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
2022
1889
  * @param details Details about the cookie being set.
2023
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
2024
- * function( Cookie cookie) {...};
2025
1890
  * 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.
2026
1891
  */
2027
- export function set(details: SetDetails, callback?: (cookie: Cookie | null) => void): void;
1892
+ export function set(details: SetDetails, callback: (cookie: Cookie | null) => void): void;
2028
1893
  /**
2029
1894
  * Deletes a cookie by name.
2030
1895
  * @param details Information to identify the cookie to remove.
@@ -2034,15 +1899,11 @@ declare namespace chrome.cookies {
2034
1899
  /**
2035
1900
  * Deletes a cookie by name.
2036
1901
  * @param details Information to identify the cookie to remove.
2037
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
2038
- * function(object details) {...};
2039
1902
  */
2040
1903
  export function remove(details: Details, callback?: (details: Details) => void): void;
2041
1904
  /**
2042
1905
  * 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.
2043
1906
  * @param details Details to identify the cookie being retrieved.
2044
- * @param callback The callback parameter should be a function that looks like this:
2045
- * function( Cookie cookie) {...};
2046
1907
  * Parameter cookie: Contains details about the cookie. This parameter is null if no such cookie was found.
2047
1908
  */
2048
1909
  export function get(details: Details, callback: (cookie: Cookie | null) => void): void;
@@ -2133,11 +1994,9 @@ declare module chrome {
2133
1994
  * Attaches debugger to the given target.
2134
1995
  * @param target Debugging target to which you want to attach.
2135
1996
  * @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.
2136
- * @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.
2137
- * If you specify the callback parameter, it should be a function that looks like this:
2138
- * function() {...};
1997
+ * @param callback Called once the attach operation succeeds or fails. If the attach fails, runtime.lastError will be set to the error message.
2139
1998
  */
2140
- export function attach(target: Debuggee, requiredVersion: string, callback?: () => void): void;
1999
+ export function attach(target: Debuggee, requiredVersion: string, callback: () => void): void;
2141
2000
  /**
2142
2001
  * Detaches debugger from the given target.
2143
2002
  * @param target Debugging target from which you want to detach.
@@ -2147,11 +2006,9 @@ declare module chrome {
2147
2006
  /**
2148
2007
  * Detaches debugger from the given target.
2149
2008
  * @param target Debugging target from which you want to detach.
2150
- * @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.
2151
- * If you specify the callback parameter, it should be a function that looks like this:
2152
- * function() {...};
2009
+ * @param callback Called once the detach operation succeeds or fails. If the detach fails, runtime.lastError will be set to the error message.
2153
2010
  */
2154
- export function detach(target: Debuggee, callback?: () => void): void;
2011
+ export function detach(target: Debuggee, callback: () => void): void;
2155
2012
  /**
2156
2013
  * Sends given command to the debugging target.
2157
2014
  * @param target Debugging target to which you want to send the command.
@@ -2172,8 +2029,6 @@ declare module chrome {
2172
2029
  * @param commandParams Since Chrome 22.
2173
2030
  * JSON object with request parameters. This object must conform to the remote debugging params scheme for given method.
2174
2031
  * @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.
2175
- * If you specify the callback parameter, it should be a function that looks like this:
2176
- * function(object result) {...};
2177
2032
  */
2178
2033
  export function sendCommand(
2179
2034
  target: Debuggee,
@@ -2190,8 +2045,6 @@ declare module chrome {
2190
2045
  /**
2191
2046
  * Since Chrome 28.
2192
2047
  * Returns the list of available debug targets.
2193
- * @param callback The callback parameter should be a function that looks like this:
2194
- * function(array of TargetInfo result) {...};
2195
2048
  * Parameter result: Array of TargetInfo objects corresponding to the available debug targets.
2196
2049
  */
2197
2050
  export function getTargets(callback: (result: TargetInfo[]) => void): void;
@@ -2423,8 +2276,6 @@ declare namespace chrome.desktopCapture {
2423
2276
  /**
2424
2277
  * Shows desktop media picker UI with the specified set of sources.
2425
2278
  * @param sources Set of sources that should be shown to the user.
2426
- * @param callback The callback parameter should be a function that looks like this:
2427
- * function(string streamId) {...};
2428
2279
  * 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.
2429
2280
  */
2430
2281
  export function chooseDesktopMedia(sources: string[], callback: (streamId: string, options: StreamOptions) => void): number;
@@ -2432,8 +2283,6 @@ declare namespace chrome.desktopCapture {
2432
2283
  * Shows desktop media picker UI with the specified set of sources.
2433
2284
  * @param sources Set of sources that should be shown to the user.
2434
2285
  * @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.
2435
- * @param callback The callback parameter should be a function that looks like this:
2436
- * function(string streamId) {...};
2437
2286
  * 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.
2438
2287
  */
2439
2288
  export function chooseDesktopMedia(
@@ -2458,27 +2307,36 @@ declare namespace chrome.desktopCapture {
2458
2307
  declare namespace chrome.devtools.inspectedWindow {
2459
2308
  /** A resource within the inspected page, such as a document, a script, or an image. */
2460
2309
  export interface Resource {
2461
- /** The URL of the resource. */
2462
- url: string;
2463
- /**
2464
- * Gets the content of the resource.
2465
- * @param callback A function that receives resource content when the request completes.
2466
- * The callback parameter should be a function that looks like this:
2467
- * function(string content, string encoding) {...};
2468
- * Parameter content: Content of the resource (potentially encoded).
2469
- * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported.
2470
- */
2471
- getContent(callback: (content: string, encoding: string) => void): void;
2472
- /**
2473
- * Sets the content of the resource.
2474
- * @param content New content of the resource. Only resources with the text type are currently supported.
2475
- * @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.
2476
- * @param callback A function called upon request completion.
2477
- * If you specify the callback parameter, it should be a function that looks like this:
2478
- * function(object error) {...};
2479
- * Optional parameter error: Set to undefined if the resource content was set successfully; describes error otherwise.
2480
- */
2481
- setContent(content: string, commit: boolean, callback?: (error: Object) => void): void;
2310
+ /** The URL of the resource. */
2311
+ url: string;
2312
+ /**
2313
+ * Gets the content of the resource.
2314
+ * @param callback A function that receives resource content when the request completes.
2315
+ */
2316
+ getContent(
2317
+ callback: (
2318
+ /** Content of the resource (potentially encoded) */
2319
+ content: string,
2320
+ /** Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported. */
2321
+ encoding: string
2322
+ ) => void
2323
+ ): void;
2324
+ /**
2325
+ * Sets the content of the resource.
2326
+ * @param content New content of the resource. Only resources with the text type are currently supported.
2327
+ * @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.
2328
+ * @param callback A function called upon request completion.
2329
+ */
2330
+ setContent(
2331
+ content: string,
2332
+ commit: boolean,
2333
+ callback?: (
2334
+ /**
2335
+ * Set to undefined if the resource content was set successfully; describes error otherwise.
2336
+ */
2337
+ error?: Object
2338
+ ) => void
2339
+ ): void;
2482
2340
  }
2483
2341
 
2484
2342
  export interface ReloadOptions {
@@ -2525,8 +2383,6 @@ declare namespace chrome.devtools.inspectedWindow {
2525
2383
  * 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.
2526
2384
  * @param expression An expression to evaluate.
2527
2385
  * @param callback A function called when evaluation completes.
2528
- * If you specify the callback parameter, it should be a function that looks like this:
2529
- * function(object result, object exceptionInfo) {...};
2530
2386
  * Parameter result: The result of evaluation.
2531
2387
  * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression.
2532
2388
  */
@@ -2539,8 +2395,6 @@ declare namespace chrome.devtools.inspectedWindow {
2539
2395
  * @param expression An expression to evaluate.
2540
2396
  * @param options The options parameter can contain one or more options.
2541
2397
  * @param callback A function called when evaluation completes.
2542
- * If you specify the callback parameter, it should be a function that looks like this:
2543
- * function(object result, object exceptionInfo) {...};
2544
2398
  * Parameter result: The result of evaluation.
2545
2399
  * Parameter exceptionInfo: An object providing details if an exception occurred while evaluating the expression.
2546
2400
  */
@@ -2552,8 +2406,6 @@ declare namespace chrome.devtools.inspectedWindow {
2552
2406
  /**
2553
2407
  * Retrieves the list of resources from the inspected page.
2554
2408
  * @param callback A function that receives the list of resources when the request completes.
2555
- * The callback parameter should be a function that looks like this:
2556
- * function(array of Resource resources) {...};
2557
2409
  */
2558
2410
  export function getResources(callback: (resources: Resource[]) => void): void;
2559
2411
 
@@ -2586,15 +2438,18 @@ declare namespace chrome.devtools.network {
2586
2438
  export interface HARLog extends HARFormatLog { }
2587
2439
  /** Represents a network request for a document resource (script, image and so on). See HAR Specification for reference. */
2588
2440
  export interface Request extends chrome.devtools.network.HAREntry {
2589
- /**
2590
- * Returns content of the response body.
2591
- * @param callback A function that receives the response body when the request completes.
2592
- * The callback parameter should be a function that looks like this:
2593
- * function(string content, string encoding) {...};
2594
- * Parameter content: Content of the response body (potentially encoded).
2595
- * Parameter encoding: Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported.
2596
- */
2597
- getContent(callback: (content: string, encoding: string) => void): void;
2441
+ /**
2442
+ * Returns content of the response body.
2443
+ * @param callback A function that receives the response body when the request completes.
2444
+ */
2445
+ getContent(
2446
+ callback: (
2447
+ /** Content of the response body (potentially encoded) */
2448
+ content: string,
2449
+ /** Empty if content is not encoded, encoding name otherwise. Currently, only base64 is supported */
2450
+ encoding: string
2451
+ ) => void
2452
+ ): void;
2598
2453
  }
2599
2454
 
2600
2455
  export interface RequestFinishedEvent extends chrome.events.Event<(request: Request) => void> { }
@@ -2604,8 +2459,6 @@ declare namespace chrome.devtools.network {
2604
2459
  /**
2605
2460
  * Returns HAR log that contains all known network requests.
2606
2461
  * @param callback A function that receives the HAR log when the request completes.
2607
- * The callback parameter should be a function that looks like this:
2608
- * function(object harLog) {...};
2609
2462
  * Parameter harLog: A HAR log. See HAR specification for details.
2610
2463
  */
2611
2464
  export function getHAR(callback: (harLog: HARLog) => void): void;
@@ -2666,17 +2519,20 @@ declare namespace chrome.devtools.panels {
2666
2519
 
2667
2520
  /** Represents the Elements panel. */
2668
2521
  export interface ElementsPanel {
2669
- /**
2670
- * Creates a pane within panel's sidebar.
2671
- * @param title Text that is displayed in sidebar caption.
2672
- * @param callback A callback invoked when the sidebar is created.
2673
- * If you specify the callback parameter, it should be a function that looks like this:
2674
- * function( ExtensionSidebarPane result) {...};
2675
- * Parameter result: An ExtensionSidebarPane object for created sidebar pane.
2676
- */
2677
- createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => void): void;
2678
- /** Fired when an object is selected in the panel. */
2679
- onSelectionChanged: SelectionChangedEvent;
2522
+ /**
2523
+ * Creates a pane within panel's sidebar.
2524
+ * @param title Text that is displayed in sidebar caption.
2525
+ * @param callback A callback invoked when the sidebar is created.
2526
+ */
2527
+ createSidebarPane(
2528
+ title: string,
2529
+ callback?: (
2530
+ /** An ExtensionSidebarPane object for created sidebar pane */
2531
+ result: ExtensionSidebarPane
2532
+ ) => void
2533
+ ): void;
2534
+ /** Fired when an object is selected in the panel. */
2535
+ onSelectionChanged: SelectionChangedEvent;
2680
2536
  }
2681
2537
 
2682
2538
  /**
@@ -2688,11 +2544,14 @@ declare namespace chrome.devtools.panels {
2688
2544
  * Creates a pane within panel's sidebar.
2689
2545
  * @param title Text that is displayed in sidebar caption.
2690
2546
  * @param callback A callback invoked when the sidebar is created.
2691
- * If you specify the callback parameter, it should be a function that looks like this:
2692
- * function( ExtensionSidebarPane result) {...};
2693
- * Parameter result: An ExtensionSidebarPane object for created sidebar pane.
2694
2547
  */
2695
- createSidebarPane(title: string, callback?: (result: ExtensionSidebarPane) => void): void;
2548
+ createSidebarPane(
2549
+ title: string,
2550
+ callback?: (
2551
+ /** An ExtensionSidebarPane object for created sidebar pane. */
2552
+ result: ExtensionSidebarPane
2553
+ ) => void
2554
+ ): void;
2696
2555
  /** Fired when an object is selected in the panel. */
2697
2556
  onSelectionChanged: SelectionChangedEvent;
2698
2557
  }
@@ -2714,16 +2573,12 @@ declare namespace chrome.devtools.panels {
2714
2573
  * @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.
2715
2574
  * @param rootTitle An optional title for the root of the expression tree.
2716
2575
  * @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
2576
  */
2720
2577
  setExpression(expression: string, rootTitle?: string, callback?: () => void): void;
2721
2578
  /**
2722
2579
  * Sets an expression that is evaluated within the inspected page. The result is displayed in the sidebar pane.
2723
2580
  * @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.
2724
2581
  * @param callback A callback invoked after the sidebar pane is updated with the expression evaluation results.
2725
- * If you specify the callback parameter, it should be a function that looks like this:
2726
- * function() {...};
2727
2582
  */
2728
2583
  setExpression(expression: string, callback?: () => void): void;
2729
2584
  /**
@@ -2731,16 +2586,12 @@ declare namespace chrome.devtools.panels {
2731
2586
  * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
2732
2587
  * @param rootTitle An optional title for the root of the expression tree.
2733
2588
  * @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
2589
  */
2737
2590
  setObject(jsonObject: Object, rootTitle?: string, callback?: () => void): void;
2738
2591
  /**
2739
2592
  * Sets a JSON-compliant object to be displayed in the sidebar pane.
2740
2593
  * @param jsonObject An object to be displayed in context of the inspected page. Evaluated in the context of the caller (API client).
2741
2594
  * @param callback A callback invoked after the sidebar is updated with the object.
2742
- * If you specify the callback parameter, it should be a function that looks like this:
2743
- * function() {...};
2744
2595
  */
2745
2596
  setObject(jsonObject: Object, callback?: () => void): void;
2746
2597
  /**
@@ -2768,8 +2619,6 @@ declare namespace chrome.devtools.panels {
2768
2619
  * @param iconPath Path of the panel's icon relative to the extension directory.
2769
2620
  * @param pagePath Path of the panel's HTML page relative to the extension directory.
2770
2621
  * @param callback A function that is called when the panel is created.
2771
- * If you specify the callback parameter, it should be a function that looks like this:
2772
- * function( ExtensionPanel panel) {...};
2773
2622
  * Parameter panel: An ExtensionPanel object representing the created panel.
2774
2623
  */
2775
2624
  export function create(
@@ -2781,8 +2630,6 @@ declare namespace chrome.devtools.panels {
2781
2630
  /**
2782
2631
  * 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.
2783
2632
  * @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.
2784
- * If you specify the callback parameter, it should be a function that looks like this:
2785
- * function( devtools.inspectedWindow.Resource resource) {...};
2786
2633
  * Parameter resource: A devtools.inspectedWindow.Resource object for the resource that was clicked.
2787
2634
  */
2788
2635
  export function setOpenResourceHandler(
@@ -2794,8 +2641,6 @@ declare namespace chrome.devtools.panels {
2794
2641
  * @param url The URL of the resource to open.
2795
2642
  * @param lineNumber Specifies the line number to scroll to when the resource is loaded.
2796
2643
  * @param callback A function that is called when the resource has been successfully loaded.
2797
- * If you specify the callback parameter, it should be a function that looks like this:
2798
- * function() {...};
2799
2644
  */
2800
2645
  export function openResource(url: string, lineNumber: number, callback: () => void): void;
2801
2646
 
@@ -2834,8 +2679,6 @@ declare namespace chrome.documentScan {
2834
2679
  * Performs a document scan. On success, the PNG data will be sent to the callback.
2835
2680
  * @param options Object containing scan parameters.
2836
2681
  * @param callback Called with the result and data from the scan.
2837
- * The callback parameter should be a function that looks like this:
2838
- * function(object result) {...};
2839
2682
  */
2840
2683
  export function scan(options: DocumentScanOptions, callback: (result: DocumentScanCallbackArg) => void): void;
2841
2684
  }
@@ -3065,8 +2908,6 @@ declare namespace chrome.downloads {
3065
2908
  export function search(query: DownloadQuery): Promise<DownloadItem[]>;
3066
2909
  /**
3067
2910
  * 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.
3068
- * @param callback The callback parameter should be a function that looks like this:
3069
- * function(array of DownloadItem results) {...};
3070
2911
  */
3071
2912
  export function search(query: DownloadQuery, callback: (results: DownloadItem[]) => void): void;
3072
2913
  /**
@@ -3079,10 +2920,8 @@ declare namespace chrome.downloads {
3079
2920
  * 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.
3080
2921
  * @param downloadId The id of the download to pause.
3081
2922
  * @param callback Called when the pause request is completed.
3082
- * If you specify the callback parameter, it should be a function that looks like this:
3083
- * function() {...};
3084
2923
  */
3085
- export function pause(downloadId: number, callback?: () => void): void;
2924
+ export function pause(downloadId: number, callback: () => void): void;
3086
2925
  /**
3087
2926
  * 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.
3088
2927
  * @param downloadId The identifier for the download.
@@ -3093,16 +2932,12 @@ declare namespace chrome.downloads {
3093
2932
  * 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
2933
  * @param downloadId The identifier for the download.
3095
2934
  * @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
2935
  */
3099
2936
  export function getFileIcon(downloadId: number, callback: (iconURL: string) => void): void;
3100
2937
  /**
3101
2938
  * 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.
3102
2939
  * @param downloadId The identifier for the download.
3103
2940
  * @param callback A URL to an image that represents the download.
3104
- * The callback parameter should be a function that looks like this:
3105
- * function(string iconURL) {...};
3106
2941
  */
3107
2942
  export function getFileIcon(
3108
2943
  downloadId: number,
@@ -3119,10 +2954,8 @@ declare namespace chrome.downloads {
3119
2954
  * 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.
3120
2955
  * @param downloadId The id of the download to resume.
3121
2956
  * @param callback Called when the resume request is completed.
3122
- * If you specify the callback parameter, it should be a function that looks like this:
3123
- * function() {...};
3124
2957
  */
3125
- export function resume(downloadId: number, callback?: () => void): void;
2958
+ export function resume(downloadId: number, callback: () => void): void;
3126
2959
  /**
3127
2960
  * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore.
3128
2961
  * @param downloadId The id of the download to cancel.
@@ -3133,10 +2966,8 @@ declare namespace chrome.downloads {
3133
2966
  * Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore.
3134
2967
  * @param downloadId The id of the download to cancel.
3135
2968
  * @param callback Called when the cancel request is completed.
3136
- * If you specify the callback parameter, it should be a function that looks like this:
3137
- * function() {...};
3138
2969
  */
3139
- export function cancel(downloadId: number, callback?: () => void): void;
2970
+ export function cancel(downloadId: number, callback: () => void): void;
3140
2971
  /**
3141
2972
  * 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.
3142
2973
  * @param options What to download and how.
@@ -3147,10 +2978,8 @@ declare namespace chrome.downloads {
3147
2978
  * 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.
3148
2979
  * @param options What to download and how.
3149
2980
  * @param callback Called with the id of the new DownloadItem.
3150
- * If you specify the callback parameter, it should be a function that looks like this:
3151
- * function(integer downloadId) {...};
3152
2981
  */
3153
- export function download(options: DownloadOptions, callback?: (downloadId: number) => void): void;
2982
+ export function download(options: DownloadOptions, callback: (downloadId: number) => void): void;
3154
2983
  /**
3155
2984
  * 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.
3156
2985
  * @param downloadId The identifier for the downloaded file.
@@ -3170,8 +2999,6 @@ declare namespace chrome.downloads {
3170
2999
  export function erase(query: DownloadQuery): Promise<number[]>;
3171
3000
  /**
3172
3001
  * 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.
3173
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
3174
- * function(array of integer erasedIds) {...};
3175
3002
  */
3176
3003
  export function erase(query: DownloadQuery, callback: (erasedIds: number[]) => void): void;
3177
3004
  /**
@@ -3181,8 +3008,6 @@ declare namespace chrome.downloads {
3181
3008
  export function removeFile(downloadId: number): Promise<void>;
3182
3009
  /**
3183
3010
  * Remove the downloaded file if it exists and the DownloadItem is complete; otherwise return an error through runtime.lastError.
3184
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
3185
- * function() {...};
3186
3011
  */
3187
3012
  export function removeFile(downloadId: number, callback?: () => void): void;
3188
3013
  /**
@@ -3195,8 +3020,6 @@ declare namespace chrome.downloads {
3195
3020
  * 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.
3196
3021
  * @param downloadId The identifier for the DownloadItem.
3197
3022
  * @param callback Called when the danger prompt dialog closes.
3198
- * If you specify the callback parameter, it should be a function that looks like this:
3199
- * function() {...};
3200
3023
  */
3201
3024
  export function acceptDanger(downloadId: number, callback: () => void): void;
3202
3025
  /** Initiate dragging the downloaded file to another application. Call in a javascript ondragstart handler. */
@@ -3250,8 +3073,6 @@ declare namespace chrome.enterprise.platformKeys {
3250
3073
  /**
3251
3074
  * 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).
3252
3075
  * @param callback Invoked by getTokens with the list of available Tokens.
3253
- * The callback parameter should be a function that looks like this:
3254
- * function(array of Token tokens) {...};
3255
3076
  * Parameter tokens: The list of available tokens.
3256
3077
  */
3257
3078
  export function getTokens(callback: (tokens: Token[]) => void): void;
@@ -3259,8 +3080,6 @@ declare namespace chrome.enterprise.platformKeys {
3259
3080
  * 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.
3260
3081
  * @param tokenId The id of a Token returned by getTokens.
3261
3082
  * @param callback Called back with the list of the available certificates.
3262
- * The callback parameter should be a function that looks like this:
3263
- * function(array of ArrayBuffer certificates) {...};
3264
3083
  * Parameter certificates: The list of certificates, each in DER encoding of a X.509 certificate.
3265
3084
  */
3266
3085
  export function getCertificates(tokenId: string, callback: (certificates: ArrayBuffer[]) => void): void;
@@ -3269,8 +3088,6 @@ declare namespace chrome.enterprise.platformKeys {
3269
3088
  * @param tokenId The id of a Token returned by getTokens.
3270
3089
  * @param certificate The DER encoding of a X.509 certificate.
3271
3090
  * @param callback Called back when this operation is finished.
3272
- * If you specify the callback parameter, it should be a function that looks like this:
3273
- * function() {...};
3274
3091
  */
3275
3092
  export function importCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void;
3276
3093
  /**
@@ -3278,8 +3095,6 @@ declare namespace chrome.enterprise.platformKeys {
3278
3095
  * @param tokenId The id of a Token returned by getTokens.
3279
3096
  * @param certificate The DER encoding of a X.509 certificate.
3280
3097
  * @param callback Called back when this operation is finished.
3281
- * If you specify the callback parameter, it should be a function that looks like this:
3282
- * function() {...};
3283
3098
  */
3284
3099
  export function removeCertificate(tokenId: string, certificate: ArrayBuffer, callback?: () => void): void;
3285
3100
  /**
@@ -3295,8 +3110,6 @@ declare namespace chrome.enterprise.platformKeys {
3295
3110
  * @param challenge A challenge as emitted by the Verified Access Web API.
3296
3111
  * @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.
3297
3112
  * @param callback Called back with the challenge response.
3298
- * The callback parameter should be a function that looks like this:
3299
- * function(ArrayBuffer response) {...};
3300
3113
  * @since Chrome 50.
3301
3114
  */
3302
3115
  export function challengeMachineKey(
@@ -3318,8 +3131,6 @@ declare namespace chrome.enterprise.platformKeys {
3318
3131
  * @param challenge A challenge as emitted by the Verified Access Web API.
3319
3132
  * @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.
3320
3133
  * @param callback Called back with the challenge response.
3321
- * The callback parameter should be a function that looks like this:
3322
- * function(ArrayBuffer response) {...};
3323
3134
  * @since Chrome 50.
3324
3135
  */
3325
3136
  export function challengeUserKey(
@@ -3343,8 +3154,6 @@ declare namespace chrome.enterprise.deviceAttributes {
3343
3154
  /**
3344
3155
  * @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.
3345
3156
  * @param callback Called with the device identifier of the directory API when received.
3346
- * The callback parameter should be a function that looks like this:
3347
- * function(string deviceId) {...};
3348
3157
  */
3349
3158
  export function getDirectoryDeviceId(callback: (deviceId: string) => void): void;
3350
3159
  /**
@@ -3405,8 +3214,6 @@ declare namespace chrome.enterprise.networkingAttributes {
3405
3214
  /**
3406
3215
  * 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.
3407
3216
  * @param callback Called with the device's default network's NetworkDetails.
3408
- * The callback parameter should be a function that looks like this:
3409
- * function(NetworkDetails networkAddresses) {...};
3410
3217
  */
3411
3218
  export function getNetworkDetails(callback: (networkDetails: NetworkDetails) => void): void;
3412
3219
  }
@@ -3476,20 +3283,25 @@ declare namespace chrome.events {
3476
3283
  /**
3477
3284
  * Returns currently registered rules.
3478
3285
  * @param callback Called with registered rules.
3479
- * The callback parameter should be a function that looks like this:
3480
- * function(array of Rule rules) {...};
3481
- * Parameter rules: Rules that were registered, the optional parameters are filled with values.
3482
3286
  */
3483
- getRules(callback: (rules: Rule[]) => void): void;
3287
+ getRules(
3288
+ callback: (
3289
+ /** Rules that were registered, the optional parameters are filled with values */
3290
+ rules: Rule[]
3291
+ ) => void
3292
+ ): void;
3484
3293
  /**
3485
3294
  * Returns currently registered rules.
3486
3295
  * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are returned.
3487
3296
  * @param callback Called with registered rules.
3488
- * The callback parameter should be a function that looks like this:
3489
- * function(array of Rule rules) {...};
3490
- * Parameter rules: Rules that were registered, the optional parameters are filled with values.
3491
3297
  */
3492
- getRules(ruleIdentifiers: string[], callback: (rules: Rule[]) => void): void;
3298
+ getRules(
3299
+ ruleIdentifiers: string[],
3300
+ callback: (
3301
+ /** Rules that were registered, the optional parameters are filled with values */
3302
+ rules: Rule[]
3303
+ ) => void
3304
+ ): void;
3493
3305
  /**
3494
3306
  * @param callback Listener whose registration status shall be tested.
3495
3307
  */
@@ -3498,31 +3310,28 @@ declare namespace chrome.events {
3498
3310
  * Unregisters currently registered rules.
3499
3311
  * @param ruleIdentifiers If an array is passed, only rules with identifiers contained in this array are unregistered.
3500
3312
  * @param callback Called when rules were unregistered.
3501
- * If you specify the callback parameter, it should be a function that looks like this:
3502
- * function() {...};
3503
3313
  */
3504
3314
  removeRules(ruleIdentifiers?: string[], callback?: () => void): void;
3505
3315
  /**
3506
3316
  * Unregisters currently registered rules.
3507
3317
  * @param callback Called when rules were unregistered.
3508
- * If you specify the callback parameter, it should be a function that looks like this:
3509
- * function() {...};
3510
3318
  */
3511
3319
  removeRules(callback?: () => void): void;
3512
3320
  /**
3513
3321
  * Registers rules to handle events.
3514
3322
  * @param rules Rules to be registered. These do not replace previously registered rules.
3515
3323
  * @param callback Called with registered rules.
3516
- * If you specify the callback parameter, it should be a function that looks like this:
3517
- * function(array of Rule rules) {...};
3518
- * Parameter rules: Rules that were registered, the optional parameters are filled with values.
3519
3324
  */
3520
- addRules(rules: Rule[], callback?: (rules: Rule[]) => void): void;
3325
+ addRules(
3326
+ rules: Rule[],
3327
+ callback?: (
3328
+ /** Rules that were registered, the optional parameters are filled with values */
3329
+ rules: Rule[]
3330
+ ) => void
3331
+ ): void;
3521
3332
  /**
3522
3333
  * Deregisters an event listener callback from an event.
3523
3334
  * @param callback Listener that shall be unregistered.
3524
- * The callback parameter should be a function that looks like this:
3525
- * function() {...};
3526
3335
  */
3527
3336
  removeListener(callback: T): void;
3528
3337
  hasListeners(): boolean;
@@ -3533,8 +3342,6 @@ declare namespace chrome.events {
3533
3342
  /**
3534
3343
  * Registers an event listener callback to an event.
3535
3344
  * @param callback Called when an event occurs. The parameters of this function depend on the type of event.
3536
- * The callback parameter should be a function that looks like this:
3537
- * function() {...};
3538
3345
  */
3539
3346
  addListener(callback: T): void;
3540
3347
  }
@@ -3624,8 +3431,6 @@ declare namespace chrome.extension {
3624
3431
  /**
3625
3432
  * Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.
3626
3433
  * Since Chrome 12.
3627
- * @param callback The callback parameter should be a function that looks like this:
3628
- * function(boolean isAllowedAccess) {...};
3629
3434
  * Parameter isAllowedAccess: True if the extension can access the 'file://' scheme, false otherwise.
3630
3435
  */
3631
3436
  export function isAllowedFileSchemeAccess(callback: (isAllowedAccess: boolean) => void): void;
@@ -3638,8 +3443,6 @@ declare namespace chrome.extension {
3638
3443
  /**
3639
3444
  * Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.
3640
3445
  * Since Chrome 12.
3641
- * @param callback The callback parameter should be a function that looks like this:
3642
- * function(boolean isAllowedAccess) {...};
3643
3446
  * Parameter isAllowedAccess: True if the extension has access to Incognito mode, false otherwise.
3644
3447
  */
3645
3448
  export function isAllowedIncognitoAccess(callback: (isAllowedAccess: boolean) => void): void;
@@ -3722,8 +3525,6 @@ declare namespace chrome.fileBrowserHandler {
3722
3525
  * Since Chrome 21.
3723
3526
  * @param selectionParams Parameters that will be used while selecting the file.
3724
3527
  * @param callback Function called upon completion.
3725
- * The callback parameter should be a function that looks like this:
3726
- * function(object result) {...};
3727
3528
  * Parameter result: Result of the method.
3728
3529
  */
3729
3530
  export function selectFile(selectionParams: SelectionParams, callback: (result: SelectionResult) => void): void;
@@ -4082,31 +3883,23 @@ declare namespace chrome.fileSystemProvider {
4082
3883
  * Depending on the type of the file system being mounted, the source option must be set appropriately.
4083
3884
  * In case of an error, runtime.lastError will be set with a corresponding error code.
4084
3885
  * @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
3886
  */
4088
3887
  export function mount(options: MountOptions, callback?: () => void): void;
4089
3888
  /**
4090
3889
  * 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).
4091
3890
  * In case of an error, runtime.lastError will be set with a corresponding error code.
4092
3891
  * @param callback A generic result callback to indicate success or failure.
4093
- * If you specify the callback parameter, it should be a function that looks like this:
4094
- * function() {...};
4095
3892
  */
4096
3893
  export function unmount(options: UnmountOptions, callback?: () => void): void;
4097
3894
  /**
4098
3895
  * Returns all file systems mounted by the extension.
4099
3896
  * @param callback Callback to receive the result of getAll function.
4100
- * The callback parameter should be a function that looks like this:
4101
- * function(array of FileSystemInfo fileSystems) {...};
4102
3897
  */
4103
3898
  export function getAll(callback: (fileSystems: FileSystemInfo[]) => void): void;
4104
3899
  /**
4105
3900
  * Returns information about a file system with the passed fileSystemId.
4106
3901
  * @since Since Chrome 42.
4107
3902
  * @param callback Callback to receive the result of get function.
4108
- * The callback parameter should be a function that looks like this:
4109
- * function(FileSystemInfo fileSystem) {...};
4110
3903
  */
4111
3904
  export function get(fileSystemId: string, callback: (fileSystem: FileSystemInfo) => void): void;
4112
3905
  /**
@@ -4117,8 +3910,6 @@ declare namespace chrome.fileSystemProvider {
4117
3910
  * 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.
4118
3911
  * In case of an error, runtime.lastError will be set will a corresponding error code.
4119
3912
  * @param callback A generic result callback to indicate success or failure.
4120
- * If you specify the callback parameter, it should be a function that looks like this:
4121
- * function() {...};
4122
3913
  */
4123
3914
  export function notify(options: NotificationOptions, callback: () => void): void;
4124
3915
 
@@ -4257,10 +4048,8 @@ declare namespace chrome.fontSettings {
4257
4048
  export function setDefaultFontSize(details: DefaultFontSizeDetails): Promise<void>
4258
4049
  /**
4259
4050
  * Sets the default font size.
4260
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4261
- * function() {...};
4262
4051
  */
4263
- export function setDefaultFontSize(details: DefaultFontSizeDetails, callback?: Function): void;
4052
+ export function setDefaultFontSize(details: DefaultFontSizeDetails, callback: Function): void;
4264
4053
  /**
4265
4054
  * Gets the font for a given script and generic font family.
4266
4055
  * @return The `getFont` method provides its result via callback or returned as a `Promise` (MV3 only).
@@ -4268,10 +4057,8 @@ declare namespace chrome.fontSettings {
4268
4057
  export function getFont(details: FontDetails): Promise<FontDetailsResult>
4269
4058
  /**
4270
4059
  * Gets the font for a given script and generic font family.
4271
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4272
- * function(object details) {...};
4273
4060
  */
4274
- export function getFont(details: FontDetails, callback?: (details: FontDetailsResult) => void): void;
4061
+ export function getFont(details: FontDetails, callback: (details: FontDetailsResult) => void): void;
4275
4062
  /**
4276
4063
  * Gets the default font size.
4277
4064
  * @param details This parameter is currently unused.
@@ -4281,10 +4068,9 @@ declare namespace chrome.fontSettings {
4281
4068
  /**
4282
4069
  * Gets the default font size.
4283
4070
  * @param details This parameter is currently unused.
4284
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4285
- * function(object details) {...};
4286
4071
  */
4287
- export function getDefaultFontSize(details?: Object, callback?: (options: FontSizeDetails) => void): void;
4072
+ export function getDefaultFontSize(callback: (options: FontSizeDetails) => void): void;
4073
+ export function getDefaultFontSize(details: Object, callback: (options: FontSizeDetails) => void): void;
4288
4074
  /**
4289
4075
  * Gets the minimum font size.
4290
4076
  * @param details This parameter is currently unused.
@@ -4294,10 +4080,9 @@ declare namespace chrome.fontSettings {
4294
4080
  /**
4295
4081
  * Gets the minimum font size.
4296
4082
  * @param details This parameter is currently unused.
4297
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4298
- * function(object details) {...};
4299
4083
  */
4300
- export function getMinimumFontSize(details?: object, callback?: (options: FontSizeDetails) => void): void;
4084
+ export function getMinimumFontSize(callback: (options: FontSizeDetails) => void): void;
4085
+ export function getMinimumFontSize(details: object, callback: (options: FontSizeDetails) => void): void;
4301
4086
  /**
4302
4087
  * Sets the minimum font size.
4303
4088
  * @return The `setMinimumFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4305,10 +4090,8 @@ declare namespace chrome.fontSettings {
4305
4090
  export function setMinimumFontSize(details: SetFontSizeDetails): Promise<void>;
4306
4091
  /**
4307
4092
  * Sets the minimum font size.
4308
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4309
- * function() {...};
4310
4093
  */
4311
- export function setMinimumFontSize(details: SetFontSizeDetails, callback?: Function): void;
4094
+ export function setMinimumFontSize(details: SetFontSizeDetails, callback: Function): void;
4312
4095
  /**
4313
4096
  * Gets the default size for fixed width fonts.
4314
4097
  * @param details This parameter is currently unused.
@@ -4318,10 +4101,9 @@ declare namespace chrome.fontSettings {
4318
4101
  /**
4319
4102
  * Gets the default size for fixed width fonts.
4320
4103
  * @param details This parameter is currently unused.
4321
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4322
- * function(object details) {...};
4323
4104
  */
4324
- export function getDefaultFixedFontSize(details?: Object, callback?: (details: FontSizeDetails) => void): void;
4105
+ export function getDefaultFixedFontSize(callback: (details: FontSizeDetails) => void): void;
4106
+ export function getDefaultFixedFontSize(details: Object, callback: (details: FontSizeDetails) => void): void;
4325
4107
  /**
4326
4108
  * Clears the default font size set by this extension, if any.
4327
4109
  * @param details This parameter is currently unused.
@@ -4331,10 +4113,9 @@ declare namespace chrome.fontSettings {
4331
4113
  /**
4332
4114
  * Clears the default font size set by this extension, if any.
4333
4115
  * @param details This parameter is currently unused.
4334
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4335
- * function() {...};
4336
4116
  */
4337
- export function clearDefaultFontSize(details?: Object, callback?: Function): void;
4117
+ export function clearDefaultFontSize(callback: Function): void;
4118
+ export function clearDefaultFontSize(details: Object, callback: Function): void;
4338
4119
  /**
4339
4120
  * Sets the default size for fixed width fonts.
4340
4121
  * @return The `setDefaultFixedFontSize` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4342,10 +4123,8 @@ declare namespace chrome.fontSettings {
4342
4123
  export function setDefaultFixedFontSize(details: SetFontSizeDetails): Promise<void>;
4343
4124
  /**
4344
4125
  * Sets the default size for fixed width fonts.
4345
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4346
- * function() {...};
4347
4126
  */
4348
- export function setDefaultFixedFontSize(details: SetFontSizeDetails, callback?: Function): void;
4127
+ export function setDefaultFixedFontSize(details: SetFontSizeDetails, callback: Function): void;
4349
4128
  /**
4350
4129
  * Clears the font set by this extension, if any.
4351
4130
  * @return The `clearFont` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4353,10 +4132,8 @@ declare namespace chrome.fontSettings {
4353
4132
  export function clearFont(details: FontDetails): Promise<void>;
4354
4133
  /**
4355
4134
  * Clears the font set by this extension, if any.
4356
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4357
- * function() {...};
4358
4135
  */
4359
- export function clearFont(details: FontDetails, callback?: Function): void;
4136
+ export function clearFont(details: FontDetails, callback: Function): void;
4360
4137
  /**
4361
4138
  * Sets the font for a given script and generic font family.
4362
4139
  * @return The `setFont` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4364,10 +4141,8 @@ declare namespace chrome.fontSettings {
4364
4141
  export function setFont(details: SetFontDetails): Promise<void>;
4365
4142
  /**
4366
4143
  * Sets the font for a given script and generic font family.
4367
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4368
- * function(object details) {...};
4369
4144
  */
4370
- export function setFont(details: SetFontDetails, callback?: Function): void;
4145
+ export function setFont(details: SetFontDetails, callback: Function): void;
4371
4146
  /**
4372
4147
  * Clears the minimum font size set by this extension, if any.
4373
4148
  * @param details This parameter is currently unused.
@@ -4377,10 +4152,9 @@ declare namespace chrome.fontSettings {
4377
4152
  /**
4378
4153
  * Clears the minimum font size set by this extension, if any.
4379
4154
  * @param details This parameter is currently unused.
4380
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4381
- * function() {...};
4382
4155
  */
4383
- export function clearMinimumFontSize(details?: Object, callback?: Function): void;
4156
+ export function clearMinimumFontSize(callback: Function): void;
4157
+ export function clearMinimumFontSize(details: Object, callback: Function): void;
4384
4158
  /**
4385
4159
  * Gets a list of fonts on the system.
4386
4160
  * @return The `getFontList` method provides its result via callback or returned as a `Promise` (MV3 only).
@@ -4388,10 +4162,8 @@ declare namespace chrome.fontSettings {
4388
4162
  export function getFontList(): Promise<FontName[]>;
4389
4163
  /**
4390
4164
  * Gets a list of fonts on the system.
4391
- * @param callback The callback parameter should be a function that looks like this:
4392
- * function(array of FontName results) {...};
4393
4165
  */
4394
- export function getFontList(callback?: (results: FontName[]) => void): void;
4166
+ export function getFontList(callback: (results: FontName[]) => void): void;
4395
4167
  /**
4396
4168
  * Clears the default fixed font size set by this extension, if any.
4397
4169
  * @param details This parameter is currently unused.
@@ -4401,10 +4173,8 @@ declare namespace chrome.fontSettings {
4401
4173
  /**
4402
4174
  * Clears the default fixed font size set by this extension, if any.
4403
4175
  * @param details This parameter is currently unused.
4404
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4405
- * function() {...};
4406
4176
  */
4407
- export function clearDefaultFixedFontSize(details: Object, callback?: Function): void;
4177
+ export function clearDefaultFixedFontSize(details: Object, callback: Function): void;
4408
4178
 
4409
4179
  /** Fired when the default fixed font size setting changes. */
4410
4180
  export var onDefaultFixedFontSizeChanged: DefaultFixedFontSizeChangedEvent;
@@ -4474,24 +4244,18 @@ declare namespace chrome.gcm {
4474
4244
  * 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.
4475
4245
  * @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.
4476
4246
  * @param callback Function called when registration completes. It should check runtime.lastError for error when registrationId is empty.
4477
- * The callback parameter should be a function that looks like this:
4478
- * function(string registrationId) {...};
4479
4247
  * Parameter registrationId: A registration ID assigned to the application by the GCM.
4480
4248
  */
4481
4249
  export function register(senderIds: string[], callback: (registrationId: string) => void): void;
4482
4250
  /**
4483
4251
  * Unregisters the application from GCM.
4484
4252
  * @param callback A function called after the unregistration completes. Unregistration was successful if runtime.lastError is not set.
4485
- * The callback parameter should be a function that looks like this:
4486
- * function() {...};
4487
4253
  */
4488
4254
  export function unregister(callback: () => void): void;
4489
4255
  /**
4490
4256
  * Sends a message according to its contents.
4491
4257
  * @param message A message to send to the other party via GCM.
4492
4258
  * @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.
4493
- * The callback parameter should be a function that looks like this:
4494
- * function(string messageId) {...};
4495
4259
  * Parameter messageId: The ID of the message that the callback was issued for.
4496
4260
  */
4497
4261
  export function send(message: OutgoingMessage, callback: (messageId: string) => void): void;
@@ -4584,10 +4348,8 @@ declare namespace chrome.history {
4584
4348
  export function search(query: HistoryQuery): Promise<HistoryItem[]>;
4585
4349
  /**
4586
4350
  * Searches the history for the last visit time of each page matching the query.
4587
- * @param callback The callback parameter should be a function that looks like this:
4588
- * function(array of HistoryItem results) {...};
4589
4351
  */
4590
- export function search(query: HistoryQuery, callback?: (results: HistoryItem[]) => void): void;
4352
+ export function search(query: HistoryQuery, callback: (results: HistoryItem[]) => void): void;
4591
4353
  /**
4592
4354
  * Adds a URL to the history at the current time with a transition type of "link".
4593
4355
  * @return The `addUrl` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4595,10 +4357,8 @@ declare namespace chrome.history {
4595
4357
  export function addUrl(details: Url): Promise<void>;
4596
4358
  /**
4597
4359
  * Adds a URL to the history at the current time with a transition type of "link".
4598
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4599
- * function() {...};
4600
4360
  */
4601
- export function addUrl(details: Url, callback?: () => void): void;
4361
+ export function addUrl(details: Url, callback: () => void): void;
4602
4362
  /**
4603
4363
  * 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.
4604
4364
  * @return The `deleteRange` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4606,10 +4366,8 @@ declare namespace chrome.history {
4606
4366
  export function deleteRange(range: Range): Promise<void>;
4607
4367
  /**
4608
4368
  * 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.
4609
- * @param callback The callback parameter should be a function that looks like this:
4610
- * function() {...};
4611
4369
  */
4612
- export function deleteRange(range: Range, callback?: () => void): void;
4370
+ export function deleteRange(range: Range, callback: () => void): void;
4613
4371
  /**
4614
4372
  * Deletes all items from the history.
4615
4373
  * @return The `deleteAll` method provides its result via callback or returned as a `Promise` (MV3 only). It has no parameters.
@@ -4617,8 +4375,6 @@ declare namespace chrome.history {
4617
4375
  export function deleteAll(): Promise<void>;
4618
4376
  /**
4619
4377
  * Deletes all items from the history.
4620
- * @param callback The callback parameter should be a function that looks like this:
4621
- * function() {...};
4622
4378
  */
4623
4379
  export function deleteAll(callback: () => void): void;
4624
4380
  /**
@@ -4628,8 +4384,6 @@ declare namespace chrome.history {
4628
4384
  export function getVisits(details: Url): Promise<VisitItem[]>;
4629
4385
  /**
4630
4386
  * Retrieves information about visits to a URL.
4631
- * @param callback The callback parameter should be a function that looks like this:
4632
- * function(array of VisitItem results) {...};
4633
4387
  */
4634
4388
  export function getVisits(details: Url, callback: (results: VisitItem[]) => void): void;
4635
4389
  /**
@@ -4639,10 +4393,8 @@ declare namespace chrome.history {
4639
4393
  export function deleteUrl(details: Url): Promise<void>;
4640
4394
  /**
4641
4395
  * Removes all occurrences of the given URL from the history.
4642
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
4643
- * function() {...};
4644
4396
  */
4645
- export function deleteUrl(details: Url, callback?: () => void): void;
4397
+ export function deleteUrl(details: Url, callback: () => void): void;
4646
4398
 
4647
4399
  /** Fired when a URL is visited, providing the HistoryItem data for that URL. This event fires before the page has loaded. */
4648
4400
  export var onVisited: HistoryVisitedEvent;
@@ -4686,8 +4438,6 @@ declare namespace chrome.i18n {
4686
4438
  export function getAcceptLanguages(): Promise<string[]>;
4687
4439
  /**
4688
4440
  * Gets the accept-languages of the browser. This is different from the locale used by the browser; to get the locale, use i18n.getUILanguage.
4689
- * @param callback The callback parameter should be a function that looks like this:
4690
- * function(array of string languages) {...};
4691
4441
  * Parameter languages: Array of the accept languages of the browser, such as en-US,en,zh-CN
4692
4442
  */
4693
4443
  export function getAcceptLanguages(callback: (languages: string[]) => void): void;
@@ -4711,7 +4461,6 @@ declare namespace chrome.i18n {
4711
4461
  export function detectLanguage(text: string): Promise<LanguageDetectionResult>;
4712
4462
  /** Detects the language of the provided text using CLD.
4713
4463
  * @param text User input string to be translated.
4714
- * @param callback The callback parameter should be a function that looks like this: function(object result) {...};
4715
4464
  */
4716
4465
  export function detectLanguage(text: string, callback: (result: LanguageDetectionResult) => void): void;
4717
4466
  }
@@ -4815,8 +4564,6 @@ declare namespace chrome.identity {
4815
4564
  * If `callback` is not provided, the function returns a Promise when the state has been cleared.
4816
4565
  * @since Chrome 87.
4817
4566
  * @param callback Called when the state has been cleared.
4818
- * The parameter should be a function that looks like this:
4819
- * () => {...};
4820
4567
  */
4821
4568
  export function clearAllCachedAuthTokens(): Promise<void>;
4822
4569
  export function clearAllCachedAuthTokens(callback: () => void): void;
@@ -4836,8 +4583,6 @@ declare namespace chrome.identity {
4836
4583
  * If `callback` is not provided, the function returns a Promise that resolves with the token.
4837
4584
  * @param details Token options.
4838
4585
  * @param callback Called with an OAuth2 access token as specified by the manifest, or undefined if there was an error.
4839
- * If you specify the callback parameter, it should be a function that looks like this:
4840
- * function(string token) {...};
4841
4586
  */
4842
4587
  export function getAuthToken(details: TokenDetails): Promise<GetAuthTokenResult>;
4843
4588
  export function getAuthToken(details: TokenDetails, callback: (token?: string, grantedScopes?: string[]) => void): void;
@@ -4861,8 +4606,6 @@ declare namespace chrome.identity {
4861
4606
  * If `callback` is not provided, the function returns a Promise when the state has been removed from the cache.
4862
4607
  * @param details Token information.
4863
4608
  * @param callback Called when the token has been removed from the cache.
4864
- * If you specify the callback parameter, it should be a function that looks like this:
4865
- * function() {...};
4866
4609
  */
4867
4610
  export function removeCachedAuthToken(details: TokenInformation): Promise<void>;
4868
4611
  export function removeCachedAuthToken(details: TokenInformation, callback: () => void): void;
@@ -4873,8 +4616,6 @@ declare namespace chrome.identity {
4873
4616
  * 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.
4874
4617
  * @param details WebAuth flow options.
4875
4618
  * @param callback Optional. Called with the URL redirected back to your application.
4876
- * The callback parameter should be a function that looks like this:
4877
- * function(string responseUrl) {...};
4878
4619
  */
4879
4620
  export function launchWebAuthFlow(details: WebAuthFlowOptions, callback: (responseUrl?: string) => void): void;
4880
4621
  export function launchWebAuthFlow(details: WebAuthFlowOptions): Promise<string | undefined>;
@@ -4910,8 +4651,6 @@ declare namespace chrome.idle {
4910
4651
  * 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.
4911
4652
  * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected.
4912
4653
  * Since Chrome 25.
4913
- * @param callback The callback parameter should be a function that looks like this:
4914
- * function( IdleState newState) {...};
4915
4654
  */
4916
4655
  export function queryState(detectionIntervalInSeconds: number, callback: (newState: IdleState) => void): void;
4917
4656
  /**
@@ -4922,8 +4661,6 @@ declare namespace chrome.idle {
4922
4661
  export function setDetectionInterval(intervalInSeconds: number): void;
4923
4662
  /**
4924
4663
  * 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.
4925
- * @param callback The callback parameter should be a function that looks like this:
4926
- * function(integer delay) {...};
4927
4664
  * Parameter delay: Time, in seconds, until the screen is locked automatically while idle. This is zero if the screen never locks automatically.
4928
4665
  */
4929
4666
  export function getAutoLockDelay(callback: (delay: number) => void): void;
@@ -5257,44 +4994,32 @@ declare namespace chrome.input.ime {
5257
4994
 
5258
4995
  /**
5259
4996
  * Adds the provided menu items to the language menu when this IME is active.
5260
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5261
- * function() {...};
5262
4997
  */
5263
4998
  export function setMenuItems(parameters: ImeParameters, callback?: () => void): void;
5264
4999
  /**
5265
5000
  * Commits the provided text to the current input.
5266
5001
  * @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.
5267
- * If you specify the callback parameter, it should be a function that looks like this:
5268
- * function(boolean success) {...};
5269
5002
  */
5270
5003
  export function commitText(parameters: CommitTextParameters, callback?: (success: boolean) => void): void;
5271
5004
  /**
5272
5005
  * Sets the current candidate list. This fails if this extension doesn't own the active IME
5273
5006
  * @param callback Called when the operation completes.
5274
- * If you specify the callback parameter, it should be a function that looks like this:
5275
- * function(boolean success) {...};
5276
5007
  */
5277
5008
  export function setCandidates(parameters: CandidatesParameters, callback?: (success: boolean) => void): void;
5278
5009
  /**
5279
5010
  * Set the current composition. If this extension does not own the active IME, this fails.
5280
5011
  * @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.
5281
- * If you specify the callback parameter, it should be a function that looks like this:
5282
- * function(boolean success) {...};
5283
5012
  */
5284
5013
  export function setComposition(parameters: CompositionParameters, callback?: (success: boolean) => void): void;
5285
5014
  /**
5286
5015
  * Updates the state of the MenuItems specified
5287
5016
  * @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() {...};
5290
5017
  */
5291
5018
  export function updateMenuItems(parameters: MenuItemParameters, callback?: () => void): void;
5292
5019
  /**
5293
5020
  * Shows/Hides an assistive window with the given properties.
5294
5021
  * @param parameters
5295
5022
  * @param callback Called when the operation completes.
5296
- * If you specify the callback parameter, it should be a function that looks like this:
5297
- * function(boolean success) {...};
5298
5023
  */
5299
5024
  export function setAssistiveWindowProperties(
5300
5025
  parameters: {
@@ -5307,8 +5032,6 @@ declare namespace chrome.input.ime {
5307
5032
  * Highlights/Unhighlights a button in an assistive window.
5308
5033
  * @param parameters
5309
5034
  * @param callback Called when the operation completes. On failure, chrome.runtime.lastError is set.
5310
- * If you specify the callback parameter, it should be a function that looks like this:
5311
- * function() {...};
5312
5035
  */
5313
5036
  export function setAssistiveWindowButtonHighlighted(
5314
5037
  parameters: {
@@ -5323,8 +5046,6 @@ declare namespace chrome.input.ime {
5323
5046
  /**
5324
5047
  * Sets the properties of the candidate window. This fails if the extension doesn't own the active IME
5325
5048
  * @param callback Called when the operation completes.
5326
- * If you specify the callback parameter, it should be a function that looks like this:
5327
- * function(boolean success) {...};
5328
5049
  */
5329
5050
  export function setCandidateWindowProperties(
5330
5051
  parameters: CandidateWindowParameter,
@@ -5333,8 +5054,6 @@ declare namespace chrome.input.ime {
5333
5054
  /**
5334
5055
  * Clear the current composition. If this extension does not own the active IME, this fails.
5335
5056
  * @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.
5336
- * If you specify the callback parameter, it should be a function that looks like this:
5337
- * function(boolean success) {...};
5338
5057
  */
5339
5058
  export function clearComposition(
5340
5059
  parameters: ClearCompositionParameters,
@@ -5343,8 +5062,6 @@ declare namespace chrome.input.ime {
5343
5062
  /**
5344
5063
  * Set the position of the cursor in the candidate window. This is a no-op if this extension does not own the active IME.
5345
5064
  * @param callback Called when the operation completes
5346
- * If you specify the callback parameter, it should be a function that looks like this:
5347
- * function(boolean success) {...};
5348
5065
  */
5349
5066
  export function setCursorPosition(
5350
5067
  parameters: CursorPositionParameters,
@@ -5354,8 +5071,6 @@ declare namespace chrome.input.ime {
5354
5071
  * 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.
5355
5072
  * @since Chrome 33.
5356
5073
  * @param callback Called when the operation completes.
5357
- * If you specify the callback parameter, it should be a function that looks like this:
5358
- * function() {...};
5359
5074
  */
5360
5075
  export function sendKeyEvents(parameters: SendKeyEventParameters, callback?: () => void): void;
5361
5076
  /**
@@ -5574,10 +5289,8 @@ declare namespace chrome.management {
5574
5289
  * Enables or disables an app or extension.
5575
5290
  * @param id This should be the id from an item of management.ExtensionInfo.
5576
5291
  * @param enabled Whether this item should be enabled or disabled.
5577
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5578
- * function() {...};
5579
5292
  */
5580
- export function setEnabled(id: string, enabled: boolean, callback?: () => void): void;
5293
+ export function setEnabled(id: string, enabled: boolean, callback: () => void): void;
5581
5294
  /**
5582
5295
  * Returns a list of permission warnings for the given extension id.
5583
5296
  * @since Chrome 15.
@@ -5589,10 +5302,8 @@ declare namespace chrome.management {
5589
5302
  * Returns a list of permission warnings for the given extension id.
5590
5303
  * @since Chrome 15.
5591
5304
  * @param id The ID of an already installed extension.
5592
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5593
- * function(array of string permissionWarnings) {...};
5594
5305
  */
5595
- export function getPermissionWarningsById(id: string, callback?: (permissionWarnings: string[]) => void): void;
5306
+ export function getPermissionWarningsById(id: string, callback: (permissionWarnings: string[]) => void): void;
5596
5307
  /**
5597
5308
  * Returns information about the installed extension, app, or theme that has the given ID.
5598
5309
  * @since Chrome 9.
@@ -5604,10 +5315,8 @@ declare namespace chrome.management {
5604
5315
  * Returns information about the installed extension, app, or theme that has the given ID.
5605
5316
  * @since Chrome 9.
5606
5317
  * @param id The ID from an item of management.ExtensionInfo.
5607
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5608
- * function( ExtensionInfo result) {...};
5609
5318
  */
5610
- export function get(id: string, callback?: (result: ExtensionInfo) => void): void;
5319
+ export function get(id: string, callback: (result: ExtensionInfo) => void): void;
5611
5320
  /**
5612
5321
  * Returns a list of information about installed extensions and apps.
5613
5322
  * @return The `getAll` method provides its result via callback or returned as a `Promise` (MV3 only).
@@ -5615,10 +5324,8 @@ declare namespace chrome.management {
5615
5324
  export function getAll(): Promise<ExtensionInfo[]>;
5616
5325
  /**
5617
5326
  * Returns a list of information about installed extensions and apps.
5618
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5619
- * function(array of ExtensionInfo result) {...};
5620
5327
  */
5621
- export function getAll(callback?: (result: ExtensionInfo[]) => void): void;
5328
+ export function getAll(callback: (result: ExtensionInfo[]) => void): void;
5622
5329
  /**
5623
5330
  * 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.
5624
5331
  * @since Chrome 15.
@@ -5632,12 +5339,10 @@ declare namespace chrome.management {
5632
5339
  * 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.
5633
5340
  * @since Chrome 15.
5634
5341
  * @param manifestStr Extension manifest JSON string.
5635
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5636
- * function(array of string permissionWarnings) {...};
5637
5342
  */
5638
5343
  export function getPermissionWarningsByManifest(
5639
5344
  manifestStr: string,
5640
- callback?: (permissionwarnings: string[]) => void,
5345
+ callback: (permissionwarnings: string[]) => void,
5641
5346
  ): void;
5642
5347
  /**
5643
5348
  * Launches an application.
@@ -5648,10 +5353,8 @@ declare namespace chrome.management {
5648
5353
  /**
5649
5354
  * Launches an application.
5650
5355
  * @param id The extension id of the application.
5651
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5652
- * function() {...};
5653
5356
  */
5654
- export function launchApp(id: string, callback?: () => void): void;
5357
+ export function launchApp(id: string, callback: () => void): void;
5655
5358
  /**
5656
5359
  * Uninstalls a currently installed app or extension.
5657
5360
  * @since Chrome 21.
@@ -5663,10 +5366,9 @@ declare namespace chrome.management {
5663
5366
  * Uninstalls a currently installed app or extension.
5664
5367
  * @since Chrome 21.
5665
5368
  * @param id This should be the id from an item of management.ExtensionInfo.
5666
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5667
- * function() {...};
5668
5369
  */
5669
- export function uninstall(id: string, options?: UninstallOptions, callback?: () => void): void;
5370
+ export function uninstall(id: string, callback: () => void): void;
5371
+ export function uninstall(id: string, options: UninstallOptions, callback: () => void): void;
5670
5372
  /**
5671
5373
  * Uninstalls a currently installed app or extension.
5672
5374
  * @deprecated since Chrome 21. The options parameter was added to this function.
@@ -5678,10 +5380,8 @@ declare namespace chrome.management {
5678
5380
  * Uninstalls a currently installed app or extension.
5679
5381
  * @deprecated since Chrome 21. The options parameter was added to this function.
5680
5382
  * @param id This should be the id from an item of management.ExtensionInfo.
5681
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5682
- * function() {...};
5683
5383
  */
5684
- export function uninstall(id: string, callback?: () => void): void;
5384
+ export function uninstall(id: string, callback: () => void): void;
5685
5385
  /**
5686
5386
  * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest.
5687
5387
  * @since Chrome 39.
@@ -5691,10 +5391,8 @@ declare namespace chrome.management {
5691
5391
  /**
5692
5392
  * Returns information about the calling extension, app, or theme. Note: This function can be used without requesting the 'management' permission in the manifest.
5693
5393
  * @since Chrome 39.
5694
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5695
- * function( ExtensionInfo result) {...};
5696
5394
  */
5697
- export function getSelf(callback?: (result: ExtensionInfo) => void): void;
5395
+ export function getSelf(callback: (result: ExtensionInfo) => void): void;
5698
5396
  /**
5699
5397
  * Uninstalls the calling extension.
5700
5398
  * Note: This function can be used without requesting the 'management' permission in the manifest.
@@ -5706,10 +5404,9 @@ declare namespace chrome.management {
5706
5404
  * Uninstalls the calling extension.
5707
5405
  * Note: This function can be used without requesting the 'management' permission in the manifest.
5708
5406
  * @since Chrome 26.
5709
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5710
- * function() {...};
5711
5407
  */
5712
- export function uninstallSelf(options?: UninstallOptions, callback?: () => void): void;
5408
+ export function uninstallSelf(callback: () => void): void;
5409
+ export function uninstallSelf(options: UninstallOptions, callback: () => void): void;
5713
5410
  /**
5714
5411
  * Uninstalls the calling extension.
5715
5412
  * Note: This function can be used without requesting the 'management' permission in the manifest.
@@ -5721,10 +5418,8 @@ declare namespace chrome.management {
5721
5418
  * Uninstalls the calling extension.
5722
5419
  * Note: This function can be used without requesting the 'management' permission in the manifest.
5723
5420
  * @since Chrome 26.
5724
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5725
- * function() {...};
5726
5421
  */
5727
- export function uninstallSelf(callback?: () => void): void;
5422
+ export function uninstallSelf(callback: () => void): void;
5728
5423
  /**
5729
5424
  * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created.
5730
5425
  * @since Chrome 37.
@@ -5734,10 +5429,8 @@ declare namespace chrome.management {
5734
5429
  /**
5735
5430
  * Display options to create shortcuts for an app. On Mac, only packaged app shortcuts can be created.
5736
5431
  * @since Chrome 37.
5737
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5738
- * function() {...};
5739
5432
  */
5740
- export function createAppShortcut(id: string, callback?: () => void): void;
5433
+ export function createAppShortcut(id: string, callback: () => void): void;
5741
5434
  /**
5742
5435
  * Set the launch type of an app.
5743
5436
  * @since Chrome 37.
@@ -5751,10 +5444,8 @@ declare namespace chrome.management {
5751
5444
  * @since Chrome 37.
5752
5445
  * @param id This should be the id from an app item of management.ExtensionInfo.
5753
5446
  * @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.
5754
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5755
- * function() {...};
5756
5447
  */
5757
- export function setLaunchType(id: string, launchType: string, callback?: () => void): void;
5448
+ export function setLaunchType(id: string, launchType: string, callback: () => void): void;
5758
5449
  /**
5759
5450
  * Generate an app for a URL. Returns the generated bookmark app.
5760
5451
  * @since Chrome 37.
@@ -5768,10 +5459,8 @@ declare namespace chrome.management {
5768
5459
  * @since Chrome 37.
5769
5460
  * @param url The URL of a web page. The scheme of the URL can only be "http" or "https".
5770
5461
  * @param title The title of the generated app.
5771
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
5772
- * function( ExtensionInfo result) {...};
5773
5462
  */
5774
- export function generateAppForLink(url: string, title: string, callback?: (result: ExtensionInfo) => void): void;
5463
+ export function generateAppForLink(url: string, title: string, callback: (result: ExtensionInfo) => void): void;
5775
5464
 
5776
5465
  /** Fired when an app or extension has been disabled. */
5777
5466
  export var onDisabled: ManagementDisabledEvent;
@@ -5814,8 +5503,6 @@ declare namespace chrome.networking.config {
5814
5503
  * 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.
5815
5504
  * @param networks Network filters to set. Every NetworkInfo must either have the SSID or HexSSID set. Other fields will be ignored.
5816
5505
  * @param callback Called back when this operation is finished.
5817
- * The callback parameter should be a function that looks like this:
5818
- * function() {...};
5819
5506
  */
5820
5507
  export function setNetworkFilter(networks: NetworkInfo[], callback: () => void): void;
5821
5508
  /**
@@ -5827,8 +5514,6 @@ declare namespace chrome.networking.config {
5827
5514
  * rejected: The extension handled this network, tried to authenticate, however was rejected by the server.
5828
5515
  * failed: The extension handled this network, tried to authenticate, however failed due to an unspecified error.
5829
5516
  * @param callback Called back when this operation is finished.
5830
- * If you specify the callback parameter, it should be a function that looks like this:
5831
- * function() {...};
5832
5517
  */
5833
5518
  export function finishAuthentication(GUID: string, result: string, callback?: () => void): void;
5834
5519
 
@@ -5970,8 +5655,6 @@ declare namespace chrome.notifications {
5970
5655
  * @param options Contents of the notification.
5971
5656
  * @param callback Returns the notification id (either supplied or generated) that represents the created notification.
5972
5657
  * The callback is required before Chrome 42.
5973
- * If you specify the callback parameter, it should be a function that looks like this:
5974
- * function(string notificationId) {...};
5975
5658
  */
5976
5659
  export function create(
5977
5660
  notificationId: string,
@@ -5985,8 +5668,6 @@ declare namespace chrome.notifications {
5985
5668
  * @param options Contents of the notification.
5986
5669
  * @param callback Returns the notification id (either supplied or generated) that represents the created notification.
5987
5670
  * The callback is required before Chrome 42.
5988
- * If you specify the callback parameter, it should be a function that looks like this:
5989
- * function(string notificationId) {...};
5990
5671
  */
5991
5672
  export function create(options: NotificationOptions<true>, callback?: (notificationId: string) => void): void;
5992
5673
  /**
@@ -5995,8 +5676,6 @@ declare namespace chrome.notifications {
5995
5676
  * @param options Contents of the notification to update to.
5996
5677
  * @param callback Called to indicate whether a matching notification existed.
5997
5678
  * The callback is required before Chrome 42.
5998
- * If you specify the callback parameter, it should be a function that looks like this:
5999
- * function(boolean wasUpdated) {...};
6000
5679
  */
6001
5680
  export function update(
6002
5681
  notificationId: string,
@@ -6008,24 +5687,18 @@ declare namespace chrome.notifications {
6008
5687
  * @param notificationId The id of the notification to be cleared. This is returned by notifications.create method.
6009
5688
  * @param callback Called to indicate whether a matching notification existed.
6010
5689
  * The callback is required before Chrome 42.
6011
- * If you specify the callback parameter, it should be a function that looks like this:
6012
- * function(boolean wasCleared) {...};
6013
5690
  */
6014
5691
  export function clear(notificationId: string, callback?: (wasCleared: boolean) => void): void;
6015
5692
  /**
6016
5693
  * Retrieves all the notifications.
6017
5694
  * @since Chrome 29.
6018
5695
  * @param callback Returns the set of notification_ids currently in the system.
6019
- * The callback parameter should be a function that looks like this:
6020
- * function(object notifications) {...};
6021
5696
  */
6022
5697
  export function getAll(callback: (notifications: Object) => void): void;
6023
5698
  /**
6024
5699
  * Retrieves whether the user has enabled notifications from this app or extension.
6025
5700
  * @since Chrome 32.
6026
5701
  * @param callback Returns the current permission level.
6027
- * The callback parameter should be a function that looks like this:
6028
- * function( PermissionLevel level) {...};
6029
5702
  */
6030
5703
  export function getPermissionLevel(callback: (level: string) => void): void;
6031
5704
  }
@@ -6247,21 +5920,15 @@ declare namespace chrome.pageAction {
6247
5920
  /**
6248
5921
  * Gets the title of the page action.
6249
5922
  * @since Chrome 19.
6250
- * @param callback The callback parameter should be a function that looks like this:
6251
- * function(string result) {...};
6252
5923
  */
6253
5924
  export function getTitle(details: GetDetails, callback: (result: string) => void): void;
6254
5925
  /**
6255
5926
  * Gets the html document set as the popup for this page action.
6256
5927
  * @since Chrome 19.
6257
- * @param callback The callback parameter should be a function that looks like this:
6258
- * function(string result) {...};
6259
5928
  */
6260
5929
  export function getPopup(details: GetDetails, callback: (result: string) => void): void;
6261
5930
  /**
6262
5931
  * 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.
6263
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
6264
- * function() {...};
6265
5932
  */
6266
5933
  export function setIcon(details: IconDetails, callback?: () => void): void;
6267
5934
 
@@ -6286,8 +5953,6 @@ declare namespace chrome.pageCapture {
6286
5953
  /**
6287
5954
  * Saves the content of the tab with given id as MHTML.
6288
5955
  * @param callback Called when the MHTML has been generated.
6289
- * The callback parameter should be a function that looks like this:
6290
- * function(binary mhtmlData) {...};
6291
5956
  * Parameter mhtmlData: The MHTML data as a Blob.
6292
5957
  */
6293
5958
  export function saveAsMHTML(details: SaveDetails, callback: (mhtmlData?: Blob) => void): void;
@@ -6315,21 +5980,11 @@ declare namespace chrome.permissions {
6315
5980
  }
6316
5981
 
6317
5982
  export interface PermissionsRemovedEvent {
6318
- /**
6319
- * @param callback The callback parameter should be a function that looks like this:
6320
- * function( Permissions permissions) {...};
6321
- * Parameter permissions: The permissions that have been removed.
6322
- */
6323
- addListener(callback: (permissions: Permissions) => void): void;
5983
+ addListener(callback: (/** The permissions that have been removed*/ permissions: Permissions) => void): void;
6324
5984
  }
6325
5985
 
6326
5986
  export interface PermissionsAddedEvent {
6327
- /**
6328
- * @param callback The callback parameter should be a function that looks like this:
6329
- * function( Permissions permissions) {...};
6330
- * Parameter permissions: The newly acquired permissions.
6331
- */
6332
- addListener(callback: (permissions: Permissions) => void): void;
5987
+ addListener(callback: (/** The newly-acquired permissions*/ permissions: Permissions) => void): void;
6333
5988
  }
6334
5989
 
6335
5990
  /**
@@ -6339,8 +5994,6 @@ declare namespace chrome.permissions {
6339
5994
  export function contains(permissions: Permissions): Promise<boolean>;
6340
5995
  /**
6341
5996
  * Checks if the extension has the specified permissions.
6342
- * @param callback The callback parameter should be a function that looks like this:
6343
- * function(boolean result) {...};
6344
5997
  * Parameter result: True if the extension has the specified permissions.
6345
5998
  */
6346
5999
  export function contains(permissions: Permissions, callback: (result: boolean) => void): void;
@@ -6351,9 +6004,6 @@ declare namespace chrome.permissions {
6351
6004
  export function getAll(): Promise<Permissions>;
6352
6005
  /**
6353
6006
  * Gets the extension's current set of permissions.
6354
- * @param callback The callback parameter should be a function that looks like this:
6355
- * function( Permissions permissions) {...};
6356
- * Parameter permissions: The extension's active permissions.
6357
6007
  */
6358
6008
  export function getAll(callback: (permissions: Permissions) => void): void;
6359
6009
  /**
@@ -6363,8 +6013,6 @@ declare namespace chrome.permissions {
6363
6013
  export function request(permissions: Permissions): Promise<boolean>;
6364
6014
  /**
6365
6015
  * 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.
6366
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
6367
- * function(boolean granted) {...};
6368
6016
  * Parameter granted: True if the user granted the specified permissions.
6369
6017
  */
6370
6018
  export function request(permissions: Permissions, callback?: (granted: boolean) => void): void;
@@ -6375,8 +6023,6 @@ declare namespace chrome.permissions {
6375
6023
  export function remove(permissions: Permissions): Promise<boolean>;
6376
6024
  /**
6377
6025
  * Removes access to the specified permissions. If there are any problems removing the permissions, runtime.lastError will be set.
6378
- * @param callback If you specify the callback parameter, it should be a function that looks like this:
6379
- * function(boolean removed) {...};
6380
6026
  * Parameter removed: True if the permissions were removed.
6381
6027
  */
6382
6028
  export function remove(permissions: Permissions, callback?: (removed: boolean) => void): void;
@@ -6442,8 +6088,6 @@ declare namespace chrome.platformKeys {
6442
6088
 
6443
6089
  /**
6444
6090
  * 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.
6445
- * @param callback The callback parameter should be a function that looks like this:
6446
- * function(array of Match matches) {...};
6447
6091
  * 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.
6448
6092
  */
6449
6093
  export function selectClientCertificates(
@@ -6455,8 +6099,6 @@ declare namespace chrome.platformKeys {
6455
6099
  * @param certificate The certificate of a Match returned by selectClientCertificates.
6456
6100
  * @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.
6457
6101
  * @param callback The public and private CryptoKey of a certificate which can only be used with platformKeys.subtleCrypto.
6458
- * The callback parameter should be a function that looks like this:
6459
- * function(object publicKey, object privateKey) {...};
6460
6102
  * Optional parameter privateKey: Might be null if this extension does not have access to it.
6461
6103
  */
6462
6104
  export function getKeyPair(
@@ -6470,8 +6112,6 @@ declare namespace chrome.platformKeys {
6470
6112
  * @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.
6471
6113
  * 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".
6472
6114
  * @param callback The public and private CryptoKey of a certificate which can only be used with platformKeys.subtleCrypto.
6473
- * The callback parameter should be a function that looks like this:
6474
- * function(object publicKey, object privateKey) {...};
6475
6115
  * Optional parameter privateKey: Might be null if this extension does not have access to it.
6476
6116
  * @since Chrome 85.
6477
6117
  */
@@ -6484,8 +6124,6 @@ declare namespace chrome.platformKeys {
6484
6124
  export function subtleCrypto(): SubtleCrypto;
6485
6125
  /**
6486
6126
  * 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.
6487
- * @param callback The callback parameter should be a function that looks like this:
6488
- * function(object result) {...};
6489
6127
  */
6490
6128
  export function verifyTLSServerCertificate(
6491
6129
  details: ServerCertificateVerificationDetails,
@@ -6732,8 +6370,6 @@ declare namespace chrome.search {
6732
6370
  /**
6733
6371
  * Used to query the default search provider. In case of an error, runtime.lastError will be set.
6734
6372
  * @param options search configuration options.
6735
- * @param callback The callback parameter should be a function that looks like this:
6736
- * function() => {...}
6737
6373
  */
6738
6374
  export function query(options: QueryInfo, callback: () => void): void;
6739
6375
 
@@ -6844,8 +6480,6 @@ declare namespace chrome.serial {
6844
6480
  * @since Chrome 33.
6845
6481
  * @description Returns information about available serial devices on the system. The list is regenerated each time this method is called.
6846
6482
  * @param callback Called with the list of DeviceInfo objects.
6847
- * The callback parameter should be a function that looks like this:
6848
- * function(array of object ports) {...};
6849
6483
  */
6850
6484
  export function getDevices(callback: (ports: DeviceInfo[]) => void): void;
6851
6485
 
@@ -6855,8 +6489,6 @@ declare namespace chrome.serial {
6855
6489
  * @param path The system path of the serial port to open.
6856
6490
  * @param options Port configuration options.
6857
6491
  * @param callback Called when the connection has been opened.
6858
- * The callback parameter should be a function that looks like this:
6859
- * function( ConnectionInfo connectionInfo) {...};
6860
6492
  */
6861
6493
  export function connect(
6862
6494
  path: string,
@@ -6870,8 +6502,6 @@ declare namespace chrome.serial {
6870
6502
  * @param connectionId The id of the opened connection.
6871
6503
  * @param options Port configuration options.
6872
6504
  * @param callback Called when the configuation has completed.
6873
- * The callback parameter should be a function that looks like this:
6874
- * function(boolean result) {...};
6875
6505
  */
6876
6506
  export function update(connectionId: number, options: ConnectionOptions, callback: (result: boolean) => void): void;
6877
6507
 
@@ -6880,8 +6510,6 @@ declare namespace chrome.serial {
6880
6510
  * @description Disconnects from a serial port.
6881
6511
  * @param connectionId The id of the opened connection.
6882
6512
  * @param callback Called when the connection has been closed.
6883
- * The callback parameter should be a function that looks like this:
6884
- * function(boolean result) {...};
6885
6513
  */
6886
6514
  export function disconnect(connectionId: number, callback: (result: boolean) => void): void;
6887
6515
 
@@ -6891,8 +6519,6 @@ declare namespace chrome.serial {
6891
6519
  * @param connectionId The id of the opened connection.
6892
6520
  * @param paused Flag to indicate whether to pause or unpause.
6893
6521
  * @param callback Called when the connection has been successfully paused or unpaused.
6894
- * The callback parameter should be a function that looks like this:
6895
- * function() {...};
6896
6522
  */
6897
6523
  export function setPaused(connectionId: number, paused: boolean, callback: () => void): void;
6898
6524
 
@@ -6900,8 +6526,6 @@ declare namespace chrome.serial {
6900
6526
  * @since Chrome 33.
6901
6527
  * @description Retrieves the state of a given connection.
6902
6528
  * @param callback Called with connection state information when available.
6903
- * The callback parameter should be a function that looks like this:
6904
- * function( ConnectionInfo connectionInfo) {...};
6905
6529
  */
6906
6530
  export function getInfo(callback: (connectionInfos: ConnectionInfo[]) => void): void;
6907
6531
 
@@ -6909,8 +6533,6 @@ declare namespace chrome.serial {
6909
6533
  * @since Chrome 33.
6910
6534
  * @description Retrieves the list of currently opened serial port connections owned by the application.
6911
6535
  * @param callback Called with the list of connections when available.
6912
- * The callback parameter should be a function that looks like this:
6913
- * function(array of ConnectionInfo connectionInfos) {...};
6914
6536
  */
6915
6537
  export function getConnections(callback: (connectionInfos: ConnectionInfo[]) => void): void;
6916
6538
 
@@ -6920,8 +6542,6 @@ declare namespace chrome.serial {
6920
6542
  * @param connectionId The id of the connection.
6921
6543
  * @param data The data to send.
6922
6544
  * @param callback Called when the operation has completed.
6923
- * The callback parameter should be a function that looks like this:
6924
- * function(object sendInfo) {...};
6925
6545
  */
6926
6546
  export function send(connectionId: number, data: ArrayBuffer, callback: (sendInfo: object) => void): void;
6927
6547
 
@@ -6929,8 +6549,6 @@ declare namespace chrome.serial {
6929
6549
  * @description Flushes all bytes in the given connection's input and output buffers.
6930
6550
  * @param connectionId The id of the connection.
6931
6551
  * @param callback
6932
- * The callback parameter should be a function that looks like this:
6933
- * function(boolean result) {...};
6934
6552
  */
6935
6553
  export function flush(connectionId: number, callback: (result: boolean) => void): void;
6936
6554
 
@@ -6938,8 +6556,6 @@ declare namespace chrome.serial {
6938
6556
  * @description Retrieves the state of control signals on a given connection.
6939
6557
  * @param connectionId The id of the connection.
6940
6558
  * @param callback Called when the control signals are available.
6941
- * The callback parameter should be a function that looks like this:
6942
- * function(object signals) {...};
6943
6559
  */
6944
6560
  export function getControlSignals(connectionId: number, callback: (signals: object) => void): void;
6945
6561
 
@@ -6950,8 +6566,6 @@ declare namespace chrome.serial {
6950
6566
  * boolean: (optional) dtr - DTR (Data Terminal Ready).
6951
6567
  * boolean: (optional) rts - RTS (Request To Send).
6952
6568
  * @param callback Called once the control signals have been set.
6953
- * The callback parameter should be a function that looks like this:
6954
- * function(boolean result) {...};
6955
6569
  */
6956
6570
  export function setControlSignals(connectionId: number, signals: object, callback: (result: boolean) => void): void;
6957
6571
 
@@ -6960,8 +6574,6 @@ declare namespace chrome.serial {
6960
6574
  * @description Suspends character transmission on a given connection and places the transmission line in a break state until the clearBreak is called.
6961
6575
  * @param connectionId The id of the connection.
6962
6576
  * @param callback
6963
- * The callback parameter should be a function that looks like this:
6964
- * function(boolean result) {...};
6965
6577
  */
6966
6578
  export function setBreak(connectionId: number, callback: (result: boolean) => void): void;
6967
6579
 
@@ -6970,8 +6582,6 @@ declare namespace chrome.serial {
6970
6582
  * @description Restore character transmission on a given connection and place the transmission line in a nonbreak state.
6971
6583
  * @param connectionId The id of the connection.
6972
6584
  * @param callback
6973
- * The callback parameter should be a function that looks like this:
6974
- * function(boolean result) {...};
6975
6585
  */
6976
6586
  export function clearBreak(connectionId: number, callback: (result: boolean) => void): void;
6977
6587
  }
@@ -6988,8 +6598,6 @@ declare namespace chrome.serial.onReceive {
6988
6598
  * @since Chrome 33.
6989
6599
  * @description Event raised when data has been read from the connection.
6990
6600
  * @param callback
6991
- * The callback parameter should be a function that looks like this:
6992
- * function(OnReceiveInfo info) {...};
6993
6601
  */
6994
6602
  export function addListener(callback: (info: OnReceiveInfo) => void): void;
6995
6603
  }
@@ -7028,8 +6636,6 @@ declare namespace chrome.serial.onReceiveError {
7028
6636
  * @description Event raised when an error occurred while the runtime was waiting for data on the serial port.
7029
6637
  * Once this event is raised, the connection may be set to paused. A "timeout" error does not pause the connection.
7030
6638
  * @param callback
7031
- * The callback parameter should be a function that looks like this:
7032
- * function(OnReceiveErrorInfo info) {...};
7033
6639
  */
7034
6640
  export function addListener(callback: (info: OnReceiveErrorInfo) => void): void;
7035
6641
  }
@@ -7837,7 +7443,7 @@ declare namespace chrome.scripting {
7837
7443
  * @param callback
7838
7444
  * Invoked upon completion of the injection. The resulting array contains the result of execution for each frame where the injection succeeded.
7839
7445
  */
7840
- export function executeScript<Args extends any[], Result>(injection: ScriptInjection<Args, Result>, callback?: (results: InjectionResult<Awaited<Result>>[]) => void): void;
7446
+ export function executeScript<Args extends any[], Result>(injection: ScriptInjection<Args, Result>, callback: (results: InjectionResult<Awaited<Result>>[]) => void): void;
7841
7447
 
7842
7448
  /**
7843
7449
  * Inserts a CSS stylesheet into a target context. If multiple frames are specified, unsuccessful injections are ignored.
@@ -7854,7 +7460,7 @@ declare namespace chrome.scripting {
7854
7460
  * @param callback
7855
7461
  * Invoked upon completion of the injection.
7856
7462
  */
7857
- export function insertCSS(injection: CSSInjection, callback?: () => void): void;
7463
+ export function insertCSS(injection: CSSInjection, callback: () => void): void;
7858
7464
 
7859
7465
  /**
7860
7466
  * Removes a CSS stylesheet that was previously inserted by this extension from a target context.
@@ -7877,7 +7483,7 @@ declare namespace chrome.scripting {
7877
7483
  * Invoked upon completion of the removal.
7878
7484
  * @since Chrome 90
7879
7485
  */
7880
- export function removeCSS(injection: CSSInjection, callback?: () => void): void;
7486
+ export function removeCSS(injection: CSSInjection, callback: () => void): void;
7881
7487
 
7882
7488
  /**
7883
7489
  * Registers one or more content scripts.
@@ -7890,7 +7496,7 @@ declare namespace chrome.scripting {
7890
7496
  * @param scripts
7891
7497
  * @param callback
7892
7498
  */
7893
- export function registerContentScripts(scripts: RegisteredContentScript[], callback?: () => void): void;
7499
+ export function registerContentScripts(scripts: RegisteredContentScript[], callback: () => void): void;
7894
7500
 
7895
7501
  /**
7896
7502
  * Unregister one or more content scripts.
@@ -7904,7 +7510,8 @@ declare namespace chrome.scripting {
7904
7510
  * @param filter
7905
7511
  * @param callback
7906
7512
  */
7907
- export function unregisterContentScripts(filter?: ContentScriptFilter, callback?: () => void): void;
7513
+ export function unregisterContentScripts(callback: () => void): void;
7514
+ export function unregisterContentScripts(filter: ContentScriptFilter, callback: () => void): void;
7908
7515
 
7909
7516
  /**
7910
7517
  * Returns all the content scripts registered with scripting.registerContentScripts()
@@ -7919,7 +7526,8 @@ declare namespace chrome.scripting {
7919
7526
  * @param filter
7920
7527
  * @param callback
7921
7528
  */
7922
- export function getRegisteredContentScripts(filter?: ContentScriptFilter, callback?: (scripts: RegisteredContentScript[]) => void): void;
7529
+ export function getRegisteredContentScripts(callback: (scripts: RegisteredContentScript[]) => void): void;
7530
+ export function getRegisteredContentScripts(filter: ContentScriptFilter, callback: (scripts: RegisteredContentScript[]) => void): void;
7923
7531
  }
7924
7532
 
7925
7533
  ////////////////////
@@ -8070,7 +7678,7 @@ declare namespace chrome.storage {
8070
7678
  * @param callback Optional.
8071
7679
  * Callback on success, or on failure (in which case runtime.lastError will be set).
8072
7680
  */
8073
- clear(callback?: () => void): void;
7681
+ clear(callback: () => void): void;
8074
7682
  /**
8075
7683
  * Sets multiple items.
8076
7684
  * @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.
@@ -8086,7 +7694,7 @@ declare namespace chrome.storage {
8086
7694
  * @param callback Optional.
8087
7695
  * Callback on success, or on failure (in which case runtime.lastError will be set).
8088
7696
  */
8089
- set(items: { [key: string]: any }, callback?: () => void): void;
7697
+ set(items: { [key: string]: any }, callback: () => void): void;
8090
7698
  /**
8091
7699
  * Removes one or more items from storage.
8092
7700
  * @param keys A single key or a list of keys for items to remove.
@@ -8101,7 +7709,7 @@ declare namespace chrome.storage {
8101
7709
  * @param callback Optional.
8102
7710
  * Callback on success, or on failure (in which case runtime.lastError will be set).
8103
7711
  */
8104
- remove(keys: string | string[], callback?: () => void): void;
7712
+ remove(keys: string | string[], callback: () => void): void;
8105
7713
  /**
8106
7714
  * Gets the entire contents of storage.
8107
7715
  * @param callback Callback with storage items, or on failure (in which case runtime.lastError will be set).
@@ -8844,7 +8452,7 @@ declare namespace chrome.system.display {
8844
8452
  * @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|.
8845
8453
  * @param [callback] Empty function called when the function finishes. To find out whether the function succeeded, runtime.lastError should be queried.
8846
8454
  */
8847
- export function setDisplayProperties(id: string, info: DisplayPropertiesInfo, callback?: () => void): void;
8455
+ export function setDisplayProperties(id: string, info: DisplayPropertiesInfo, callback: () => void): void;
8848
8456
 
8849
8457
  /**
8850
8458
  * requires(CrOS Kiosk apps | WebUI) This is only available to Chrome OS Kiosk apps and Web UI.
@@ -8870,7 +8478,7 @@ declare namespace chrome.system.display {
8870
8478
  * @param layouts The layout information, required for all displays except the primary display.
8871
8479
  * @param callback Empty function called when the function finishes. To find out whether the function succeeded, runtime.lastError should be queried.
8872
8480
  */
8873
- export function setDisplayLayout(layouts: DisplayLayout[], callback?: () => void): void;
8481
+ export function setDisplayLayout(layouts: DisplayLayout[], callback: () => void): void;
8874
8482
 
8875
8483
  /**
8876
8484
  * requires(CrOS Kiosk apps | WebUI) This is only available to Chrome OS Kiosk apps and Web UI.
@@ -9689,7 +9297,7 @@ declare namespace chrome.tabs {
9689
9297
  * @param callback Optional.
9690
9298
  * Parameter tab: Details about the created tab. Will contain the ID of the new tab.
9691
9299
  */
9692
- export function create(createProperties: CreateProperties, callback?: (tab: Tab) => void): void;
9300
+ export function create(createProperties: CreateProperties, callback: (tab: Tab) => void): void;
9693
9301
  /**
9694
9302
  * 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.
9695
9303
  * @param tabId The tab to move.
@@ -9702,7 +9310,7 @@ declare namespace chrome.tabs {
9702
9310
  * @param callback Optional.
9703
9311
  * Parameter tab: Details about the moved tab.
9704
9312
  */
9705
- export function move(tabId: number, moveProperties: MoveProperties, callback?: (tab: Tab) => void): void;
9313
+ export function move(tabId: number, moveProperties: MoveProperties, callback: (tab: Tab) => void): void;
9706
9314
  /**
9707
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.
9708
9316
  * @param tabIds The tabs to move.
@@ -9715,7 +9323,7 @@ declare namespace chrome.tabs {
9715
9323
  * @param callback Optional.
9716
9324
  * Parameter tabs: Details about the moved tabs.
9717
9325
  */
9718
- export function move(tabIds: number[], moveProperties: MoveProperties, callback?: (tabs: Tab[]) => void): void;
9326
+ export function move(tabIds: number[], moveProperties: MoveProperties, callback: (tabs: Tab[]) => void): void;
9719
9327
  /**
9720
9328
  * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
9721
9329
  * @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.
@@ -9726,7 +9334,7 @@ declare namespace chrome.tabs {
9726
9334
  * @param callback Optional.
9727
9335
  * 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.
9728
9336
  */
9729
- export function update(updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void;
9337
+ export function update(updateProperties: UpdateProperties, callback: (tab?: Tab) => void): void;
9730
9338
  /**
9731
9339
  * Modifies the properties of a tab. Properties that are not specified in updateProperties are not modified.
9732
9340
  * @param tabId Defaults to the selected tab of the current window.
@@ -9739,7 +9347,7 @@ declare namespace chrome.tabs {
9739
9347
  * @param callback Optional.
9740
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.
9741
9349
  */
9742
- export function update(tabId: number, updateProperties: UpdateProperties, callback?: (tab?: Tab) => void): void;
9350
+ export function update(tabId: number, updateProperties: UpdateProperties, callback: (tab?: Tab) => void): void;
9743
9351
  /**
9744
9352
  * Closes a tab.
9745
9353
  * @param tabId The tab to close.
@@ -9750,7 +9358,7 @@ declare namespace chrome.tabs {
9750
9358
  * Closes a tab.
9751
9359
  * @param tabId The tab to close.
9752
9360
  */
9753
- export function remove(tabId: number, callback?: Function): void;
9361
+ export function remove(tabId: number, callback: Function): void;
9754
9362
  /**
9755
9363
  * Closes several tabs.
9756
9364
  * @param tabIds The list of tabs to close.
@@ -9761,7 +9369,7 @@ declare namespace chrome.tabs {
9761
9369
  * Closes several tabs.
9762
9370
  * @param tabIds The list of tabs to close.
9763
9371
  */
9764
- export function remove(tabIds: number[], callback?: Function): void;
9372
+ export function remove(tabIds: number[], callback: Function): void;
9765
9373
  /**
9766
9374
  * Captures the visible area of the currently active tab in the specified window. You must have <all_urls> permission to use this method.
9767
9375
  * @param callback
@@ -9844,7 +9452,7 @@ declare namespace chrome.tabs {
9844
9452
  * Reload the selected tab of the current window.
9845
9453
  * @since Chrome 16.
9846
9454
  */
9847
- export function reload(reloadProperties: ReloadProperties, callback?: () => void): void;
9455
+ export function reload(reloadProperties: ReloadProperties, callback: () => void): void;
9848
9456
  /**
9849
9457
  * Reload the selected tab of the current window.
9850
9458
  * @since Chrome 16.
@@ -9855,7 +9463,7 @@ declare namespace chrome.tabs {
9855
9463
  * Reload the selected tab of the current window.
9856
9464
  * @since Chrome 16.
9857
9465
  */
9858
- export function reload(callback?: () => void): void;
9466
+ export function reload(callback: () => void): void;
9859
9467
  /**
9860
9468
  * Duplicates a tab.
9861
9469
  * @since Chrome 23.
@@ -9870,7 +9478,7 @@ declare namespace chrome.tabs {
9870
9478
  * @param callback Optional.
9871
9479
  * 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.
9872
9480
  */
9873
- export function duplicate(tabId: number, callback?: (tab?: Tab) => void): void;
9481
+ export function duplicate(tabId: number, callback: (tab?: Tab) => void): void;
9874
9482
  /**
9875
9483
  * 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.
9876
9484
  * @since Chrome 20.
@@ -9922,7 +9530,7 @@ declare namespace chrome.tabs {
9922
9530
  * @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.
9923
9531
  * @param callback Optional. Called when all the CSS has been inserted.
9924
9532
  */
9925
- export function insertCSS(details: InjectDetails, callback?: Function): void;
9533
+ export function insertCSS(details: InjectDetails, callback: Function): void;
9926
9534
  /**
9927
9535
  * Injects CSS into a page. For details, see the programmatic injection section of the content scripts doc.
9928
9536
  * @param tabId Optional. The ID of the tab in which to insert the CSS; defaults to the active tab of the current window.
@@ -9936,7 +9544,7 @@ declare namespace chrome.tabs {
9936
9544
  * @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.
9937
9545
  * @param callback Optional. Called when all the CSS has been inserted.
9938
9546
  */
9939
- export function insertCSS(tabId: number, details: InjectDetails, callback?: Function): void;
9547
+ export function insertCSS(tabId: number, details: InjectDetails, callback: Function): void;
9940
9548
  /**
9941
9549
  * Highlights the given tabs.
9942
9550
  * @since Chrome 16.
@@ -9949,7 +9557,7 @@ declare namespace chrome.tabs {
9949
9557
  * @param callback Optional.
9950
9558
  * Parameter window: Contains details about the window whose tabs were highlighted.
9951
9559
  */
9952
- export function highlight(highlightInfo: HighlightInfo, callback?: (window: chrome.windows.Window) => void): void;
9560
+ export function highlight(highlightInfo: HighlightInfo, callback: (window: chrome.windows.Window) => void): void;
9953
9561
  /**
9954
9562
  * Gets all tabs that have the specified properties, or all tabs if no properties are specified.
9955
9563
  * @since Chrome 16.
@@ -9998,7 +9606,7 @@ declare namespace chrome.tabs {
9998
9606
  * @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.
9999
9607
  * @param callback Optional. Called after the zoom factor has been changed.
10000
9608
  */
10001
- export function setZoom(zoomFactor: number, callback?: () => void): void;
9609
+ export function setZoom(zoomFactor: number, callback: () => void): void;
10002
9610
  /**
10003
9611
  * Zooms a specified tab.
10004
9612
  * @since Chrome 42.
@@ -10014,7 +9622,7 @@ declare namespace chrome.tabs {
10014
9622
  * @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.
10015
9623
  * @param callback Optional. Called after the zoom factor has been changed.
10016
9624
  */
10017
- export function setZoom(tabId: number, zoomFactor: number, callback?: () => void): void;
9625
+ export function setZoom(tabId: number, zoomFactor: number, callback: () => void): void;
10018
9626
  /**
10019
9627
  * Gets the current zoom factor of a specified tab.
10020
9628
  * @since Chrome 42.
@@ -10056,7 +9664,7 @@ declare namespace chrome.tabs {
10056
9664
  * @param zoomSettings Defines how zoom changes are handled and at what scope.
10057
9665
  * @param callback Optional. Called after the zoom settings have been changed.
10058
9666
  */
10059
- export function setZoomSettings(zoomSettings: ZoomSettings, callback?: () => void): void;
9667
+ export function setZoomSettings(zoomSettings: ZoomSettings, callback: () => void): void;
10060
9668
  /**
10061
9669
  * 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.
10062
9670
  * @since Chrome 42.
@@ -10072,7 +9680,7 @@ declare namespace chrome.tabs {
10072
9680
  * @param zoomSettings Defines how zoom changes are handled and at what scope.
10073
9681
  * @param callback Optional. Called after the zoom settings have been changed.
10074
9682
  */
10075
- export function setZoomSettings(tabId: number, zoomSettings: ZoomSettings, callback?: () => void): void;
9683
+ export function setZoomSettings(tabId: number, zoomSettings: ZoomSettings, callback: () => void): void;
10076
9684
  /**
10077
9685
  * Gets the current zoom settings of a specified tab.
10078
9686
  * @since Chrome 42.
@@ -10114,7 +9722,8 @@ declare namespace chrome.tabs {
10114
9722
  * @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.
10115
9723
  * @param callback Called after the operation is completed.
10116
9724
  */
10117
- export function discard(tabId?: number, callback?: (tab: Tab) => void): void;
9725
+ export function discard(callback: (tab: Tab) => void): void;
9726
+ export function discard(tabId: number, callback: (tab: Tab) => void): void;
10118
9727
  /**
10119
9728
  * Go foward to the next page, if one is available.
10120
9729
  * @since Chrome 72.
@@ -10126,7 +9735,7 @@ declare namespace chrome.tabs {
10126
9735
  * @since Chrome 72.
10127
9736
  * @param callback Optional. Called after the operation is completed.
10128
9737
  */
10129
- export function goForward(callback?: () => void): void;
9738
+ export function goForward(callback: () => void): void;
10130
9739
  /**
10131
9740
  * Go foward to the next page, if one is available.
10132
9741
  * @since Chrome 72.
@@ -10140,7 +9749,7 @@ declare namespace chrome.tabs {
10140
9749
  * @param tabId Optional. The ID of the tab to navigate forward; defaults to the selected tab of the current window.
10141
9750
  * @param callback Optional. Called after the operation is completed.
10142
9751
  */
10143
- export function goForward(tabId: number, callback?: () => void): void;
9752
+ export function goForward(tabId: number, callback: () => void): void;
10144
9753
  /**
10145
9754
  * Go back to the previous page, if one is available.
10146
9755
  * @since Chrome 72.
@@ -10152,7 +9761,7 @@ declare namespace chrome.tabs {
10152
9761
  * @since Chrome 72.
10153
9762
  * @param callback Optional. Called after the operation is completed.
10154
9763
  */
10155
- export function goBack(callback?: () => void): void;
9764
+ export function goBack(callback: () => void): void;
10156
9765
  /**
10157
9766
  * Go back to the previous page, if one is available.
10158
9767
  * @since Chrome 72.
@@ -10166,7 +9775,7 @@ declare namespace chrome.tabs {
10166
9775
  * @param tabId Optional. The ID of the tab to navigate back; defaults to the selected tab of the current window.
10167
9776
  * @param callback Optional. Called after the operation is completed.
10168
9777
  */
10169
- export function goBack(tabId: number, callback?: () => void): void;
9778
+ export function goBack(tabId: number, callback: () => void): void;
10170
9779
  /**
10171
9780
  * Adds one or more tabs to a specified group, or if no group is specified, adds the given tabs to a newly created group.
10172
9781
  * @since Chrome 88
@@ -10187,7 +9796,7 @@ declare namespace chrome.tabs {
10187
9796
  * @param options Configurations object
10188
9797
  * @param callback Optional.
10189
9798
  */
10190
- export function group(options: GroupOptions, callback?: (groupId: number) => void): void
9799
+ export function group(options: GroupOptions, callback: (groupId: number) => void): void
10191
9800
  /**
10192
9801
  * Removes one or more tabs from their respective groups. If any groups become empty, they are deleted
10193
9802
  * @since Chrome 88
@@ -10201,7 +9810,7 @@ declare namespace chrome.tabs {
10201
9810
  * @param tabIds The tabs to ungroup.
10202
9811
  * @param callback Optional. Called after the operation is completed.
10203
9812
  */
10204
- export function ungroup(tabIds: number | number[], callback?: () => void): void
9813
+ export function ungroup(tabIds: number | number[], callback: () => void): void
10205
9814
  /**
10206
9815
  * Fired when the highlighted or selected tabs in a window changes.
10207
9816
  * @since Chrome 18.
@@ -10342,7 +9951,7 @@ declare namespace chrome.tabGroups {
10342
9951
  * @param moveProperties Information on how to move the group.
10343
9952
  * @param callback Optional.
10344
9953
  */
10345
- export function move(groupId: number, moveProperties: MoveProperties, callback?: (group: TabGroup) => void): void;
9954
+ export function move(groupId: number, moveProperties: MoveProperties, callback: (group: TabGroup) => void): void;
10346
9955
 
10347
9956
  /**
10348
9957
  * Gets all groups that have the specified properties, or all groups if no properties are specified.
@@ -10372,7 +9981,7 @@ declare namespace chrome.tabGroups {
10372
9981
  * @param updateProperties Information on how to update the group.
10373
9982
  * @param callback Optional.
10374
9983
  */
10375
- export function update(groupId: number, updateProperties: UpdateProperties, callback?: (group: TabGroup) => void): void;
9984
+ export function update(groupId: number, updateProperties: UpdateProperties, callback: (group: TabGroup) => void): void;
10376
9985
 
10377
9986
  export interface TabGroupCreatedEvent extends chrome.events.Event<(group: TabGroup) => void> { }
10378
9987
  export interface TabGroupMovedEvent extends chrome.events.Event<(group: TabGroup) => void> { }
@@ -11642,7 +11251,7 @@ declare namespace chrome.windows {
11642
11251
  * @param callback
11643
11252
  * Optional parameter window: Contains details about the created window.
11644
11253
  */
11645
- export function create(callback?: (window?: chrome.windows.Window) => void): void;
11254
+ export function create(callback: (window?: chrome.windows.Window) => void): void;
11646
11255
  /**
11647
11256
  * Creates (opens) a new browser with any optional sizing, position or default URL provided.
11648
11257
  * @param CreateData
@@ -11655,7 +11264,7 @@ declare namespace chrome.windows {
11655
11264
  * @param callback
11656
11265
  * Optional parameter window: Contains details about the created window.
11657
11266
  */
11658
- export function create(createData: CreateData, callback?: (window?: chrome.windows.Window) => void): void;
11267
+ export function create(createData: CreateData, callback: (window?: chrome.windows.Window) => void): void;
11659
11268
  /**
11660
11269
  * Gets all windows.
11661
11270
  */
@@ -11688,7 +11297,7 @@ declare namespace chrome.windows {
11688
11297
  export function update(
11689
11298
  windowId: number,
11690
11299
  updateInfo: UpdateInfo,
11691
- callback?: (window: chrome.windows.Window) => void,
11300
+ callback: (window: chrome.windows.Window) => void,
11692
11301
  ): void;
11693
11302
  /**
11694
11303
  * Removes (closes) a window, and all the tabs inside it
@@ -11696,7 +11305,7 @@ declare namespace chrome.windows {
11696
11305
  */
11697
11306
  export function remove(windowId: number): Promise<void>;
11698
11307
  /** Removes (closes) a window, and all the tabs inside it. */
11699
- export function remove(windowId: number, callback?: Function): void;
11308
+ export function remove(windowId: number, callback: Function): void;
11700
11309
  /**
11701
11310
  * Gets the window that was most recently focused — typically the window 'on top'.
11702
11311
  */