docs: Add Kotlin & Swift FP plugins examples (#1902)

* chore(docs): add Kotlin FP example

* chore(docs): add Swift FP plugin
This commit is contained in:
Mateusz Mędrek
2023-10-03 11:33:48 +02:00
committed by GitHub
parent b24b1c808f
commit 62e786ad04
14 changed files with 220 additions and 19 deletions

View File

@@ -0,0 +1,17 @@
import { VisionCameraProxy, Frame } from 'react-native-vision-camera'
const plugin = VisionCameraProxy.getFrameProcessorPlugin('example_kotlin_swift_plugin')
export function exampleKotlinSwiftPlugin(frame: Frame): string[] {
'worklet'
if (plugin == null) throw new Error('Failed to load Frame Processor Plugin "example_kotlin_swift_plugin"!')
return plugin.call(frame, {
someString: 'hello!',
someBoolean: true,
someNumber: 42,
someObject: { test: 0, second: 'test' },
someArray: ['another test', 5],
}) as string[]
}