-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sendResponse
, the 3rd param of addListener
callback function accepts expected 1 param in any
type but 0 now
#50
Comments
The type should be something like The types are generated automatically so how do we fix this? |
This appears to affect not just |
According to MDN:
So And why isn't this issue fixed yet? This seems like a longstanding problem. |
I think someone who works at Google will have to fix it. |
I have fixed this localy using declaration merging. Hope this helps someone. declare namespace chrome {
/// <reference types="chrome-types" />
export namespace runtime {
export const onMessage: events.Event<
(
message: any,
sender: MessageSender,
sendResponse: (data: any) => void,
) => boolean | undefined
>;
}
} |
It is recommended to try the |
As I expected, the
sendResponse
callback should accept 1 param inany
type but now 0.Thus the following codes will fail to pass the type checking.
The text was updated successfully, but these errors were encountered: