Skip to content

@camera.ui/sdk / plugin / canCreateCameras

Function: canCreateCameras()

canCreateCameras(contract): boolean

Defined in: plugin/helper.ts:248

Reports whether the plugin can create cameras (role is CameraController or CameraAndSensorProvider). Used to gate camera-creating operations such as DiscoveryProvider adoption.

Parameters

contract

PluginContract

Plugin contract to inspect.

Returns

boolean

true if the plugin may create cameras.

Example

ts
import { canCreateCameras } from '@camera.ui/sdk';

if (canCreateCameras(contract)) enableAdoption();