Lusito / webextension-polyfill-ts

This is a TypeScript ready "wrapper" for the WebExtension browser API Polyfill by Mozilla
zlib License
392 stars 23 forks source link

browser.alarms.get should return `Promise<Alarm | undefined>` #84

Closed davidbielik closed 1 year ago

davidbielik commented 2 years ago

Current type definition for browser.alarms.get return Promise<Alarm>

But if you were you get an alarm that does not exist, it returns undefined:

console.log(await browser.alarms.get("i-dont-exist"));

How can we get this type updated (and therefore updated in @types/webextension-polyfill corrected?

Lusito commented 1 year ago

Thanks for the report, will be resolved when the next version gets out