import BitMatrix from '../../common/BitMatrix'; import DecoderResult from '../../common/DecoderResult'; import DecodeHintType from '../../DecodeHintType'; /** *

The main class which implements QR Code decoding -- as opposed to locating and extracting * the QR Code from an image.

* * @author Sean Owen */ export default class Decoder { private rsDecoder; constructor(); /** *

Convenience method that can decode a QR Code represented as a 2D array of booleans. * "true" is taken to mean a black module.

* * @param image booleans representing white/black QR Code modules * @param hints decoding hints that should be used to influence decoding * @return text and bytes encoded within the QR Code * @throws FormatException if the QR Code cannot be decoded * @throws ChecksumException if error correction fails */ decodeBooleanArray(image: boolean[][], hints?: Map): DecoderResult; /** *

Decodes a QR Code represented as a {@link BitMatrix}. A 1 or "true" is taken to mean a black module.

* * @param bits booleans representing white/black QR Code modules * @param hints decoding hints that should be used to influence decoding * @return text and bytes encoded within the QR Code * @throws FormatException if the QR Code cannot be decoded * @throws ChecksumException if error correction fails */ decodeBitMatrix(bits: BitMatrix, hints?: Map): DecoderResult; private decodeBitMatrixParser; /** *

Given data and error-correction codewords received, possibly corrupted by errors, attempts to * correct the errors in-place using Reed-Solomon error correction.

* * @param codewordBytes data and error correction codewords * @param numDataCodewords number of codewords that are data bytes * @throws ChecksumException if error correction fails */ private correctErrors; }