From da25aa1c1fb67faa5d49ab7cb07622706c3e67b0 Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Thu, 19 Oct 2023 11:35:02 +0200 Subject: [PATCH] fix: Add `getFrameProcessorPlugin` for backwards compatibility (#2040) --- package/src/FrameProcessorPlugins.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/package/src/FrameProcessorPlugins.ts b/package/src/FrameProcessorPlugins.ts index d8edffd..8159fcf 100644 --- a/package/src/FrameProcessorPlugins.ts +++ b/package/src/FrameProcessorPlugins.ts @@ -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