Skip to content

Fix MIDIMessageEvent.data incorrectly typed as nullable#63395

Closed
Nedunchezhiyan-M wants to merge 1 commit intomicrosoft:mainfrom
Nedunchezhiyan-M:fix/midi-message-event-data-nullable
Closed

Fix MIDIMessageEvent.data incorrectly typed as nullable#63395
Nedunchezhiyan-M wants to merge 1 commit intomicrosoft:mainfrom
Nedunchezhiyan-M:fix/midi-message-event-data-nullable

Conversation

@Nedunchezhiyan-M
Copy link
Copy Markdown

Fixes #60546

Summary

MIDIMessageEvent.data was typed as Uint8Array<ArrayBuffer> | null after a DOM update in #57027, but the Web MIDI API spec defines it as:

readonly attribute Uint8Array data;

The property is never null — it always contains the MIDI data bytes of the event. This removes the erroneous | null to match the spec and MDN documentation.

Change

  • src/lib/dom.generated.d.ts: MIDIMessageEvent.data changed from Uint8Array<ArrayBuffer> | nullUint8Array<ArrayBuffer>

AI Disclosure

This PR was developed with AI assistance (Claude Code). The fix was identified and verified manually against the Web MIDI API spec and MDN documentation.

The Web MIDI API spec defines data as `readonly attribute Uint8Array data`,
which is never null. The `| null` was inadvertently introduced in a DOM
update (#57027). This restores the correct non-nullable type in line with
the spec and MDN documentation.

Fixes #60546
@typescript-bot
Copy link
Copy Markdown
Collaborator

It looks like you've sent a pull request to update some generated declaration files related to the DOM. These files aren't meant to be edited by hand, as they are synchronized with files in the TypeScript-DOM-lib-generator repository. You can read more here. For house-keeping purposes, this pull request will be closed.

@github-project-automation github-project-automation bot moved this from Not started to Done in PR Backlog Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

MIDIMessageEvent data is incorrectly typed

2 participants