Skip to content

Commit

Permalink
Fix generateDeviceInfo type (#525)
Browse files Browse the repository at this point in the history
The HID object contains a function "getDeviceInfo", but the type definition declared it as "generateDeviceInfo", which causes a compilation error.

This commit only renames the exposed function's name to getDeviceInfo.

```
HID {
  _events: [Object: null prototype] { newListener: [Function (anonymous)] },
  _eventsCount: 1,
  _maxListeners: undefined,
  _raw: HID {},
  write: [Function: bound write],
  getFeatureReport: [Function: bound getFeatureReport],
  sendFeatureReport: [Function: bound sendFeatureReport],
  setNonBlocking: [Function: bound setNonBlocking],
  readSync: [Function: bound readSync],
  readTimeout: [Function: bound readTimeout],
  getDeviceInfo: [Function: bound getDeviceInfo],
  _paused: true,
  [Symbol(kCapture)]: false
}
```
  • Loading branch information
wabosh committed Dec 6, 2023
1 parent 525c661 commit 484d134
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nodehid.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class HID extends EventEmitter {
resume(): void
write(values: number[] | Buffer): number
setNonBlocking(no_block: boolean): void
generateDeviceInfo(): Device
getDeviceInfo(): Device
}
export function devices(vid: number, pid: number): Device[]
export function devices(): Device[]
Expand Down

0 comments on commit 484d134

Please sign in to comment.