+
Skip to content

Conversation

codebytere
Copy link
Member

Description of Change

Similar vein as #47391 - we should expose the full property set of [USBDevice] per spec.

Checklist

Release Notes

Notes: Added support for USBDevice.configurations.

@codebytere codebytere requested a review from a team June 12, 2025 18:28
@codebytere codebytere added the semver/minor backwards-compatible functionality label Jun 12, 2025
Comment on lines 5 to 18
* `configurationName` String - the name provided by the device to describe this configuration.
* `interfaces` Object[] - An array of [USBInterface](https://developer.mozilla.org/en-US/docs/Web/API/USBInterface) objects containing information about an interface provided by the USB device.
* `interfaceNumber` Integer - the interface number of this interface.
* `alternate` Object - the currently selected alternative configuration of this interface.
* `alternateSetting` Integer - the alternate setting number of this interface.
* `interfaceClass` Integer - the class of this interface. See [USB.org](https://www.usb.org/defined-class-codes) for class code descriptions.
* `interfaceSubclass` Integer - the subclass of this interface.
* `interfaceProtocol` Integer - the protocol supported by this interface.
* `interfaceName` String (optional) - the name of the interface, if one is provided by the device.
* `endpoints` Object[] - an array containing instances of the [USBEndpoint interface](https://developer.mozilla.org/en-US/docs/Web/API/USBEndpoint) describing each of the endpoints that are part of this interface.
* `endpointNumber` Integer - this endpoint's "endpoint number" which is a value from 1 to 15.
* `direction` String - the direction in which this endpoint transfers data - can be either 'in' or 'out'.
* `type` String - the type of this endpoint - can be either 'bulk', 'interrupt', or 'isochronous'.
* `packetSize` Number - the size of the packets that data sent through this endpoint will be divided into.
Copy link
Member

Choose a reason for hiding this comment

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

We don't have a unified standard in the API docs for this yet (ref electron/docs-parser#144) but can we stick to either String or string for the raw type within this structure?

Copy link
Member

Choose a reason for hiding this comment

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

There's a no-wrapper-object-types rule for ESLint that encourages use of string over String (as well as number over Number, etc.)

Seems worthwhile to conform to that recommendation even if we don't have an easy way to enforce it directly.

Copy link
Member

Choose a reason for hiding this comment

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

The referenced electron/docs-parser PR will enforce it, albeit not in the most user friendly way (by the time the error is thrown, things like line number info aren't available).

@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Jun 19, 2025
@codebytere codebytere force-pushed the web-usb-configurations branch from 407bd77 to 3c4fdc3 Compare June 23, 2025 10:20
Copy link
Member

@erickzhao erickzhao left a comment

Choose a reason for hiding this comment

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

API LGTM

Copy link
Member

@samuelmaddock samuelmaddock left a comment

Choose a reason for hiding this comment

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

API LGTM

Copy link
Member

@itsananderson itsananderson left a comment

Choose a reason for hiding this comment

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

API LGTM

@codebytere codebytere merged commit e299a1d into main Jun 30, 2025
105 of 106 checks passed
@release-clerk
Copy link

release-clerk bot commented Jun 30, 2025

Release Notes Persisted

Added support for USBDevice.configurations.

@codebytere codebytere deleted the web-usb-configurations branch June 30, 2025 08:28
kigh-ota pushed a commit to kigh-ota/electron that referenced this pull request Sep 30, 2025
* feat: support complete WebUSB device properties

* docs: correct type consistency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载