Class AnylineJS

Properties

camera: CameraAPI

Camera API

isLoaded: boolean = false
onError: ((error: LegacyErrorObject) => void)

Callback called when some (not all) Errors occur

Type declaration

    • (error): void
    • Parameters

      Returns void

since version 31.0.0 (Errors should be catched when calling the methods, which provides proper stack-trace)

onLoad: ((video: HTMLVideoElement) => void)

Callback called when scanning is started

Type declaration

    • (video): void
    • Parameters

      • video: HTMLVideoElement

        video Element

      Returns void

since version 31.0.0 (startScanning is now resolving a promise)

onPerformanceLog: ((perflog: any) => void)

Callback called when a scan yielded in a performance log

Type declaration

    • (perflog): void
    • Parameters

      • perflog: any

        object containing the performance log

      Returns void

onResult: ((result: AnylineJSResult) => void)

Callback called when a scan yielded in a result

Type declaration

    • (result): void
    • Parameters

      Returns void

onScannedBarcodes: ((result: AnylineJSResult) => void)

Callback called when any Barcodes are detected.

Type declaration

    • (result): void
    • Parameters

      Returns void

Methods

  • Returns an object with the full image and its cutout from the SDK.

    Returns undefined | ImageObject

    • An object with full image and its cutout, or undefined if no image is in the buffer.
  • Pause the scan process

    Returns void

    NotScanningError This exception is thrown if anylineJS was not started before calling this method

  • Starts the scan process

    Returns Promise<null | HTMLVideoElement>

    A promise resolving the video element of the feed

    PermissionError This exception is thrown if the camera access was denied

    AnylineError This exception is thrown if something internally is wrong like licensing issues

    DisposedError This exception is thrown if anylineJS is already disposed

  • Stops the scan process

    Returns void

    NotScanningError This exception is thrown if anylineJS was not started before calling this method