fix: Add getFrameProcessorPlugin for backwards compatibility (#2040)

This commit is contained in:
Marc Rousavy 2023-10-19 11:35:02 +02:00 committed by GitHub
parent 3929c0ac46
commit da25aa1c1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -100,7 +100,19 @@ if (hasWorklets) {
}
}
export const VisionCameraProxy = proxy
export const VisionCameraProxy: TVisionCameraProxy = {
initFrameProcessorPlugin: proxy.initFrameProcessorPlugin,
removeFrameProcessor: proxy.removeFrameProcessor,
setFrameProcessor: proxy.setFrameProcessor,
// TODO: Remove this in the next version
// @ts-expect-error
getFrameProcessorPlugin: (name, options) => {
console.warn(
'"getFrameProcessorPlugin" has been renamed to "initFrameProcessorPlugin". This function will be removed in the next release.',
)
return proxy.initFrameProcessorPlugin(name, options)
},
}
declare global {
// eslint-disable-next-line no-var