UNPKG

code-craft-studio

Version:

A comprehensive QR code and barcode scanning/generation library for React. Works with or without Capacitor. Supports 22+ QR data types and 14+ barcode formats (EAN, UPC, Code 128, etc.), with customizable designs, analytics, and React components. Provider

76 lines (75 loc) 2.32 kB
import { QRType, QRData } from '../types'; /** * Validates if a string is a valid URL */ export declare function isValidUrl(url: string): boolean; /** * Validates if a string is a valid email address */ export declare function isValidEmail(email: string): boolean; /** * Validates if a string is a valid phone number */ export declare function isValidPhoneNumber(phone: string): boolean; /** * Validates if a string is a valid hex color */ export declare function isValidHexColor(color: string): boolean; /** * Validates if a number is a valid QR code size */ export declare function isValidQRSize(size: number): boolean; /** * Validates QR data based on type */ export declare function validateQRData(type: QRType, data: QRData): boolean; /** * Validates EAN-13 barcode (13 digits with checksum) */ export declare function isValidEAN13(code: string): boolean; /** * Validates EAN-8 barcode (8 digits with checksum) */ export declare function isValidEAN8(code: string): boolean; /** * Validates UPC-A barcode (12 digits with checksum) */ export declare function isValidUPCA(code: string): boolean; /** * Validates UPC-E barcode (8 digits, converts to UPC-A internally) */ export declare function isValidUPCE(code: string): boolean; /** * Validates Code 128 barcode (alphanumeric with ASCII 0-127) */ export declare function isValidCode128(code: string): boolean; /** * Validates Code 39 barcode (uppercase letters, digits, and special characters) */ export declare function isValidCode39(code: string): boolean; /** * Validates Code 93 barcode (similar to Code 39 but more compact) */ export declare function isValidCode93(code: string): boolean; /** * Validates ITF (Interleaved 2 of 5) barcode (even number of digits) */ export declare function isValidITF(code: string): boolean; /** * Validates Codabar barcode (digits and special start/stop characters) */ export declare function isValidCodabar(code: string): boolean; /** * Validates barcode data based on format */ export declare function validateBarcodeData(format: string, data: string): boolean; /** * Gets barcode format constraints */ export declare function getBarcodeConstraints(format: string): { minLength?: number; maxLength?: number; fixedLength?: number; pattern?: string; description: string; };