static encode(content, ecLevel, hints = null) {
			// Determine what character encoding has been specified by the caller, if any
			let encoding = Encoder.DEFAULT_BYTE_MODE_ENCODING;
			const hasEncodingHint = hints !== null && undefined !== hints.get(EncodeHintType$1.CHARACTER_SET);
			if (hasEncodingHint) {
				encoding = hints.get(EncodeHintType$1.CHARACTER_SET).toString();
			}
			// Pick an encoding mode appropriate for the content. Note that this will not attempt to use
			// multiple modes / segments even if that were more efficient. Twould be nice.
			const mode = this.chooseMode(content, encoding);
			// This will store the header information, like mode and
			// length, as well as "header" segments like an ECI segment.
			const headerBits = new BitArray();
			// Append ECI segment if applicable
			if (mode === Mode$1.BYTE && (hasEncodingHint || Encoder.DEFAULT_BYTE_MODE_ENCODING !== encoding)) {
				const eci = CharacterSetECI.getCharacterSetECIByName(encoding);
				if (eci !== undefined) {
					this.appendECI(eci, headerBits);
				}
			}
			// (With ECI in place,) Write the mode marker
			this.appendModeInfo(mode, headerBits);
			// Collect data within the main segment, separately, to count its size if needed. Don't add it to
			// main payload yet.
			const dataBits = new BitArray();
			this.appendBytes(content, mode, dataBits, encoding);
			let version;
			if (hints !== null && undefined !== hints.get(EncodeHintType$1.QR_VERSION)) {
				const versionNumber = Number.parseInt(hints.get(EncodeHintType$1.QR_VERSION).toString(), 10);
				version = Version$1.getVersionForNumber(versionNumber);
				const bitsNeeded = this.calculateBitsNeeded(mode, headerBits, dataBits, version);
				if (!this.willFit(bitsNeeded, version, ecLevel)) {
					throw new WriterException('Data too big for requested version');
				}
			}
			else {
				version = this.recommendVersion(ecLevel, mode, headerBits, dataBits);
			}
			const headerAndDataBits = new BitArray();
			headerAndDataBits.appendBitArray(headerBits);
			// Find "length" of main segment and write it
			const numLetters = mode === Mode$1.BYTE ? dataBits.getSizeInBytes() : content.length;
			this.appendLengthInfo(numLetters, version, mode, headerAndDataBits);
			// Put data together into the overall payload
			headerAndDataBits.appendBitArray(dataBits);
			const ecBlocks = version.getECBlocksForLevel(ecLevel);
			const numDataBytes = version.getTotalCodewords() - ecBlocks.getTotalECCodewords();
			// Terminate the bits properly.
			this.terminateBits(numDataBytes, headerAndDataBits);
			// Interleave data bits with error correction code.
			const finalBits = this.interleaveWithECBytes(headerAndDataBits, version.getTotalCodewords(), numDataBytes, ecBlocks.getNumBlocks());
			const qrCode = new QRCode();
			qrCode.setECLevel(ecLevel);
			qrCode.setMode(mode);
			qrCode.setVersion(version);
			//  Choose the mask pattern and set to "qrCode".
			const dimension = version.getDimensionForVersion();
			const matrix = new ByteMatrix(dimension, dimension);
			const maskPattern = this.chooseMaskPattern(finalBits, ecLevel, version, matrix);
			qrCode.setMaskPattern(maskPattern);
			// Build the matrix and set it to "qrCode".
			MatrixUtil.buildMatrix(finalBits, ecLevel, version, maskPattern, matrix);
			qrCode.setMatrix(matrix);
			return qrCode;
		}
@param content text to encode
@param ecLevel error correction level to use
@return {@link QRCode} representing the encoded QR code
@throws WriterException if encoding can't succeed, because of for example invalid content
  or configuration