write(contents, width, height, hints = null) {
        if (contents.length === 0) {
            throw new IllegalArgumentException('Found empty contents');
        }
        // if (format != BarcodeFormat.QR_CODE) {
        //   throw new IllegalArgumentException("Can only encode QR_CODE, but got " + format)
        // }
        if (width < 0 || height < 0) {
            throw new IllegalArgumentException('Requested dimensions are too small: ' + width + 'x' + height);
        }
        let errorCorrectionLevel = ErrorCorrectionLevel.L;
        let quietZone = BrowserQRCodeSvgWriter.QUIET_ZONE_SIZE;
        if (hints !== null) {
            if (undefined !== hints.get(EncodeHintType.ERROR_CORRECTION)) {
                errorCorrectionLevel = ErrorCorrectionLevel.fromString(hints.get(EncodeHintType.ERROR_CORRECTION).toString());
            }
            if (undefined !== hints.get(EncodeHintType.MARGIN)) {
                quietZone = Number.parseInt(hints.get(EncodeHintType.MARGIN).toString(), 10);
            }
        }
        const code = Encoder.encode(contents, errorCorrectionLevel, hints);
        return this.renderResult(code, width, height, quietZone);
    }
/**
     * Writes and renders a QRCode SVG element.
     *
     * @param contents
     * @param width
     * @param height
     * @param hints
     */
Writes and renders a QRCode SVG element.
Writes and renders a QRCode SVG element .
write(contents, width, height, hints = null) {
        if (contents.length === 0) {
            throw new IllegalArgumentException('Found empty contents');
        }
        if (width < 0 || height < 0) {
            throw new IllegalArgumentException('Requested dimensions are too small: ' + width + 'x' + height);
        }
        let errorCorrectionLevel = ErrorCorrectionLevel.L;
        let quietZone = BrowserQRCodeSvgWriter.QUIET_ZONE_SIZE;
        if (hints !== null) {
            if (undefined !== hints.get(EncodeHintType.ERROR_CORRECTION)) {
                errorCorrectionLevel = ErrorCorrectionLevel.fromString(hints.get(EncodeHintType.ERROR_CORRECTION).toString());
            }
            if (undefined !== hints.get(EncodeHintType.MARGIN)) {
                quietZone = Number.parseInt(hints.get(EncodeHintType.MARGIN).toString(), 10);
            }
        }
        const code = Encoder.encode(contents, errorCorrectionLevel, hints);
        return this.renderResult(code, width, height, quietZone);
    }
write ( contents , width , height , hints = null ) { if ( contents . length === 0 ) { throw new IllegalArgumentException ( 'Found empty contents' ) ; } if ( width < 0 || height < 0 ) { throw new IllegalArgumentException ( 'Requested dimensions are too small: ' + width + 'x' + height ) ; } let errorCorrectionLevel = ErrorCorrectionLevel . L ; let quietZone = BrowserQRCodeSvgWriter . QUIET_ZONE_SIZE ; if ( hints !== null ) { if ( undefined !== hints . get ( EncodeHintType . ERROR_CORRECTION ) ) { errorCorrectionLevel = ErrorCorrectionLevel . fromString ( hints . get ( EncodeHintType . ERROR_CORRECTION ) . toString ( ) ) ; } if ( undefined !== hints . get ( EncodeHintType . MARGIN ) ) { quietZone = Number . parseInt ( hints . get ( EncodeHintType . MARGIN ) . toString ( ) , 10 ) ; } } const code = Encoder . encode ( contents , errorCorrectionLevel , hints ) ; return this . renderResult ( code , width , height , quietZone ) ; }
Writes and renders a QRCode SVG element.
Writes and renders a QRCode SVG element .
// if (format != BarcodeFormat.QR_CODE) { //   throw new IllegalArgumentException("Can only encode QR_CODE, but got " + format) // }