Merge pull request #32106 from sandeepmistry/usb-removeListener

[usb] Add definition for usb.removeListener(...)
This commit is contained in:
Daniel Rosenwasser
2019-01-15 15:50:22 -08:00
committed by GitHub
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -137,6 +137,7 @@ export class EndpointDescriptor {
export function findByIds(vid: number, pid: number): Device;
export function on(event: string, callback: (device: Device) => void): void;
export function removeListener(event: string, callback: (device: Device) => void): void;
export function getDeviceList(): Device[];
export function setDebugLevel(level: number): void;
+1
View File
@@ -124,6 +124,7 @@ iface.endpoints = [inEndpoint, outEndpoint];
const findByDevice: usb.Device = usb.findByIds(1, 1);
usb.on("hey", (device: usb.Device) => null);
usb.removeListener("hey", (device: usb.Device) => null);
const deviceList: usb.Device[] = usb.getDeviceList();
usb.setDebugLevel(1);