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