Skip to content

@camera.ui/sdk / plugin / hasCapability

Function: hasCapability() ​

hasCapability(contract, cap): boolean

Defined in: plugin/helper.ts:280

Reports whether the plugin requested the given capability.

Parameters ​

contract ​

PluginContract

Plugin contract to inspect.

cap ​

PublishNotifications

Capability to check (e.g. PluginCapability.PublishNotifications).

Returns ​

boolean

true if cap is listed in the contract's capabilities.

Example ​

ts
import { hasCapability, PluginCapability } from '@camera.ui/sdk';

if (hasCapability(contract, PluginCapability.PublishNotifications)) allowPublish();