zxing-wasm
    Preparing search index...

    Interface ReadResult

    Result of reading a barcode.

    interface ReadResult {
        bytes: Uint8Array;
        bytesECI: Uint8Array;
        contentType:
            | "Text"
            | "Binary"
            | "Mixed"
            | "GS1"
            | "ISO15434"
            | "UnknownECI";
        ecLevel: EcLevel;
        error: string;
        extra: string;
        format: ReadOutputBarcodeFormat;
        hasECI: boolean;
        isInverted: boolean;
        isMirrored: boolean;
        isValid: boolean;
        lineCount: number;
        orientation: number;
        position: Position;
        readerInit: boolean;
        sequenceId: string;
        sequenceIndex: number;
        sequenceSize: number;
        symbol: BarcodeSymbol;
        symbology: | "Codabar"
        | "Code39"
        | "Code93"
        | "Code128"
        | "ITF"
        | "DataBar"
        | "EANUPC"
        | "OtherBarcode"
        | "PDF417"
        | "Aztec"
        | "QRCode"
        | "DataMatrix"
        | "MaxiCode";
        symbologyIdentifier: string;
        text: string;
        version: string;
    }

    Hierarchy

    • Omit<ZXingReadResult, "format" | "symbology" | "contentType" | "position">
      • ReadResult
    Index

    Properties

    bytes: Uint8Array

    Raw / Standard content without any modifications like character set conversions.

    bytesECI: Uint8Array

    Raw / Standard content following the ECI protocol.

    contentType: "Text" | "Binary" | "Mixed" | "GS1" | "ISO15434" | "UnknownECI"

    A hint to the type of the content found.

    ecLevel: EcLevel

    Error correction level of the symbol (empty string if not applicable).

    Parse the result from ReadResult.extra instead.

    error: string

    Error message (if any).

    extra: string

    A stringified JSON object containing additional information about the barcode.

    The final form of this property is not yet settled and may change without a major version bump.

    Canonical format name of the barcode.

    Values are constrained by ReadOutputBarcodeFormat (plus "None" for empty/invalid results) and come from the C++ wrapper in canonical enum-name form (not alias or HRI label form).

    hasECI: boolean

    Whether or not an ECI tag was found.

    isInverted: boolean

    Whether the symbol is inverted / has reversed reflectance.

    isMirrored: boolean

    Whether the symbol is mirrored (currently only supported by QRCode and DataMatrix).

    isValid: boolean

    Whether the barcode is valid.

    lineCount: number

    Number of lines that have been detected with this code (applies only to linear symbologies).

    orientation: number

    Orientation of the barcode in degree.

    position: Position

    Position of the detected barcode.

    readerInit: boolean

    Set if this is the reader initialisation / programming symbol.

    Parse the result from ReadResult.extra instead.

    sequenceId: string

    ID to check if a set of symbols belongs to the same structured append sequence.

    If the symbology does not support this feature, the returned value is empty (see MaxiCode). For QR Code, this is the parity integer converted to a string. For PDF417 and DataMatrix, this is the "fileId".

    sequenceIndex: number

    The 0-based index of this symbol in a structured append sequence.

    sequenceSize: number

    Number of symbols in a structured append sequence.

    If this is not part of a structured append sequence, the returned value is -1. If it is a structured append symbol but the total number of symbols is unknown, the returned value is 0 (see PDF417 if optional "Segment Count" not given).

    Barcode symbol in the shape of a one-channel image.

    The final form of this property is not yet settled and may change without a major version bump.

    symbology:
        | "Codabar"
        | "Code39"
        | "Code93"
        | "Code128"
        | "ITF"
        | "DataBar"
        | "EANUPC"
        | "OtherBarcode"
        | "PDF417"
        | "Aztec"
        | "QRCode"
        | "DataMatrix"
        | "MaxiCode"

    Symbology group / base barcode family of ReadResult.format.

    Example: EAN13 -> EANUPC, MicroQRCode -> QRCode, Code39Ext -> Code39.

    symbologyIdentifier: string

    Symbology identifier "]cm" where "c" is the symbology code character, "m" the modifier.

    text: string

    The ReadResult.bytes content rendered to unicode / utf8 text according to specified ReaderOptions.textMode.

    version: string

    QRCode / DataMatrix / Aztec version or size.

    Parse the result from ReadResult.extra instead.