@progress/kendo-angular-barcodes
Version:
Kendo UI Angular Barcodes
28 lines (27 loc) • 1.17 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
import { ValidatorFn } from '@angular/forms';
import { QRCodeEncoding } from './chart-types';
/**
* Creates a value validator for a specific QR Code encoding.
*
* @param {QRCodeEncoding} encoding Sets the QR Code encoding. Defaults to `ISO_8859_1`.
* @returns {ValidatorFn} Returns a validator function. The function returns an error map with the `qrcode` property if the value is invalid. Otherwise, it returns `null`.
*
* @example
* ```ts-no-run
* const control = new FormControl('Фоо', createQRCodeValidator());
* console.log(control.errors);
*
* // {
* // qrcode: {
* // message: 'Unsupported character in QR Code: "Ф".',
* // value: '1234',
* // type: 'EAN13'
* // }
* // }
* ```
*/
export declare const createQRCodeValidator: (encoding?: QRCodeEncoding) => ValidatorFn;