For chrome extension developed using typescript, we need a definition file called chrome.d.ts in typings folder for accessing web extension APIs like chrome.runtime.* or chrome.tabs.*.
For edge extension, developing in typescript, we need a definition file called browser.d.ts in typings folder for accessing web extension APIs like browser.runtime.*
How can we download this dependency using node package manager(npm). I added a reference to the file in my background.ts file of extension like:
/// reference path="typings/browser/browser.d.ts"
Update:
Typings are available for Firefox's browser API and its browser polyfill library.
Unfortunately, Edge's browser API is not the same as Firefox's. Edge uses callbacks while Firefox uses Promises. This may or may not change.
See:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With