-
Notifications
You must be signed in to change notification settings - Fork 453
Closed
Description
This
midiInput.onmidimessage = handleMIDIMessage;
with
handleMIDIMessage = (event:MIDIMessageEvent) => {...}
runs perfectly fine in the browser, but the TypeScript compiler throws this error:
Type '(event: MIDIMessageEvent) => void' is not assignable to type '(this: MIDIInput, ev: Event) => any'.
Types of parameters 'event' and 'ev' are incompatible.
Property 'data' is missing in type 'Event' but required in type 'MIDIMessageEvent'.
Shouldn't midiInput.onmidimessage
have the type (this: MIDIInput, ev: MIDIMessageEvent) => any
instead of (this: MIDIInput, ev: Event) => any
?
According to this
https://developer.mozilla.org/en-US/docs/Web/API/MIDIMessageEvent
it should.
Thanks!
undo76, robinvdvleuten and christiaanwesterbeek
Metadata
Metadata
Assignees
Labels
No labels