types/w3c-web-usb: status properties are not undefined by dlech · Pull Request #73622 · DefinitelyTyped/DefinitelyTyped · GitHub
Skip to content

types/w3c-web-usb: status properties are not undefined#73622

Merged
typescript-bot merged 2 commits into
DefinitelyTyped:masterfrom
dlech:w3c-web-usb-fixes2
Sep 30, 2025
Merged

types/w3c-web-usb: status properties are not undefined#73622
typescript-bot merged 2 commits into
DefinitelyTyped:masterfrom
dlech:w3c-web-usb-fixes2

Conversation

@dlech

@dlech dlech commented Sep 6, 2025

Copy link
Copy Markdown
Contributor

According to the spec, the status properties on USBInTransferResult and USBIsochronousInTransferPacket are not optional and will always be present.

It is also logical that if the constructor argument cannot be undefined, then the property cannot be undefined.

Please fill in this template.

Select one of these and delete the others:

If changing an existing definition:

  • Provide a URL to documentation or source code which provides context for the suggested changes: <>
  • If this PR brings the type definitions up to date with a new version of the JS library, update the version number in the package.json.

According to the spec, the status properties on `USBInTransferResult` and
`USBIsochronousInTransferPacket` are not optional and will always be present.

- https://wicg.github.io/webusb/#usbintransferresult
- https://wicg.github.io/webusb/#usbisochronousintransferpacket

It is also logical that if the constructor argument cannot be undefined,
then the property cannot be undefined.
@typescript-bot

typescript-bot commented Sep 6, 2025

Copy link
Copy Markdown
Contributor

@typescript-bot typescript-bot added the Popular package This PR affects a popular package (as counted by NPM download counts). label Sep 6, 2025
@typescript-bot

Copy link
Copy Markdown
Contributor

🔔 @larsgk @thegecko @yume-chan — please review this PR in the next few days. Be sure to explicitly select Approve or Request Changes in the GitHub UI so I know what's going on.

@typescript-bot typescript-bot moved this to Waiting for Code Reviews in Pull Request Status Board Sep 6, 2025
@@ -64,7 +64,7 @@ declare class USBAlternateInterface {
declare class USBInTransferResult {
constructor(status: USBTransferStatus, data?: DataView);
readonly data?: DataView | undefined;

@yume-chan yume-chan Sep 9, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also be

Suggested change
readonly data?: DataView | undefined;
readonly data: DataView | null;

Same on line 78

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec didn't say "nullable" on this one like it did on #73568, so that is why I didn't change it. I haven't had a chance to test on real hardware yet though to see what it actually does in a browser.

@typescript-bot typescript-bot added the Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. label Sep 17, 2025
@typescript-bot

Copy link
Copy Markdown
Contributor

Re-ping @larsgk, @thegecko, @yume-chan:

This PR has been out for over a week, yet I haven't seen any reviews.

Could someone please give it some attention? Thanks!

@typescript-bot

Copy link
Copy Markdown
Contributor

It has been more than two weeks and this PR still has no reviews.

I'll bump it to the DT maintainer queue. Thank you for your patience, @dlech.

(Ping @larsgk, @thegecko, @yume-chan.)

@typescript-bot typescript-bot moved this from Waiting for Code Reviews to Needs Maintainer Action in Pull Request Status Board Sep 24, 2025
@typescript-bot typescript-bot added Maintainer Approved Self Merge This PR can now be self-merged by the PR author or an owner and removed Unreviewed No one showed up to review this PR, so it'll be reviewed by a DT maintainer. labels Sep 29, 2025
@typescript-bot typescript-bot moved this from Needs Maintainer Action to Waiting for Author to Merge in Pull Request Status Board Sep 29, 2025
@typescript-bot

Copy link
Copy Markdown
Contributor

@dlech: Everything looks good here. I am ready to merge this PR (at a64ea06) on your behalf whenever you think it's ready.

If you'd like that to happen, please post a comment saying:

Ready to merge

and I'll merge this PR almost instantly. Thanks for helping out! ❤️

(@larsgk, @thegecko, @yume-chan: you can do this too.)

@dlech

dlech commented Sep 30, 2025

Copy link
Copy Markdown
Contributor Author

@typescript-bot typescript-bot moved this from Waiting for Author to Merge to Recently Merged in Pull Request Status Board Sep 30, 2025
@typescript-bot typescript-bot merged commit 0f7ba93 into DefinitelyTyped:master Sep 30, 2025
4 checks passed
@dlech dlech deleted the w3c-web-usb-fixes2 branch September 30, 2025 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Maintainer Approved Popular package This PR affects a popular package (as counted by NPM download counts). Self Merge This PR can now be self-merged by the PR author or an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants