chore: Type examplePlugin
This commit is contained in:
parent
b92960a837
commit
68776f683b
@ -2,7 +2,14 @@ import { VisionCameraProxy, Frame } from 'react-native-vision-camera'
|
||||
|
||||
const plugin = VisionCameraProxy.getFrameProcessorPlugin('example_plugin')
|
||||
|
||||
export function examplePlugin(frame: Frame): string[] {
|
||||
interface Result {
|
||||
example_array: (string | number | boolean)[]
|
||||
example_str: string
|
||||
example_bool: boolean
|
||||
example_double: number
|
||||
}
|
||||
|
||||
export function examplePlugin(frame: Frame): Result {
|
||||
'worklet'
|
||||
|
||||
if (plugin == null) throw new Error('Failed to load Frame Processor Plugin "example_plugin"!')
|
||||
@ -13,5 +20,5 @@ export function examplePlugin(frame: Frame): string[] {
|
||||
someNumber: 42,
|
||||
someObject: { test: 0, second: 'test' },
|
||||
someArray: ['another test', 5],
|
||||
}) as string[]
|
||||
}) as unknown as Result
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user