import Vnmf from '../../index' declare module '../../index' { namespace scanCode { interface Option { /** Interface call to the end of echo function(Call successfully、Any failure will be enforced.) */ complete?: (res: VnmfGeneral.CallbackResult) => void /** Interface call failed echo function */ fail?: (res: VnmfGeneral.CallbackResult) => void /** Can't you just sweep the camera?,Can not get folder: %s: %s */ onlyFromCamera?: boolean /** Scanning Type */ scanType?: (keyof ScanType)[] /** Interface calls a successful echo function */ success?: (result: SuccessCallbackResult) => void } interface SuccessCallbackResult extends VnmfGeneral.CallbackResult { /** Scoring Characterset */ charSet: string /** When the code cleared is current applet 2-D,Will return this field,It's two-dimensional. path */ path: string /** Raw data,base64Encoding */ rawData: string /** The contents of the varnish code */ result: string /** Type of sweep */ scanType: keyof QRType /** Call Results */ errMsg: string } /** Scanning Type */ interface ScanType { /** One-dimensional. */ barCode /** Two-dimensional code. */ qrCode /** Data Matrix Code */ datamatrix /** PDF417 Barcode */ pdf417 } /** Type of sweep */ interface QRType { /** Two-dimensional code. */ QR_CODE /** One-dimensional. */ AZTEC /** One-dimensional. */ CODABAR /** One-dimensional. */ CODE_39 /** One-dimensional. */ CODE_93 /** One-dimensional. */ CODE_128 /** Two-dimensional code. */ DATA_MATRIX /** One-dimensional. */ EAN_8 /** One-dimensional. */ EAN_13 /** One-dimensional. */ ITF /** One-dimensional. */ MAXICODE /** Two-dimensional code. */ PDF_417 /** One-dimensional. */ RSS_14 /** One-dimensional. */ RSS_EXPANDED /** One-dimensional. */ UPC_A /** One-dimensional. */ UPC_E /** One-dimensional. */ UPC_EAN_EXTENSION /** Two-dimensional code. */ WX_CODE /** One-dimensional. */ CODE_25 } } interface VnmfStatic { /** * Move client-scan interface,Returns the corresponding result after scan has been successful * @supported weapp, h5, rn, tt * @example * ```tsx * // Allow scans from cameras and albums * Vnmf.scanCode({ * success: (res) => { * console.log(res) * } * }) * // Only scans from the camera are allowed. * Vnmf.scanCode({ * onlyFromCamera: true, * success: (res) => { * console.log(res) * } * }) * ``` * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/scan/wx.scanCode.html */ scanCode(option: scanCode.Option): Promise } }