AFAIK, you can get type hinting for
WebExtension APIs by installing webextension-polyfill and @types/webextension-polyfill with npm and
import browser from "webextension-polyfill";
in js files.
Since you imported from a node module, you will also need to use a bundler to make the extension work in a browser environment.
Is there any other way to get type hinting, though? I don’t want to use a bundler just for type hinting. I don’t even need the polyfill for my homemade Firefox-only extension.