lens-ai
v0.0.17
Published
plugin to use the camera and get binary
Readme
lens-ai
plugin to use the camera and get binary
Install
npm install lens-ai
npx cap syncAPI
openCamera(...)takePhoto()pickImage()toggleFlash(...)startScan()stopScan()addListener('scanResult', ...)- Interfaces
openCamera(...)
openCamera(options: { mode: 'photo' | 'scan'; flash?: boolean; }) => Promise<void>| Param | Type |
| ------------- | ---------------------------------------------------------- |
| options | { mode: 'photo' | 'scan'; flash?: boolean; } |
takePhoto()
takePhoto() => Promise<{ base64: string; mimeType: 'image/jpeg'; }>Returns: Promise<{ base64: string; mimeType: 'image/jpeg'; }>
pickImage()
pickImage() => Promise<{ base64: string; mimeType: 'image/jpeg'; }>Returns: Promise<{ base64: string; mimeType: 'image/jpeg'; }>
toggleFlash(...)
toggleFlash(options: { enabled: boolean; }) => Promise<void>| Param | Type |
| ------------- | ---------------------------------- |
| options | { enabled: boolean; } |
startScan()
startScan() => Promise<void>stopScan()
stopScan() => Promise<void>addListener('scanResult', ...)
addListener(eventName: 'scanResult', listenerFunc: (result: { value: string; type: string; }) => void) => Promise<PluginListenerHandle>| Param | Type |
| ------------------ | ------------------------------------------------------------------ |
| eventName | 'scanResult' |
| listenerFunc | (result: { value: string; type: string; }) => void |
Returns: Promise<PluginListenerHandle>
Interfaces
PluginListenerHandle
| Prop | Type |
| ------------ | ----------------------------------------- |
| remove | () => Promise<void> |
