You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@types/firefox-webext-browser can be used without any import statements by adding firefox-webext-browser to tsconfig.json > compilerOptions > types.
When I try to do the same with this package, it does not work.
After some investigation, the cause appears to be the import statements in the index.d.ts file which @types/firefox-webext-browser does not have (import statements).
This workaround (fixes?) the problem:
diff --git "a/webextension-polyfill/index.d.ts" "b/webextension-polyfill/index.d.ts"
index 694e9b6..0dcc4de 100644
--- "a/webextension-polyfill/index.d.ts"+++ "b/webextension-polyfill/index.d.ts"@@ -59,7 +59,10 @@ import { WebNavigation as ImportedWebNavigation } from "./namespaces/webNavigati
import { WebRequest as ImportedWebRequest } from "./namespaces/webRequest";
import { Windows as ImportedWindows } from "./namespaces/windows";
-declare namespace Browser {+declare global+{+ namespace browser {
/**
* Monitor extension activity
*
@@ -841,6 +844,8 @@ declare namespace Browser {
export import WebRequest = ImportedWebRequest;
export import Windows = ImportedWindows;
}
+}
// eslint-disable-next-line @definitelytyped/export-just-namespace
-export = Browser;+export = browser;
@types/firefox-webext-browser
can be used without any import statements by addingfirefox-webext-browser
totsconfig.json > compilerOptions > types
.When I try to do the same with this package, it does not work.
After some investigation, the cause appears to be the import statements in the
index.d.ts
file which@types/firefox-webext-browser
does not have (import statements).This workaround (fixes?) the problem:
Thanks to: https://stackoverflow.com/a/66279933
The text was updated successfully, but these errors were encountered: