UNPKG

react-native-vision-camera

Version:

A powerful, high-performance React Native Camera library.

20 lines (17 loc) 650 B
import type * as Skia from '@shopify/react-native-skia' import { createModuleProxy, OptionalDependencyNotInstalledError } from './ModuleProxy' type TSkia = typeof Skia /** * A proxy object that lazy-imports @shopify/react-native-skia as soon as the * caller tries to access a property on {@linkcode SkiaProxy}. * * If @shopify/react-native-skia is not installed, accessing anything on * {@linkcode SkiaProxy} will throw. */ export const SkiaProxy = createModuleProxy<TSkia>(() => { try { return require('@shopify/react-native-skia') } catch (e) { throw new OptionalDependencyNotInstalledError('@shopify/react-native-skia') } })