@progress/kendo-angular-barcodes
Version: 
Kendo UI Angular Barcodes
28 lines (27 loc) • 1.14 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 particular Barcode type.
 *
 * @param {QRCodeEncoding} encoding The QR Code encoding. Defaults to 'ISO_8859_1'.
 * @returns {ValidatorFn}  A validator function that returns an error map with the `qrcode` property if the validation check fails, otherwise `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;