A scanned code.

interface Code {
    corners?: Point[];
    frame?: {
        height: number;
        width: number;
        x: number;
        y: number;
    };
    type: CodeType | "unknown";
    value?: string;
}

Properties

corners?: Point[]

The location of each corner relative to the Camera Preview (in dp).

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

The location of the code relative to the Camera Preview (in dp).

Type declaration

  • height: number
  • width: number
  • x: number
  • y: number
type: CodeType | "unknown"

The type of the code that was scanned.

value?: string

The string value, or null if it cannot be decoded.