/// import { TypedDispatcher } from "./dispatcher"; import { W3CUSB } from "./interfaces"; /** * USB Options */ export interface USBOptions { /** * A `device found` callback function to allow the user to select a device */ devicesFound?: (devices: Array) => Promise; } /** * @hidden */ export interface USBEvents { /** * USBDevice connected event */ connect: USBConnectionEvent; /** * USBDevice disconnected event */ disconnect: USBConnectionEvent; } declare const USB_base: new () => TypedDispatcher; /** * USB class */ export declare class USB extends USB_base implements W3CUSB { private allowedDevices; private autoAllowDevices; private devicesFound; private _onconnect; set onconnect(fn: (ev: USBConnectionEvent) => void); private _ondisconnect; set ondisconnect(fn: (ev: USBConnectionEvent) => void); /** * USB constructor * @param options USB initialisation options */ constructor(options?: USBOptions); private isAllowedDevice; private isSameDevice; private filterDevice; allowDevices(options: USBDeviceRequestOptions): void; /** * Gets all allowed Web USB devices which are connected * @returns Promise containing an array of devices */ getDevices(): Promise>; /** * Requests a single Web USB device * @param options The options to use when scanning * @returns Promise containing the selected device */ requestDevice(options: USBDeviceRequestOptions): Promise; } export {};