jsmnbom/definitelytyped-firefox-webext-browser

optional return types aren't supported

Opened this issue · 0 comments

from #4

the returns of a listener to runtime.onMessage looks like this:

"returns": {
  "type": "boolean",
  "optional": true,
  "description": "Return true from the event listener if you wish to call <code>sendResponse</code> after the event listener returns."
}

but what's outputted is this:

(message: any, sender: MessageSender, sendResponse: () => void) => boolean

void should be added as an option to the return type when it's optional

it's for an event callback but i don't know if normal functions support it