🚨 Shai-Hulud Strikes Again:More than 500 packages and 700+ versions compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@kduma-autoid/capacitor-sunmi-scanhead

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kduma-autoid/capacitor-sunmi-scanhead

Sunmi Scan Head bindings for Capacitor

Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

@kduma-autoid/capacitor-sunmi-scanhead

Sunmi Scan Head bindings for Capacitor

Install

npm install @kduma-autoid/capacitor-sunmi-scanhead
npx cap sync

Configuration

You can disable auto binding of the service by setting bindOnLoad to false in the plugin configuration in capacitor.config.ts.

/// <reference types="@kduma-autoid/capacitor-sunmi-scanhead" />
import { CapacitorConfig } from '@capacitor/cli';

const config: CapacitorConfig = {
  appId: "com.company.app",
  ...
  plugins: {
    SunmiScanHead: {
      bindOnLoad: true
    }
  }
}
export default config;

API

bindService()

bindService() => Promise<void>

bind scan service

unBindService()

unBindService() => Promise<void>

unbind scan service

scan()

scan() => Promise<void>

Start scanner

stop()

stop() => Promise<void>

Stop scanner

getScannerModel()

getScannerModel() => Promise<{ model: number; }>

Get scanner model ID

Returns: Promise<{ model: number; }>

clearConfig()

clearConfig() => Promise<void>

Clear scanner configuration (reset to default)

setTrigger(...)

setTrigger(options: { enabled: boolean; }) => Promise<void>

Enable or disable trigger button

ParamType
options{ enabled: boolean; }

setOutputMode(...)

setOutputMode(options: { mode: OutputMode.DISABLED; } | { mode: OutputMode.KEYSTROKE; interval?: number; tab?: boolean; enter?: boolean; } | { mode: OutputMode.DIRECTFILL; overwrite?: boolean; tab?: boolean; enter?: boolean; asEvent?: boolean; }) => Promise<void>

Set output mode

ParamType
options{ mode: OutputMode.DISABLED; } | { mode: OutputMode.KEYSTROKE; interval?: number; tab?: boolean; enter?: boolean; } | { mode: OutputMode.DIRECTFILL; overwrite?: boolean; tab?: boolean; enter?: boolean; asEvent?: boolean; }

setScanMode(...)

setScanMode(options: { mode: ScanMode.TRIGGER | ScanMode.PULSE; timeout?: number; } | { mode: ScanMode.CONTINUOUS | ScanMode.LONGPRESS; sleep?: number; timeout?: number; }) => Promise<void>

Set scan mode

ParamType
options{ mode: ScanMode.TRIGGER | ScanMode.PULSE; timeout?: number; } | { mode: ScanMode.CONTINUOUS | ScanMode.LONGPRESS; sleep?: number; timeout?: number; }

setReturnCodeType(...)

setReturnCodeType(options: { enabled: boolean; }) => Promise<void>

Enable or disable returning of code type with scan result

ParamType
options{ enabled: boolean; }

setBroadcast(...)

setBroadcast(options: { enabled: boolean; }) => Promise<void>

Enable or disable scan result broadcast

ParamType
options{ enabled: boolean; }

setBroadcastConfiguration(...)

setBroadcastConfiguration(options?: { scanned_intent?: string | null | undefined; start_intent?: string | null | undefined; end_intent?: string | null | undefined; intent_data_key?: string | null | undefined; intent_byte_key?: string | null | undefined; } | undefined) => Promise<void>

Set broadcast configuration

ParamType
options{ scanned_intent?: string | null; start_intent?: string | null; end_intent?: string | null; intent_data_key?: string | null; intent_byte_key?: string | null; }

addListener('onScanResult', ...)

addListener(eventName: 'onScanResult', listenerFunc: (scan: { data: string; source_bytes: string; }) => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Listens for barcode scanner result events.

ParamType
eventName'onScanResult'
listenerFunc(scan: { data: string; source_bytes: string; }) => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

addListener('onScanStart', ...)

addListener(eventName: 'onScanStart', listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Listens for barcode scanner start events.

ParamType
eventName'onScanStart'
listenerFunc() => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

addListener('onScanStop', ...)

addListener(eventName: 'onScanStop', listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle

Listens for barcode scanner stop events.

ParamType
eventName'onScanStop'
listenerFunc() => void

Returns: Promise<PluginListenerHandle> & PluginListenerHandle

removeAllListeners()

removeAllListeners() => Promise<void>

Removes all listeners

Interfaces

PluginListenerHandle

PropType
remove() => Promise<void>

Enums

OutputMode

MembersValue
KEYSTROKE"keystroke"
DIRECTFILL"directFill"
DISABLED"disabled"

ScanMode

MembersValue
TRIGGER"trigger"
CONTINUOUS"continuous"
PULSE"pulse"
LONGPRESS"longPress"

Keywords

capacitor

FAQs

Package last updated on 04 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts