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

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

* * @author bbrown@google.com (Brian Brown) */ export default class Decoder { private rsDecoder; constructor(); /** *

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

* * @param bits booleans representing white/black Data Matrix Code modules * @return text and bytes encoded within the Data Matrix Code * @throws FormatException if the Data Matrix Code cannot be decoded * @throws ChecksumException if error correction fails */ decode(bits: BitMatrix): DecoderResult; /** *

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; }