import { ExtendedDevice } from './device'; import * as usb from './bindings'; interface EventListeners { newListener: keyof T; removeListener: keyof T; } interface DeviceIds { idVendor: number; idProduct: number; } declare module './bindings' { interface Device extends ExtendedDevice { } interface DeviceEvents extends EventListeners { attach: Device; detach: Device; attachIds: DeviceIds; detachIds: DeviceIds; } function addListener(event: K, listener: (arg: DeviceEvents[K]) => void): void; function removeListener(event: K, listener: (arg: DeviceEvents[K]) => void): void; function on(event: K, listener: (arg: DeviceEvents[K]) => void): void; function off(event: K, listener: (arg: DeviceEvents[K]) => void): void; function once(event: K, listener: (arg: DeviceEvents[K]) => void): void; function listeners(event: K): ((arg: DeviceEvents[K]) => void)[]; function rawListeners(event: K): ((arg: DeviceEvents[K]) => void)[]; function removeAllListeners(event?: K): void; function emit(event: K, arg: DeviceEvents[K]): boolean; function listenerCount(event: K): number; } export = usb;