@qr-platform/qr-code.js
Version:
QRCode.js is a professional JavaScript/TypeScript library for creating customized QR codes, offering a blend of simplicity and sophistication. With versatile styling options—dot shapes, colors, gradients, embedded images, borders, and text—it enables you
52 lines (51 loc) • 1.34 kB
TypeScript
import { BrowserQRCodeReader } from '~/lib/zxing-js/src';
import QRCodeReader from '~/lib/zxing-js/src/core/qrcode/QRCodeReader';
import QRValidatorZbar from '../../plugins/QRValidatorZbar';
export interface ScanValidatorResponse {
/**
* Whether QR code was successfully validated
*/
isValid: boolean;
/**
* Decoded data from the QR code
*/
data?: string | null;
/**
* Format of the detected barcode
*/
format?: string;
/**
* Whether the successful decode was from an inverted image
*/
isInverted?: boolean;
/**
* Additional message about the validation result
*/
message?: string;
/**
* Number of attempts made during validation
*/
attempts?: number;
/**
* Error code if validation failed
*/
errorCode?: string;
/**
* Validator used for the validation
*/
validator?: string;
}
declare class AbstractScanValidator {
debug: boolean;
validatorName: string;
log(message: any): void;
}
export default AbstractScanValidator;
export interface ScanValidator {
validator: QRValidatorZbar | QRCodeReader | BrowserQRCodeReader;
validate(...args: any): Promise<ScanValidatorResponse>;
}
export interface DecodeAttempt {
name: string;
execute(): Promise<ScanValidatorResponse>;
}