A scanner for detecting codes in a Camera Stream.

interface CodeScanner {
    codeTypes: CodeType[];
    onCodeScanned: ((codes, frame) => void);
    regionOfInterest?: {
        height: number;
        width: number;
        x: number;
        y: number;
    };
}

Properties

codeTypes: CodeType[]

The types of codes to configure the code scanner for.

onCodeScanned: ((codes, frame) => void)

A callback to call whenever the scanned codes change.

Type declaration

    • (codes, frame): void
    • Parameters

      • codes: Code[]

        The scanned codes, or an empty array if none.

      • frame: CodeScannerFrame

        The full area that is used for scanning. Code bounds and corners are relative to this frame.

      Returns void

regionOfInterest?: {
    height: number;
    width: number;
    x: number;
    y: number;
}

Crops the scanner's view area to the specific region of interest.

Type declaration

  • height: number
  • width: number
  • x: number
  • y: number

Platform

iOS