mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 15:00:26 +00:00
Updating based on https://github.com/node-hid/node-hid/commit/0ff75bf17212243d7f1d05e445a3dbead0f5ab08 Additional event handles added as HID class inherits directly from Node's EventEmitter
22 lines
439 B
TypeScript
22 lines
439 B
TypeScript
import HID = require('node-hid');
|
|
|
|
const devices = HID.devices();
|
|
|
|
let device = new HID.HID("path");
|
|
|
|
device = new HID.HID(12, 22);
|
|
device.setNonBlocking(true);
|
|
|
|
device.on("data", data => {});
|
|
device.once("data", data => {});
|
|
device.on("error", err => {});
|
|
|
|
device.write([0x00, 0x01, 0x01, 0x05, 0xff, 0xff]);
|
|
|
|
device.pause();
|
|
device.resume();
|
|
|
|
device.removeListener("data", data => {});
|
|
device.removeAllListeners("data");
|
|
device.close();
|