Skip to content

Commit 209a41c

Browse files
committed
Flow types
1 parent e1ae946 commit 209a41c

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

packages/react-devtools-extensions/src/background/setExtensionIconAndPopup.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
'use strict';
1212
import type {ReactBuildType} from 'react-devtools-shared/src/backend/types';
1313

14-
function setExtensionIconAndPopup(reactBuildType: ReactBuildType, tabId) {
14+
function setExtensionIconAndPopup(
15+
reactBuildType: ReactBuildType,
16+
tabId: number,
17+
) {
1518
chrome.action.setIcon({
1619
tabId,
1720
path: {

scripts/flow/react-devtools.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ declare const __IS_CHROME__: boolean;
1717
declare const __IS_EDGE__: boolean;
1818
declare const __IS_NATIVE__: boolean;
1919

20+
interface ExtensionAction {
21+
/** @see {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/action/setIcon} */
22+
setIcon(details: {
23+
tabId: number,
24+
path?: string | {[iconSize: string]: string},
25+
}): void;
26+
/** @see {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/action/setPopup} */
27+
setPopup(details: {tabId: number, popup: string}): void;
28+
}
29+
2030
interface ExtensionDevtools {
2131
/** @see {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/devtools/inspectedWindow} */
2232
inspectedWindow: $FlowFixMe;
@@ -73,6 +83,8 @@ interface ExtensionRuntime {
7383
extensionId: string,
7484
connectInfo?: {name?: string, includeTlsChannelId?: boolean},
7585
): ExtensionRuntimePort;
86+
/** @see {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/getURL} */
87+
getURL(path: string): string;
7688
/** @see {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage} */
7789
onMessage: ExtensionEvent<
7890
(
@@ -108,6 +120,8 @@ interface ExtensionTabs {
108120
}
109121

110122
interface ExtensionAPI {
123+
/** @see {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/action} */
124+
action: ExtensionAction;
111125
devtools: ExtensionDevtools;
112126
/** @see {@link https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/permissions} */
113127
permissions: $FlowFixMe;

0 commit comments

Comments
 (0)