-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathchrome-promise.d.ts
2512 lines (2511 loc) · 149 KB
/
chrome-promise.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Type definitions for chrome-promise
// Project: https://github.com/tfoxy/chrome-promise
// Definitions by: Tomás Fox <https://github.com/tfoxy>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export default class ChromePromise {
constructor(options?: {
chrome?: object;
Promise?: Function;
});
accessibilityFeatures: chromepApi.accessibilityFeatures.AccessibilityFeatures;
alarms: chromepApi.alarms.Alarms;
browser: chromepApi.browser.Browser;
bookmarks: chromepApi.bookmarks.Bookmarks;
browserAction: chromepApi.browserAction.BrowserAction;
browsingData: chromepApi.browsingData.BrowsingData;
commands: chromepApi.commands.Commands;
contentSettings: chromepApi.contentSettings.ContentSettings;
contextMenus: chromepApi.contextMenus.ContextMenus;
cookies: chromepApi.cookies.Cookies;
declarativeContent: chromepApi.declarativeContent.DeclarativeContent;
declarativeWebRequest: chromepApi.declarativeWebRequest.DeclarativeWebRequest;
desktopCapture: chromepApi.desktopCapture.DesktopCapture;
documentScan: chromepApi.documentScan.DocumentScan;
downloads: chromepApi.downloads.Downloads;
events: chromepApi.events.Events;
extension: chromepApi.extension.Extension;
fileBrowserHandler: chromepApi.fileBrowserHandler.FileBrowserHandler;
fileSystemProvider: chromepApi.fileSystemProvider.FileSystemProvider;
fontSettings: chromepApi.fontSettings.FontSettings;
gcm: chromepApi.gcm.Gcm;
history: chromepApi.history.History;
i18n: chromepApi.i18n.I18n;
identity: chromepApi.identity.Identity;
idle: chromepApi.idle.Idle;
management: chromepApi.management.Management;
notifications: chromepApi.notifications.Notifications;
omnibox: chromepApi.omnibox.Omnibox;
pageAction: chromepApi.pageAction.PageAction;
pageCapture: chromepApi.pageCapture.PageCapture;
permissions: chromepApi.permissions.Permissions;
platformKeys: chromepApi.platformKeys.PlatformKeys;
power: chromepApi.power.Power;
printerProvider: chromepApi.printerProvider.PrinterProvider;
privacy: chromepApi.privacy.Privacy;
proxy: chromepApi.proxy.Proxy;
serial: chromepApi.serial.Serial;
runtime: chromepApi.runtime.Runtime;
scriptBadge: chromepApi.scriptBadge.ScriptBadge;
sessions: chromepApi.sessions.Sessions;
storage: chromepApi.storage.Storage;
socket: chromepApi.socket.Socket;
tabCapture: chromepApi.tabCapture.TabCapture;
tabs: chromepApi.tabs.Tabs;
topSites: chromepApi.topSites.TopSites;
tts: chromepApi.tts.Tts;
ttsEngine: chromepApi.ttsEngine.TtsEngine;
types: chromepApi.types.Types;
vpnProvider: chromepApi.vpnProvider.VpnProvider;
wallpaper: chromepApi.wallpaper.Wallpaper;
webNavigation: chromepApi.webNavigation.WebNavigation;
webRequest: chromepApi.webRequest.WebRequest;
webstore: chromepApi.webstore.Webstore;
windows: chromepApi.windows.Windows;
}
declare namespace chromepApi.accessibilityFeatures {
export interface AccessibilityFeaturesSetting {
/**
* Gets the value of a setting.
* @param details Which setting to consider.
* @param callback The callback parameter should be a function that looks like this:
* function(object details) {...};
*/
get(details: chrome.accessibilityFeatures.AccessibilityFeaturesGetArg): Promise<chrome.accessibilityFeatures.AccessibilityFeaturesCallbackArg>;
/**
* Sets the value of a setting.
* @param details Which setting to change.
* @param callback Called at the completion of the set operation.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
set(details: chrome.accessibilityFeatures.AccessibilityFeaturesSetArg): Promise<void>;
/**
* Clears the setting, restoring any default value.
* @param details Which setting to clear.
* @param callback Called at the completion of the clear operation.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
clear(details: chrome.accessibilityFeatures.AccessibilityFeaturesClearArg): Promise<void>;
}
export interface AccessibilityFeatures {
spokenFeedback: AccessibilityFeaturesSetting;
largeCursor: AccessibilityFeaturesSetting;
stickyKeys: AccessibilityFeaturesSetting;
highContrast: AccessibilityFeaturesSetting;
screenMagnifier: AccessibilityFeaturesSetting;
autoclick: AccessibilityFeaturesSetting;
virtualKeyboard: AccessibilityFeaturesSetting;
animationPolicy: AccessibilityFeaturesSetting;
}
}
declare namespace chromepApi.alarms {
export interface AlarmEvent extends chrome.events.Event<(alarm: chrome.alarms.Alarm) => void> {
}
export interface Alarms {
/**
* Gets an array of all the alarms.
* @param callback The callback parameter should be a function that looks like this:
* function(array of Alarm alarms) {...};
*/
getAll(): Promise<chrome.alarms.Alarm[]>;
/**
* Clears all alarms.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function(boolean wasCleared) {...};
*/
clearAll(): Promise<boolean>;
/**
* Clears the alarm with the given name.
* @param name The name of the alarm to clear. Defaults to the empty string.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function(boolean wasCleared) {...};
*/
clear(name?: string): Promise<boolean>;
/**
* Clears the alarm without a name.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function(boolean wasCleared) {...};
*/
clear(): Promise<boolean>;
/**
* Retrieves details about the specified alarm.
* @param callback The callback parameter should be a function that looks like this:
* function( Alarm alarm) {...};
*/
get(): Promise<chrome.alarms.Alarm>;
/**
* Retrieves details about the specified alarm.
* @param name The name of the alarm to get. Defaults to the empty string.
* @param callback The callback parameter should be a function that looks like this:
* function( Alarm alarm) {...};
*/
get(name: string): Promise<chrome.alarms.Alarm>;
onAlarm: AlarmEvent;
}
}
declare namespace chromepApi.browser {
export interface Browser {
/**
* Opens a new tab in a browser window associated with the current application
* and Chrome profile. If no browser window for the Chrome profile is opened,
* a new one is opened prior to creating the new tab.
* @param options Configures how the tab should be opened.
* @param callback Called when the tab was successfully
* created, or failed to be created. If failed, runtime.lastError will be set.
*/
openTab(options: chrome.browser.Options): Promise<void>;
}
}
declare namespace chromepApi.bookmarks {
export interface BookmarkRemovedEvent extends chrome.events.Event<(id: string, removeInfo: chrome.bookmarks.BookmarkRemoveInfo) => void> {
}
export interface BookmarkImportEndedEvent extends chrome.events.Event<() => void> {
}
export interface BookmarkImportBeganEvent extends chrome.events.Event<() => void> {
}
export interface BookmarkChangedEvent extends chrome.events.Event<(id: string, changeInfo: chrome.bookmarks.BookmarkChangeInfo) => void> {
}
export interface BookmarkMovedEvent extends chrome.events.Event<(id: string, moveInfo: chrome.bookmarks.BookmarkMoveInfo) => void> {
}
export interface BookmarkCreatedEvent extends chrome.events.Event<(id: string, bookmark: chrome.bookmarks.BookmarkTreeNode) => void> {
}
export interface BookmarkChildrenReordered extends chrome.events.Event<(id: string, reorderInfo: chrome.bookmarks.BookmarkReorderInfo) => void> {
}
export interface Bookmarks {
/**
* Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
* @param query A string of words and quoted phrases that are matched against bookmark URLs and titles.
* @param callback The callback parameter should be a function that looks like this:
* function(array of BookmarkTreeNode results) {...};
*/
search(query: string): Promise<chrome.bookmarks.BookmarkTreeNode[]>;
/**
* Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.
* @param query An object with one or more of the properties query, url, and title specified. Bookmarks matching all specified properties will be produced.
* @param callback The callback parameter should be a function that looks like this:
* function(array of BookmarkTreeNode results) {...};
*/
search(query: chrome.bookmarks.BookmarkSearchQuery): Promise<chrome.bookmarks.BookmarkTreeNode[]>;
/**
* Retrieves the entire Bookmarks hierarchy.
* @param callback The callback parameter should be a function that looks like this:
* function(array of BookmarkTreeNode results) {...};
*/
getTree(): Promise<chrome.bookmarks.BookmarkTreeNode[]>;
/**
* Retrieves the recently added bookmarks.
* @param numberOfItems The maximum number of items to return.
* @param callback The callback parameter should be a function that looks like this:
* function(array of BookmarkTreeNode results) {...};
*/
getRecent(numberOfItems: number): Promise<chrome.bookmarks.BookmarkTreeNode[]>;
/**
* Retrieves the specified BookmarkTreeNode.
* @param id A single string-valued id
* @param callback The callback parameter should be a function that looks like this:
* function(array of BookmarkTreeNode results) {...};
*/
get(id: string): Promise<chrome.bookmarks.BookmarkTreeNode[]>;
/**
* Retrieves the specified BookmarkTreeNode.
* @param idList An array of string-valued ids
* @param callback The callback parameter should be a function that looks like this:
* function(array of BookmarkTreeNode results) {...};
*/
get(idList: string[]): Promise<chrome.bookmarks.BookmarkTreeNode[]>;
/**
* Creates a bookmark or folder under the specified parentId. If url is NULL or missing, it will be a folder.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function( BookmarkTreeNode result) {...};
*/
create(bookmark: chrome.bookmarks.BookmarkCreateArg): Promise<chrome.bookmarks.BookmarkTreeNode>;
/**
* Moves the specified BookmarkTreeNode to the provided location.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function( BookmarkTreeNode result) {...};
*/
move(id: string, destination: chrome.bookmarks.BookmarkDestinationArg): Promise<chrome.bookmarks.BookmarkTreeNode>;
/**
* 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.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function( BookmarkTreeNode result) {...};
*/
update(id: string, changes: chrome.bookmarks.BookmarkChangesArg): Promise<chrome.bookmarks.BookmarkTreeNode>;
/**
* Removes a bookmark or an empty bookmark folder.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
remove(id: string): Promise<void>;
/**
* Retrieves the children of the specified BookmarkTreeNode id.
* @param callback The callback parameter should be a function that looks like this:
* function(array of BookmarkTreeNode results) {...};
*/
getChildren(id: string): Promise<chrome.bookmarks.BookmarkTreeNode[]>;
/**
* Since Chrome 14.
* Retrieves part of the Bookmarks hierarchy, starting at the specified node.
* @param id The ID of the root of the subtree to retrieve.
* @param callback The callback parameter should be a function that looks like this:
* function(array of BookmarkTreeNode results) {...};
*/
getSubTree(id: string): Promise<chrome.bookmarks.BookmarkTreeNode[]>;
/**
* Recursively removes a bookmark folder.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeTree(id: string): Promise<void>;
onRemoved: BookmarkRemovedEvent;
onImportEnded: BookmarkImportEndedEvent;
onImportBegan: BookmarkImportBeganEvent;
onChanged: BookmarkChangedEvent;
onMoved: BookmarkMovedEvent;
onCreated: BookmarkCreatedEvent;
onChildrenReordered: BookmarkChildrenReordered;
}
}
declare namespace chromepApi.browserAction {
export interface BrowserClickedEvent extends chrome.events.Event<(tab: chrome.tabs.Tab) => void> {
}
export interface BrowserAction {
/**
* Since Chrome 22.
* Enables the browser action for a tab. By default, browser actions are enabled.
* @param tabId The id of the tab for which you want to modify the browser action.
* @param callback Supported since Chrome 67
*/
enable(tabId?: number): Promise<void>;
/**
* Sets the background color for the badge.
* @param callback Supported since Chrome 67
*/
setBadgeBackgroundColor(details: chrome.browserAction.BadgeBackgroundColorDetails): Promise<void>;
/**
* Sets the badge text for the browser action. The badge is displayed on top of the icon.
* @param callback Supported since Chrome 67
*/
setBadgeText(details: chrome.browserAction.BadgeTextDetails): Promise<void>;
/**
* Sets the title of the browser action. This shows up in the tooltip.
* @param callback Supported since Chrome 67
*/
setTitle(details: chrome.browserAction.TitleDetails): Promise<void>;
/**
* Since Chrome 19.
* Gets the badge text of the browser action. If no tab is specified, the non-tab-specific badge text is returned.
* @param callback Supported since Chrome 67
*/
getBadgeText(details: chrome.browserAction.TabDetails): Promise<string>;
/**
* Sets the html document to be opened as a popup when the user clicks on the browser action's icon.
* @param callback Supported since Chrome 67
*/
setPopup(details: chrome.browserAction.PopupDetails): Promise<void>;
/**
* Since Chrome 22.
* Disables the browser action for a tab.
* @param tabId The id of the tab for which you want to modify the browser action.
* @param callback Supported since Chrome 67
*/
disable(tabId?: number): Promise<void>;
/**
* Since Chrome 19.
* Gets the title of the browser action.
* @param callback The callback parameter should be a function that looks like this:
* function(string result) {...};
*/
getTitle(details: chrome.browserAction.TabDetails): Promise<string>;
/**
* Since Chrome 19.
* Gets the background color of the browser action.
* @param callback The callback parameter should be a function that looks like this:
* function( ColorArray result) {...};
*/
getBadgeBackgroundColor(details: chrome.browserAction.TabDetails): Promise<chrome.browserAction.ColorArray>;
/**
* Since Chrome 19.
* Gets the html document set as the popup for this browser action.
* @param callback The callback parameter should be a function that looks like this:
* function(string result) {...};
*/
getPopup(details: chrome.browserAction.TabDetails): Promise<string>;
/**
* 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.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
setIcon(details: chrome.browserAction.TabIconDetails): Promise<void>;
onClicked: BrowserClickedEvent;
}
}
declare namespace chromepApi.browsingData {
export interface BrowsingData {
/**
* Since Chrome 26.
* 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.
* @param callback The callback parameter should be a function that looks like this:
* function(object result) {...};
*/
settings(): Promise<chrome.browsingData.SettingsCallback>;
/**
* Clears plugins' data.
* @param callback Called when plugins' data has been cleared.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removePluginData(options: chrome.browsingData.RemovalOptions): Promise<void>;
/**
* Clears the browser's stored form data (autofill).
* @param callback Called when the browser's form data has been cleared.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeFormData(options: chrome.browsingData.RemovalOptions): Promise<void>;
/**
* Clears websites' file system data.
* @param callback Called when websites' file systems have been cleared.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeFileSystems(options: chrome.browsingData.RemovalOptions): Promise<void>;
/**
* Clears various types of browsing data stored in a user's profile.
* @param dataToRemove The set of data types to remove.
* @param callback Called when deletion has completed.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
remove(options: chrome.browsingData.RemovalOptions, dataToRemove: chrome.browsingData.DataTypeSet): Promise<void>;
/**
* Clears the browser's stored passwords.
* @param callback Called when the browser's passwords have been cleared.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removePasswords(options: chrome.browsingData.RemovalOptions): Promise<void>;
/**
* Clears the browser's cookies and server-bound certificates modified within a particular timeframe.
* @param callback Called when the browser's cookies and server-bound certificates have been cleared.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeCookies(options: chrome.browsingData.RemovalOptions): Promise<void>;
/**
* Clears websites' WebSQL data.
* @param callback Called when websites' WebSQL databases have been cleared.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeWebSQL(options: chrome.browsingData.RemovalOptions): Promise<void>;
/**
* Clears websites' appcache data.
* @param callback Called when websites' appcache data has been cleared.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeAppcache(options: chrome.browsingData.RemovalOptions): Promise<void>;
/**
* Clears the browser's list of downloaded files (not the downloaded files themselves).
* @param callback Called when the browser's list of downloaded files has been cleared.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeDownloads(options: chrome.browsingData.RemovalOptions): Promise<void>;
/**
* Clears websites' local storage data.
* @param callback Called when websites' local storage has been cleared.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeLocalStorage(options: chrome.browsingData.RemovalOptions): Promise<void>;
/**
* Clears the browser's cache.
* @param callback Called when the browser's cache has been cleared.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeCache(options: chrome.browsingData.RemovalOptions): Promise<void>;
/**
* Clears the browser's history.
* @param callback Called when the browser's history has cleared.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeHistory(options: chrome.browsingData.RemovalOptions): Promise<void>;
/**
* Clears websites' IndexedDB data.
* @param callback Called when websites' IndexedDB data has been cleared.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeIndexedDB(options: chrome.browsingData.RemovalOptions): Promise<void>;
}
}
declare namespace chromepApi.commands {
export interface CommandEvent extends chrome.events.Event<(command: string) => void> {
}
export interface Commands {
/**
* Returns all the registered extension commands for this extension and their shortcut (if active).
* @param callback Called to return the registered commands.
* If you specify the callback parameter, it should be a function that looks like this:
* function(array of Command commands) {...};
*/
getAll(): Promise<chrome.commands.Command[]>;
onCommand: CommandEvent;
}
}
declare namespace chromepApi.contentSettings {
export interface CookieContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.CookieSetDetails): Promise<void>;
}
export interface PopupsContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.PopupsSetDetails): Promise<void>;
}
export interface JavascriptContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.JavascriptSetDetails): Promise<void>;
}
export interface NotificationsContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.NotificationsSetDetails): Promise<void>;
}
export interface PluginsContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.PluginsSetDetails): Promise<void>;
}
export interface ImagesContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.ImagesSetDetails): Promise<void>;
}
export interface LocationContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.LocationSetDetails): Promise<void>;
}
export interface FullscreenContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.FullscreenSetDetails): Promise<void>;
}
export interface MouselockContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.MouselockSetDetails): Promise<void>;
}
export interface MicrophoneContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.MicrophoneSetDetails): Promise<void>;
}
export interface CameraContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.CameraSetDetails): Promise<void>;
}
export interface PpapiBrokerContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.PpapiBrokerSetDetails): Promise<void>;
}
export interface MultipleAutomaticDownloadsContentSetting extends chrome.contentSettings.ContentSetting {
set(details: chrome.contentSettings.MultipleAutomaticDownloadsSetDetails): Promise<void>;
}
export interface ContentSettings {
cookies: CookieContentSetting;
popups: PopupsContentSetting;
javascript: JavascriptContentSetting;
notifications: NotificationsContentSetting;
plugins: PluginsContentSetting;
images: ImagesContentSetting;
location: LocationContentSetting;
fullscreen: FullscreenContentSetting;
mouselock: MouselockContentSetting;
microphone: MicrophoneContentSetting;
camera: CameraContentSetting;
unsandboxedPlugins: PpapiBrokerContentSetting;
automaticDownloads: MultipleAutomaticDownloadsContentSetting;
}
}
declare namespace chromepApi.contextMenus {
export interface MenuClickedEvent extends chrome.events.Event<(info: chrome.contextMenus.OnClickData, tab?: chrome.tabs.Tab) => void> {
}
export interface ContextMenus {
/**
* Removes all context menu items added by this extension.
* @param callback Called when removal is complete.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeAll(): Promise<void>;
/**
* Creates a new context menu item. Note that if an error occurs during creation, you may not find out until the creation callback fires (the details will be in chrome.runtime.lastError).
* @param callback Called when the item has been created in the browser. If there were any problems creating the item, details will be available in chrome.runtime.lastError.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
create(createProperties: chrome.contextMenus.CreateProperties): Promise<void>;
/**
* Updates a previously created context menu item.
* @param id The ID of the item to update.
* @param updateProperties The properties to update. Accepts the same values as the create function.
* @param callback Called when the context menu has been updated.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
update(id: string, updateProperties: chrome.contextMenus.UpdateProperties): Promise<void>;
/**
* Updates a previously created context menu item.
* @param id The ID of the item to update.
* @param updateProperties The properties to update. Accepts the same values as the create function.
* @param callback Called when the context menu has been updated.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
update(id: number, updateProperties: chrome.contextMenus.UpdateProperties): Promise<void>;
/**
* Removes a context menu item.
* @param menuItemId The ID of the context menu item to remove.
* @param callback Called when the context menu has been removed.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
remove(menuItemId: string): Promise<void>;
/**
* Removes a context menu item.
* @param menuItemId The ID of the context menu item to remove.
* @param callback Called when the context menu has been removed.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
remove(menuItemId: number): Promise<void>;
onClicked: MenuClickedEvent;
}
}
declare namespace chromepApi.cookies {
export interface CookieChangedEvent extends chrome.events.Event<(changeInfo: chrome.cookies.CookieChangeInfo) => void> {
}
export interface Cookies {
/**
* Lists all existing cookie stores.
* @param callback The callback parameter should be a function that looks like this:
* function(array of CookieStore cookieStores) {...};
* Parameter cookieStores: All the existing cookie stores.
*/
getAllCookieStores(): Promise<chrome.cookies.CookieStore[]>;
/**
* 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.
* @param details Information to filter the cookies being retrieved.
* @param callback The callback parameter should be a function that looks like this:
* function(array of Cookie cookies) {...};
* Parameter cookies: All the existing, unexpired cookies that match the given cookie info.
*/
getAll(details: chrome.cookies.GetAllDetails): Promise<chrome.cookies.Cookie[]>;
/**
* Sets a cookie with the given cookie data; may overwrite equivalent cookies if they exist.
* @param details Details about the cookie being set.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function( Cookie cookie) {...};
* 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.
*/
set(details: chrome.cookies.SetDetails): Promise<chrome.cookies.Cookie | null>;
/**
* Deletes a cookie by name.
* @param details Information to identify the cookie to remove.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function(object details) {...};
*/
remove(details: chrome.cookies.Details): Promise<chrome.cookies.Details>;
/**
* 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.
* @param details Details to identify the cookie being retrieved.
* @param callback The callback parameter should be a function that looks like this:
* function( Cookie cookie) {...};
* Parameter cookie: Contains details about the cookie. This parameter is null if no such cookie was found.
*/
get(details: chrome.cookies.Details): Promise<chrome.cookies.Cookie | null>;
onChanged: CookieChangedEvent;
}
}
declare namespace chromepApi.declarativeContent {
export interface PageChangedEvent extends chrome.events.Event<() => void> {
}
export interface DeclarativeContent {
onPageChanged: PageChangedEvent;
}
}
declare namespace chromepApi.declarativeWebRequest {
export interface RequestedEvent extends chrome.events.Event<Function> {
}
export interface DeclarativeWebRequest {
onRequest: RequestedEvent;
}
}
declare namespace chromepApi.desktopCapture {
export interface DesktopCapture {
/**
* Shows desktop media picker UI with the specified set of sources.
* @param sources Set of sources that should be shown to the user.
* @param callback The callback parameter should be a function that looks like this:
* function(string streamId) {...};
* 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.
*/
chooseDesktopMedia(sources: string[]): Promise<string>;
/**
* Shows desktop media picker UI with the specified set of sources.
* @param sources Set of sources that should be shown to the user.
* @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.
* @param callback The callback parameter should be a function that looks like this:
* function(string streamId) {...};
* 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.
*/
chooseDesktopMedia(sources: string[], targetTab: chrome.tabs.Tab): Promise<string>;
}
}
declare namespace chromepApi.documentScan {
export interface DocumentScan {
/**
* Performs a document scan. On success, the PNG data will be sent to the callback.
* @param options Object containing scan parameters.
* @param callback Called with the result and data from the scan.
* The callback parameter should be a function that looks like this:
* function(object result) {...};
*/
scan(options: chrome.documentScan.DocumentScanOptions): Promise<chrome.documentScan.DocumentScanCallbackArg>;
}
}
declare namespace chromepApi.downloads {
export interface DownloadChangedEvent extends chrome.events.Event<(downloadDelta: chrome.downloads.DownloadDelta) => void> {
}
export interface DownloadCreatedEvent extends chrome.events.Event<(downloadItem: chrome.downloads.DownloadItem) => void> {
}
export interface DownloadErasedEvent extends chrome.events.Event<(downloadId: number) => void> {
}
export interface DownloadDeterminingFilenameEvent extends chrome.events.Event<(downloadItem: chrome.downloads.DownloadItem, suggest: (suggestion?: chrome.downloads.DownloadFilenameSuggestion) => void) => void> {
}
export interface Downloads {
/**
* 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.
* @param callback The callback parameter should be a function that looks like this:
* function(array of DownloadItem results) {...};
*/
search(query: chrome.downloads.DownloadQuery): Promise<chrome.downloads.DownloadItem[]>;
/**
* 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.
* @param downloadId The id of the download to pause.
* @param callback Called when the pause request is completed.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
pause(downloadId: number): Promise<void>;
/**
* 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.
* @param downloadId The identifier for the download.
* @param callback A URL to an image that represents the download.
* The callback parameter should be a function that looks like this:
* function(string iconURL) {...};
*/
getFileIcon(downloadId: number): Promise<string>;
/**
* 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.
* @param downloadId The identifier for the download.
* @param callback A URL to an image that represents the download.
* The callback parameter should be a function that looks like this:
* function(string iconURL) {...};
*/
getFileIcon(downloadId: number, options: chrome.downloads.GetFileIconOptions): Promise<string>;
/**
* 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.
* @param downloadId The id of the download to resume.
* @param callback Called when the resume request is completed.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
resume(downloadId: number): Promise<void>;
/**
* Cancel a download. When callback is run, the download is cancelled, completed, interrupted or doesn't exist anymore.
* @param downloadId The id of the download to cancel.
* @param callback Called when the cancel request is completed.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
cancel(downloadId: number): Promise<void>;
/**
* 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.
* @param options What to download and how.
* @param callback Called with the id of the new DownloadItem.
* If you specify the callback parameter, it should be a function that looks like this:
* function(integer downloadId) {...};
*/
download(options: chrome.downloads.DownloadOptions): Promise<number>;
/**
* 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.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function(array of integer erasedIds) {...};
*/
erase(query: chrome.downloads.DownloadQuery): Promise<number[]>;
/**
* Remove the downloaded file if it exists and the DownloadItem is complete; otherwise return an error through runtime.lastError.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
removeFile(downloadId: number): Promise<void>;
/**
* 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.
* @param downloadId The identifier for the DownloadItem.
* @param callback Called when the danger prompt dialog closes.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
acceptDanger(downloadId: number): Promise<void>;
onChanged: DownloadChangedEvent;
onCreated: DownloadCreatedEvent;
onErased: DownloadErasedEvent;
onDeterminingFilename: DownloadDeterminingFilenameEvent;
}
}
declare namespace chromepApi.events {
export interface Events {
}
}
declare namespace chromepApi.extension {
export interface LastError {
}
export interface Extension {
lastError: LastError;
/**
* Retrieves the state of the extension's access to the 'file://' scheme (as determined by the user-controlled 'Allow access to File URLs' checkbox.
* Since Chrome 12.
* @param callback The callback parameter should be a function that looks like this:
* function(boolean isAllowedAccess) {...};
* Parameter isAllowedAccess: True if the extension can access the 'file://' scheme, false otherwise.
*/
isAllowedFileSchemeAccess(): Promise<boolean>;
/**
* Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.
* Since Chrome 12.
* @param callback The callback parameter should be a function that looks like this:
* function(boolean isAllowedAccess) {...};
* Parameter isAllowedAccess: True if the extension has access to Incognito mode, false otherwise.
*/
isAllowedIncognitoAccess(): Promise<boolean>;
}
}
declare namespace chromepApi.fileBrowserHandler {
export interface FileBrowserHandlerExecuteEvent extends chrome.events.Event<(id: string, details: chrome.fileBrowserHandler.FileHandlerExecuteEventDetails) => void> {
}
export interface FileBrowserHandler {
/**
* Prompts user to select file path under which file should be saved. When the file is selected, file access permission required to use the file (read, write and create) are granted to the caller. The file will not actually get created during the function call, so function caller must ensure its existence before using it. The function has to be invoked with a user gesture.
* Since Chrome 21.
* @param selectionParams Parameters that will be used while selecting the file.
* @param callback Function called upon completion.
* The callback parameter should be a function that looks like this:
* function(object result) {...};
* Parameter result: Result of the method.
*/
selectFile(selectionParams: chrome.fileBrowserHandler.SelectionParams): Promise<chrome.fileBrowserHandler.SelectionResult>;
onExecute: FileBrowserHandlerExecuteEvent;
}
}
declare namespace chromepApi.fileSystemProvider {
export interface RequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.RequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {
}
export interface MetadataRequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.MetadataRequestedEventOptions, successCallback: (metadata: chrome.fileSystemProvider.EntryMetadata) => void, errorCallback: (error: string) => void) => void> {
}
export interface DirectoryPathRequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.DirectoryPathRequestedEventOptions, successCallback: (entries: chrome.fileSystemProvider.EntryMetadata[], hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {
}
export interface OpenFileRequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.OpenFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {
}
export interface OpenedFileRequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.OpenedFileRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {
}
export interface OpenedFileOffsetRequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.OpenedFileOffsetRequestedEventOptions, successCallback: (data: ArrayBuffer, hasMore: boolean) => void, errorCallback: (error: string) => void) => void> {
}
export interface DirectoryPathRecursiveRequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.DirectoryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {
}
export interface EntryPathRecursiveRequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.EntryPathRecursiveRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {
}
export interface FilePathRequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.FilePathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {
}
export interface SourceTargetPathRequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.SourceTargetPathRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {
}
export interface FilePathLengthRequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.FilePathLengthRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {
}
export interface OpenedFileIoRequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.OpenedFileIoRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {
}
export interface OperationRequestedEvent extends chrome.events.Event<(options: chrome.fileSystemProvider.OperationRequestedEventOptions, successCallback: Function, errorCallback: (error: string) => void) => void> {
}
export interface OptionlessRequestedEvent extends chrome.events.Event<(successCallback: Function, errorCallback: (error: string) => void) => void> {
}
export interface FileSystemProvider {
/**
* Mounts a file system with the given fileSystemId and displayName. displayName will be shown in the left panel of Files.app. displayName can contain any characters including '/', but cannot be an empty string. displayName must be descriptive but doesn't have to be unique. The fileSystemId must not be an empty string.
* Depending on the type of the file system being mounted, the source option must be set appropriately.
* In case of an error, runtime.lastError will be set with a corresponding error code.
* @param callback A generic result callback to indicate success or failure.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
mount(options: chrome.fileSystemProvider.MountOptions): Promise<void>;
/**
* 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).
* In case of an error, runtime.lastError will be set with a corresponding error code.
* @param callback A generic result callback to indicate success or failure.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
unmount(options: chrome.fileSystemProvider.UnmountOptions): Promise<void>;
/**
* Returns all file systems mounted by the extension.
* @param callback Callback to receive the result of getAll function.
* The callback parameter should be a function that looks like this:
* function(array of FileSystemInfo fileSystems) {...};
*/
getAll(): Promise<chrome.fileSystemProvider.FileSystemInfo[]>;
/**
* Returns information about a file system with the passed fileSystemId.
* @since Since Chrome 42.
* @param callback Callback to receive the result of get function.
* The callback parameter should be a function that looks like this:
* function(FileSystemInfo fileSystem) {...};
*/
get(fileSystemId: string): Promise<chrome.fileSystemProvider.FileSystemInfo>;
/**
* Notifies about changes in the watched directory at observedPath in recursive mode. If the file system is mounted with supportsNofityTag, then tag must be provided, and all changes since the last notification always reported, even if the system was shutdown. The last tag can be obtained with getAll.
* To use, the file_system_provider.notify manifest option must be set to true.
* Value of tag can be any string which is unique per call, so it's possible to identify the last registered notification. Eg. if the providing extension starts after a reboot, and the last registered notification's tag is equal to "123", then it should call notify for all changes which happened since the change tagged as "123". It cannot be an empty string.
* Not all providers are able to provide a tag, but if the file system has a changelog, then the tag can be eg. a change number, or a revision number.
* 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.
* In case of an error, runtime.lastError will be set will a corresponding error code.
* @param callback A generic result callback to indicate success or failure.
* If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
notify(options: chrome.fileSystemProvider.NotificationOptions): Promise<void>;
onUnmountRequested: RequestedEvent;
onGetMetadataRequested: MetadataRequestedEvent;
onReadDirectoryRequested: DirectoryPathRequestedEvent;
onOpenFileRequested: OpenFileRequestedEvent;
onCloseFileRequested: OpenedFileRequestedEvent;
onReadFileRequested: OpenedFileOffsetRequestedEvent;
onCreateDirectoryRequested: DirectoryPathRecursiveRequestedEvent;
onDeleteEntryRequested: EntryPathRecursiveRequestedEvent;
onCreateFileRequested: FilePathRequestedEvent;
onCopyEntryRequested: SourceTargetPathRequestedEvent;
onMoveEntryRequested: SourceTargetPathRequestedEvent;
onTruncateRequested: FilePathLengthRequestedEvent;
onWriteFileRequested: OpenedFileIoRequestedEvent;
onAbortRequested: OperationRequestedEvent;
onConfigureRequested: RequestedEvent;
onMountRequested: OptionlessRequestedEvent;
onAddWatcherRequested: EntryPathRecursiveRequestedEvent;
onRemoveWatcherRequested: EntryPathRecursiveRequestedEvent;
}
}
declare namespace chromepApi.fontSettings {
export interface DefaultFixedFontSizeChangedEvent extends chrome.events.Event<(details: chrome.fontSettings.FontSizeDetails) => void> {
}
export interface DefaultFontSizeChangedEvent extends chrome.events.Event<(details: chrome.fontSettings.FontSizeDetails) => void> {
}
export interface MinimumFontSizeChangedEvent extends chrome.events.Event<(details: chrome.fontSettings.FontSizeDetails) => void> {
}
export interface FontChangedEvent extends chrome.events.Event<(details: chrome.fontSettings.FullFontDetails) => void> {
}
export interface FontSettings {
/**
* Sets the default font size.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
setDefaultFontSize(details: chrome.fontSettings.DefaultFontSizeDetails): Promise<void>;
/**
* Gets the font for a given script and generic font family.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function(object details) {...};
*/
getFont(details: chrome.fontSettings.FontDetails): Promise<chrome.fontSettings.FontDetailsResult>;
/**
* Gets the default font size.
* @param details This parameter is currently unused.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function(object details) {...};
*/
getDefaultFontSize(details?: Object): Promise<chrome.fontSettings.FontSizeDetails>;
/**
* Gets the minimum font size.
* @param details This parameter is currently unused.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function(object details) {...};
*/
getMinimumFontSize(details?: chrome.fontSettings.FontSizeDetails): Promise<chrome.fontSettings.FontSizeDetails>;
/**
* Sets the minimum font size.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
setMinimumFontSize(details: chrome.fontSettings.SetFontSizeDetails): Promise<void>;
/**
* Gets the default size for fixed width fonts.
* @param details This parameter is currently unused.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function(object details) {...};
*/
getDefaultFixedFontSize(details?: Object): Promise<chrome.fontSettings.FontSizeDetails>;
/**
* Clears the default font size set by this extension, if any.
* @param details This parameter is currently unused.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
clearDefaultFontSize(details?: Object): Promise<void>;
/**
* Sets the default size for fixed width fonts.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
setDefaultFixedFontSize(details: chrome.fontSettings.SetFontSizeDetails): Promise<void>;
/**
* Clears the font set by this extension, if any.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
clearFont(details: chrome.fontSettings.FontDetails): Promise<void>;
/**
* Sets the font for a given script and generic font family.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function(object details) {...};
*/
setFont(details: chrome.fontSettings.SetFontDetails): Promise<void>;
/**
* Clears the minimum font size set by this extension, if any.
* @param details This parameter is currently unused.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
clearMinimumFontSize(details?: Object): Promise<void>;
/**
* Gets a list of fonts on the system.
* @param callback The callback parameter should be a function that looks like this:
* function(array of FontName results) {...};
*/
getFontList(): Promise<chrome.fontSettings.FontName[]>;
/**
* Clears the default fixed font size set by this extension, if any.
* @param details This parameter is currently unused.
* @param callback If you specify the callback parameter, it should be a function that looks like this:
* function() {...};
*/
clearDefaultFixedFontSize(details: Object): Promise<void>;
onDefaultFixedFontSizeChanged: DefaultFixedFontSizeChangedEvent;
onDefaultFontSizeChanged: DefaultFontSizeChangedEvent;
onMinimumFontSizeChanged: MinimumFontSizeChangedEvent;
onFontChanged: FontChangedEvent;
}
}
declare namespace chromepApi.gcm {
export interface MessageReceptionEvent extends chrome.events.Event<(message: chrome.gcm.IncomingMessage) => void> {
}
export interface MessageDeletionEvent extends chrome.events.Event<() => void> {
}
export interface GcmErrorEvent extends chrome.events.Event<(error: chrome.gcm.GcmError) => void> {
}
export interface Gcm {
/**