@types/node-hid: wrong type for input argument of HID.setNonBlocking() #53977
Unanswered
stevenChuCP
asked this question in
Issues with a @types package
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to enable non-blocking reads to my hid device.
And as the type definition file stated, the argument of the corresponding function is a type of
boolean
.When I called this function like this:
device.setNonBlocking(true);
There is always an error saying a number was expected instead.
Below is the error information of the console output.
As I was looking into the source code of node-hid.
I found out that the input parameter is a type of integer instead of a boolean.
This is the link to the code
I've changed the type of the input parameter in the index.d.ts file to
number
.And seems like it worked.
Does anyone have this problem before?
Beta Was this translation helpful? Give feedback.
All reactions