From f85acea83a358ad750ffadff0dc75c45c9ae88d0 Mon Sep 17 00:00:00 2001 From: Sandeep Mistry Date: Sun, 13 Jan 2019 15:52:54 -0500 Subject: [PATCH] Add definition for usb.removeListener(...) --- types/usb/index.d.ts | 1 + types/usb/usb-tests.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/types/usb/index.d.ts b/types/usb/index.d.ts index 2543f0b06e..9bf7b10dc2 100644 --- a/types/usb/index.d.ts +++ b/types/usb/index.d.ts @@ -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; diff --git a/types/usb/usb-tests.ts b/types/usb/usb-tests.ts index d4b36d16df..fcc658ddcc 100644 --- a/types/usb/usb-tests.ts +++ b/types/usb/usb-tests.ts @@ -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);