Node USB
    Preparing search index...

    Class WebUSB

    Implements

    • USB
    Index

    Constructors

    Properties

    authorisedDevices: Set<USBDeviceFilter> = ...
    emitter: EventEmitter<any> = ...
    knownDevices: Map<Device, WebUSBDevice> = ...

    Accessors

    • set onconnect(fn: (ev: USBConnectionEvent) => void): void

      Parameters

      • fn: (ev: USBConnectionEvent) => void

      Returns void

    • set ondisconnect(fn: (ev: USBConnectionEvent) => void): void

      Parameters

      • fn: (ev: USBConnectionEvent) => void

      Returns void

    Methods

    • Parameters

      • type: "connect" | "disconnect"
      • listener: (this: this, ev: USBConnectionEvent) => void

      Returns void

    • Parameters

      • type: "connect" | "disconnect"
      • listener: EventListener

      Returns void

    • The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.

      MDN Reference

      Parameters

      • _event: Event

      Returns boolean

    • Gets all allowed Web USB devices which are connected

      Returns Promise<USBDevice[]>

      Promise containing an array of devices

    • Parameters

      • type: "connect" | "disconnect"
      • callback: (this: this, ev: USBConnectionEvent) => void

      Returns void

    • Parameters

      • type: "connect" | "disconnect"
      • callback: EventListener

      Returns void

    • Requests a single Web USB device

      Parameters

      • Optionaloptions: USBDeviceRequestOptions

        The options to use when scanning

      Returns Promise<USBDevice>

      Promise containing the selected device