import React from 'react'; export interface QrCodeScannerProps { style?: React.CSSProperties; dataType?: 'url' | 'text'; legacyMode?: boolean; validate?: (...args: any[]) => boolean; onScan: (...args: any[]) => void; onError: (err: any, data: any) => void; onLoad?: (...args: any[]) => void; onImageLoad?: (...args: any[]) => void; delay?: number; facingMode?: 'user' | 'environment'; showViewFinder?: boolean; className?: string; children?: React.ReactNode; } /** * QRCodeScanner assumes that the data provided inside the QR code image, * are a HTTP link, thus it uses the `encodeURI` function to escape * all scanned data that will be forwarded to the `onScan` function * * When a QR code is scanned, before we run the `onScan` callback function, * we do the following: * * 1. Run a validator function provided in the props of QrCodeScanner component * that receives the *raw* scanned data and returns a boolean type. (eg. check * if it's a gov.gr subdomain, or that it matches the current domain) * 2. If the validator returns `true`, then construct a URL object from the data provided * and check if the protocol is `https` and the `origin` is the same as the origin of this page * 2. Automatically fallback to the `onError` callback function, if the validation or url check fail * 3. Finally, run `onScan` callback function with the scanned data encoded as a URI. * */ export declare const QrCodeScanner: React.FC; export default QrCodeScanner;