-
Notifications
You must be signed in to change notification settings - Fork 16.5k
feat: support complete WebUSB device properties #47459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
docs/api/structures/usb-device.md
Outdated
* `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. |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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).
407bd77
to
3c4fdc3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API LGTM
Release Notes Persisted
|
* feat: support complete WebUSB device properties * docs: correct type consistency
Description of Change
Similar vein as #47391 - we should expose the full property set of [
USBDevice
] per spec.Checklist
npm test
passesRelease Notes
Notes: Added support for
USBDevice.configurations
.