本文へ移動
rdlabo.devdocs

API

method present(...)

present(scannerOption: ScannerOption) => Promise<void>
Param Type
scannerOption ScannerOption

method addListener('CodeScannerCatchEvent', ...)

addListener(eventName: 'CodeScannerCatchEvent', listenerFunc: (event: { code: string; }) => void) => Promise<PluginListenerHandle>
Param Type
eventName 'CodeScannerCatchEvent'
listenerFunc (event: { code: string; }) => void

Returns: Promise<PluginListenerHandle>


Interfaces

interface ScannerOption

Prop Type Description
detectionWidth number Width of the detection area relative to the available width (0–1). Default is 0.4.
detectionHeight number Height of the detection area relative to the detection width. Default is 1 on iOS; 0.15–0.2 is typical on Android.
enableCloseButton boolean Enable close button on the top left of the scanning area (default: true)
sheetScreenRatio number Specify the ratio of the scanning area (sheet modal size) to the screen size. Default is 0.9 for android, 1(pageSheet) for iOS.
CodeTypes MetadataObjectTypes[] Specify the types of codes to recognize (default: ["qr", "code39", "ean13"])
isMulti boolean Enable multi scan mode (default: false)
enableAutoLight boolean Enable auto light when environment is dark (default: true)

interface PluginListenerHandle

Prop Type
remove () => Promise<void>

Type Aliases

type alias MetadataObjectTypes

'aztec' | 'code128' | 'code39' | 'code39Mod43' | 'code93' | 'dataMatrix' | 'ean13' | 'ean8' | 'face' | 'interleaved2of5' | 'itf14' | 'pdf417' | 'qr' | 'upce' | 'catBody' | 'dogBody' | 'humanBody' | 'salientObject'