import { TSVueIcons } from 'v2/Icon/Icon.vue.d'; import { TSButtonProps } from 'v2/Button/Button.vue.d'; import { ClassComponent } from '../ts-helpers'; export type ScannerErrorCode = | 'DRIVER_NOT_FOUND' | 'DEVICE_NOT_CONNECTED' | 'NOT_SUPPORTED_SYSTEM' | 'HARDWARE_NOT_SYNCHRONIZED'; export type ScannerErrorMessage = { title: string; detail: string; }; export type Device = { jenisDevice: string; serialNumber: string; API: string; rfidScan: boolean; qrScan: boolean; }; export type RegisteredDevice = { _id: string; imageSmall: string; imageBig: string; serialNumber: string; status: string; lastReportDate: string; createdAt: string; updatedAt: string; group: null; name: string; }; export type DeviceList = Device[]; export interface ButtonScanProps extends TSButtonProps { /** * Set custom button label. * * @default Scan Type */ label?: string; /** * Set custom button icon. * * @default 'qr' | 'rfid' */ icon?: TSVueIcons; /** * Scpecify the scan type */ type?: 'RFID' | 'QR'; /** * The value of the input (tag). * * @deprecated use `onScan` instead. */ modelValue?: string; /** * Whether the scanner is in bulk mode. * * @toto add support bulk scan */ bulk?: boolean; /** * The id of the button element. */ id?: string; /** * Wether the button should be disabled. */ disabled?: boolean; /** * Whether the scanner is a powerbank. * * @deprecated */ powerbank?: boolean; /** * Display the label only (wihout icon). * * @default false */ labelOnly?: boolean; size: 'small' | 'large'; } export type ButtonScanEmits = { 'update:modelValue': [tag: string]; 'connect': []; 'connected': [device?: Device]; 'scan': [tag: string]; 'stop': []; 'error': [error: unknown | Event]; 'beforeStartScan': []; }; export type ButtonScanExposes = { onBeforeStartScan: () => void; startScan: () => void; stopScan: (afterScan?: boolean) => void; }; /** * **TSVue v2 - ButtonScan** * * _ButtonScan is component for scanning RFID or QR Tag._ * * --- --- * ![TSVue](https://ik.imagekit.io/kurniadev/TS-HEAD-BLACK.png) * * @group Component */ declare class ButtonScan extends ClassComponent< ButtonScanProps, ButtonScanEmits, Record > { /** * Method to stop the scan process. */ stopScan: () => Promise; } export default ButtonScan;