1.0.3 • Published 4 years ago
imotion-scanner v1.0.3
imotion-scanner
For imotion scanner
Install
npm install imotion-scanner
npx cap sync
API
connectDevice()
disconnectDevice()
addListener('barcodeScanChange', ...)
addListener('scanTimeoutChange', ...)
addListener('ScanEventChange', ...)
removeAllListeners()
- Interfaces
- Type Aliases
connectDevice()
connectDevice() => Promise<ResultStatus>
Connect handheld scanner service
Returns: Promise<ResultStatus>
Since: 1.0.0
disconnectDevice()
disconnectDevice() => Promise<ResultStatus>
Disconnect handheld scanner service
Returns: Promise<ResultStatus>
Since: 1.0.0
addListener('barcodeScanChange', ...)
addListener(eventName: 'barcodeScanChange', listenerFunc: barcodeScanListener) => Promise<PluginListenerHandle> & PluginListenerHandle
Listen to the scanner return
Param | Type |
---|---|
eventName | 'barcodeScanChange' |
listenerFunc | barcodeScanListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 1.0.0
addListener('scanTimeoutChange', ...)
addListener(eventName: 'scanTimeoutChange', listenerFunc: scanTimeoutListener) => Promise<PluginListenerHandle> & PluginListenerHandle
監聽掃描器操作是否逾時
Param | Type |
---|---|
eventName | 'scanTimeoutChange' |
listenerFunc | scanTimeoutListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 1.0.0
addListener('ScanEventChange', ...)
addListener(eventName: 'ScanEventChange', listenerFunc: scanEventListener) => Promise<PluginListenerHandle> & PluginListenerHandle
監聽掃描器操作
Param | Type |
---|---|
eventName | 'ScanEventChange' |
listenerFunc | scanEventListener |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
Since: 1.0.0
removeAllListeners()
removeAllListeners() => Promise<void>
移除本套件所有監聽事件
Since: 1.0.0
Interfaces
ResultStatus
Prop | Type |
---|---|
status | boolean |
message | string |
PluginListenerHandle
Prop | Type |
---|---|
remove | () => Promise<void> |
BarcodeParams
Prop | Type |
---|---|
barcode | string |
codeID | number |
Type Aliases
barcodeScanListener
(status: BarcodeParams): void
scanTimeoutListener
(status: ResultStatus): void
scanEventListener
(status: ResultStatus): void