Skip to content

Commit 9975b92

Browse files
authored
🤖 Merge PR DefinitelyTyped#74548 Update webextension-polyfill with latest definitions and a fix for Promise<void> returns by @josh-berry
1 parent 3818536 commit 9975b92

File tree

12 files changed

+39
-34
lines changed

12 files changed

+39
-34
lines changed

‎types/webextension-polyfill/namespaces/action.d.ts‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,8 +228,10 @@ export namespace Action {
228228

229229
/**
230230
* Checks whether the browser action is enabled.
231+
*
232+
* @param details Optional.
231233
*/
232-
isEnabled(details: Details): Promise<boolean>;
234+
isEnabled(details?: Details | number): Promise<boolean>;
233235

234236
/**
235237
* Opens the extension popup window in the specified window.

‎types/webextension-polyfill/namespaces/commands.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export namespace Commands {
9292
/**
9393
* Open extension shortcuts configuration page.
9494
*/
95-
openShortcutSettings(): void;
95+
openShortcutSettings(): Promise<void>;
9696

9797
/**
9898
* Fired when a registered command is activated using a keyboard shortcut.

‎types/webextension-polyfill/namespaces/geckoProfiler.d.ts‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ export namespace GeckoProfiler {
3737
| "memory"
3838
| "tracing"
3939
| "sandbox"
40-
| "flows";
40+
| "flows"
41+
| "jssources";
4142

4243
type supports = "windowLength";
4344

@@ -77,55 +78,55 @@ export namespace GeckoProfiler {
7778
/**
7879
* Starts the profiler with the specified settings.
7980
*/
80-
start(settings: StartSettingsType): void;
81+
start(settings: StartSettingsType): Promise<void>;
8182

8283
/**
8384
* Stops the profiler and discards any captured profile data.
8485
*/
85-
stop(): void;
86+
stop(): Promise<void>;
8687

8788
/**
8889
* Pauses the profiler, keeping any profile data that is already written.
8990
*/
90-
pause(): void;
91+
pause(): Promise<void>;
9192

9293
/**
9394
* Resumes the profiler with the settings that were initially used to start it.
9495
*/
95-
resume(): void;
96+
resume(): Promise<void>;
9697

9798
/**
9899
* Gathers the profile data from the current profiling session, and writes it to disk.
99100
* The returned promise resolves to a path that locates the created file.
100101
*
101102
* @param fileName The name of the file inside the profile/profiler directory
102103
*/
103-
dumpProfileToFile(fileName: string): void;
104+
dumpProfileToFile(fileName: string): Promise<void>;
104105

105106
/**
106107
* Gathers the profile data from the current profiling session.
107108
*/
108-
getProfile(): void;
109+
getProfile(): Promise<void>;
109110

110111
/**
111112
* Gathers the profile data from the current profiling session. The returned promise resolves to an array buffer that
112113
* contains a JSON string.
113114
*/
114-
getProfileAsArrayBuffer(): void;
115+
getProfileAsArrayBuffer(): Promise<void>;
115116

116117
/**
117118
* Gathers the profile data from the current profiling session. The returned promise resolves to an array buffer that
118119
* contains a gzipped JSON string.
119120
*/
120-
getProfileAsGzippedArrayBuffer(): void;
121+
getProfileAsGzippedArrayBuffer(): Promise<void>;
121122

122123
/**
123124
* Gets the debug symbols for a particular library.
124125
*
125126
* @param debugName The name of the library's debug file. For example, 'xul.pdb
126127
* @param breakpadId The Breakpad ID of the library
127128
*/
128-
getSymbols(debugName: string, breakpadId: string): void;
129+
getSymbols(debugName: string, breakpadId: string): Promise<void>;
129130

130131
/**
131132
* Fires when the profiler starts/stops running.

‎types/webextension-polyfill/namespaces/management.d.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ export namespace Management {
3737
type ExtensionType = "extension" | "theme";
3838

3939
/**
40-
* How the extension was installed. One of<br><var>development</var>: The extension was loaded unpacked in developer mode,
41-
* <br><var>normal</var>: The extension was installed normally via an .xpi file,<br><var>sideload</var>
42-
* : The extension was installed by other software on the machine,<br><var>admin</var>
43-
* : The extension was installed by policy,<br><var>other</var>: The extension was installed by other means.
40+
* How the extension was installed.<dl><dt>development</dt><dd>The extension was loaded unpacked in developer mode,</dd><dt>
41+
* normal</dt><dd>The extension was installed normally via an .xpi file</dd><dt>sideload</dt><dd>
42+
* The extension was installed by other software on the machine</dd><dt>admin</dt><dd>
43+
* The extension was installed by policy</dd><dt>other</dt><dd>The extension was installed by other means.</dd></dl>
4444
*/
4545
type ExtensionInstallType = "development" | "normal" | "sideload" | "admin" | "other";
4646

‎types/webextension-polyfill/namespaces/networkStatus.d.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export namespace NetworkStatus {
4040
/**
4141
* Returns the $(ref:NetworkLinkInfo) of the current network connection.
4242
*/
43-
getLinkInfo(): void;
43+
getLinkInfo(): Promise<void>;
4444

4545
/**
4646
* Fired when the network connection state changes.

‎types/webextension-polyfill/namespaces/normandyAddonStudy.d.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,19 @@ export namespace NormandyAddonStudy {
8585
/**
8686
* Returns a study object for the current study.
8787
*/
88-
getStudy(): void;
88+
getStudy(): Promise<void>;
8989

9090
/**
9191
* Marks the study as ended and then uninstalls the addon.
9292
*
9393
* @param reason The reason why the study is ending.
9494
*/
95-
endStudy(reason: string): void;
95+
endStudy(reason: string): Promise<void>;
9696

9797
/**
9898
* Returns an object with metadata about the client which may be required for constructing survey URLs.
9999
*/
100-
getClientMetadata(): void;
100+
getClientMetadata(): Promise<void>;
101101

102102
/**
103103
* Fired when a user unenrolls from a study but before the addon is uninstalled.

‎types/webextension-polyfill/namespaces/runtime.d.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ export namespace Runtime {
463463
* a connection will be attempted with your own extension. Required if sending messages from a web page for
464464
* $(topic:manifest/externally_connectable)[web messaging].
465465
* @param connectInfo Optional.
466-
* @returns Port through which messages can be sent and received. The port's $(ref:runtime.Port onDisconnect)
466+
* @returns Port through which messages can be sent and received. The port's $(ref:runtime.Port.onDisconnect)
467467
* event is fired if the extension/app does not exist.
468468
*/
469469
connect(extensionId?: string, connectInfo?: ConnectConnectInfoType): Port;
@@ -475,7 +475,7 @@ export namespace Runtime {
475475
* content script. Extensions may connect to content scripts embedded in tabs via $(ref:tabs.connect).
476476
*
477477
* @param connectInfo Optional.
478-
* @returns Port through which messages can be sent and received. The port's $(ref:runtime.Port onDisconnect)
478+
* @returns Port through which messages can be sent and received. The port's $(ref:runtime.Port.onDisconnect)
479479
* event is fired if the extension/app does not exist.
480480
*/
481481
connect(connectInfo?: ConnectConnectInfoType): Port;

‎types/webextension-polyfill/namespaces/storage.d.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ export namespace Storage {
9898
* Fired when one or more items change.
9999
*
100100
* @param changes Object mapping each key that changed to its corresponding $(ref:storage.StorageChange) for that item.
101-
* @param areaName The name of the storage area (<code>"sync"</code>, <code>"local"</code> or <code>"managed"</code>)
102-
* the changes are for.
101+
* @param areaName The name of the storage area (<code>"session"</code>, <code>"sync"</code>, <code>"local"</code> or <code>
102+
* "managed"</code>) the changes are for.
103103
*/
104104
onChanged: Events.Event<(changes: Record<string, StorageChange>, areaName: string) => void>;
105105

‎types/webextension-polyfill/namespaces/tabs.d.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ export namespace Tabs {
13871387
* first tab in the array instead.
13881388
* @param options Optional.
13891389
*/
1390-
moveInSuccession(tabIds: number[], tabId?: number, options?: MoveInSuccessionOptionsType): void;
1390+
moveInSuccession(tabIds: number[], tabId?: number, options?: MoveInSuccessionOptionsType): Promise<void>;
13911391

13921392
/**
13931393
* Navigate to next page in tab's history, if available
@@ -1413,7 +1413,7 @@ export namespace Tabs {
14131413
*
14141414
* @param tabIds The tab ID or list of tab IDs to remove from their respective groups.
14151415
*/
1416-
ungroup(tabIds: number | number[]): void;
1416+
ungroup(tabIds: number | number[]): Promise<void>;
14171417

14181418
/**
14191419
* Fired when a tab is created. Note that the tab's URL may not be set at the time this event fired,

‎types/webextension-polyfill/namespaces/trial_ml.d.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ export namespace TrialMl {
2727
/**
2828
* Prepare the inference engine
2929
*/
30-
createEngine(CreateEngineRequest: CreateEngineRequest): void;
30+
createEngine(CreateEngineRequest: CreateEngineRequest): Promise<void>;
3131

3232
/**
3333
* Call the inference engine
3434
*/
35-
runEngine(RunEngineRequest: RunEngineRequest): void;
35+
runEngine(RunEngineRequest: RunEngineRequest): Promise<void>;
3636

3737
/**
3838
* Delete the models the extension downloaded.
3939
*/
40-
deleteCachedModels(): void;
40+
deleteCachedModels(): Promise<void>;
4141

4242
/**
4343
* Events from the inference engine.

0 commit comments

Comments
 (0)