Class ScanDataReader<T>

Raw data reader that automatically handles SANE's read code flow.

Use ScanDataReader.on to listen to events, available event types are declared on ScanDataReaderEventMap.

A device should already be open with sane_open(), the reader will call sane_start() do the scanning and call sane_stop().

Other SANE functions cannot be used while scanning.

Scan readers are single use.

https://sane-project.gitlab.io/standard/1.06/api.html#code-flow

Type Parameters

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

_killed: boolean | Error = false
_lib: LibSANE
_used: boolean = false

Methods

  • Fire event.

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • type: K
    • Rest ...args: T[K]
      Rest

    Returns null | Promise<null>

  • Add event listener.

    Type Parameters

    • K extends string | number | symbol

    Parameters

    • type: K
    • listener: ((...args) => void)
        • (...args): void
        • Parameters

          • Rest ...args: T[K]
            Rest

          Returns void

    Returns void

Generated using TypeDoc