WICG / webhid

Web API for accessing Human Interface Devices (HID)
Other
143 stars 35 forks source link

Is it possible for the Chrome team to supply TypeScript definitions #74

Closed davisford closed 3 years ago

davisford commented 3 years ago

Like title says -- would it be possible get TypeScript definitions for HIDDevice and all the interfaces, etc?

I'm embarking on writing a driver for a USB/HID device after I worked through a PoC to ensure it would work. Seems like I can read/write feature reports, and receive input reports fine with it after experimentation, and now want to build a real driver in TypeScript, but the missing type definitions are problematic. Since this is currently, mostly a Chrome only feature...I doubt Microsoft will include them in official DOM typings.

nondebug commented 3 years ago

There are already some TypeScript definitions in the DefinitelyTyped repository:

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/w3c-web-hid/index.d.ts

These definitions look like they were based on an earlier version of the spec, I'll put together a PR to update them.

nondebug commented 3 years ago

PR: https://github.com/DefinitelyTyped/DefinitelyTyped/pull/54931