Skip to content

@camera.ui/sdk / plugin / hasInterface

Function: hasInterface() ​

hasInterface(contract, iface): boolean

Defined in: plugin/helper.ts:260

Reports whether the plugin implements the given capability.

Parameters ​

contract ​

PluginContract

Plugin contract to inspect.

iface ​

PluginInterface

Interface to check (e.g. PluginInterface.DiscoveryProvider).

Returns ​

boolean

true if iface is listed in the contract's interfaces.

Example ​

ts
import { hasInterface, PluginInterface } from '@camera.ui/sdk';

if (hasInterface(contract, PluginInterface.DiscoveryProvider)) startScan();