Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Event type of midiInput.onmidimessage wrong #1571

Copy link
Copy link
@h-a-n-n-e-s

Description

@h-a-n-n-e-s
Issue body actions

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.