Skip to main content

BluetoothRuntime

No behavioral description is attached to this declaration. The public signature, parameter and return types, and source location below document its published contract.

Kind: Interface
Package: @ovok/native

Import​

import { BluetoothRuntime } from '@ovok/native/bt-management';

TypeScript shape​

interface BluetoothRuntime {
bleManager?: BleManager;
manager?: BluetoothRuntimeManager;
subscribeState: (callback: () => void) => () => void;
getSnapshot: () => BluetoothRuntimeSnapshot;
devices: readonly RuntimeDevice[];
getBackgroundScanEnabled: () => boolean;
initializeBackgroundScanEnabled: (enabled: boolean) => void;
setBackgroundScanEnabled: (enabled: boolean) => void;
setBluetoothState: (state: RuntimeBluetoothState) => void;
setBluetoothPermissionStatus: (status: BluetoothPermissionStatus) => void;
subscribe: <K extends RuntimeEvent>(event: K, callback: (value: RuntimeEventMap[K]) => void) => () => void;
hasListeners: (event: RuntimeEvent) => boolean;
emit: <K extends RuntimeEvent>(event: K, value: RuntimeEventMap[K]) => void;
setManager: (manager?: BluetoothRuntimeManager) => void;
setAutoConnect: (enabled: boolean, delayMs?: number, onDeviceSelectionRequired?: Parameters<BTManager<readonly never[]>["setAutoConnect"]>[2]) => void;
getPairedDeviceIds: (storageKey: string) => readonly string[] | undefined;
loadPairedDeviceIds: (storageKey: string, load: () => Promise<readonly string[]>) => Promise<readonly string[]>;
setPairedDeviceIds: (storageKey: string, ids: readonly string[]) => void;
upsertDevice: (device: RuntimeDevice["device"]) => void;
removeDevice: (deviceId: string) => void;
setDeviceResult: (result: RuntimeResult) => void;
getResultConnectionId: (result: RuntimeResult) => number;
clearResults: () => void;
setDeviceConnectionEvent: (event: RuntimeConnectionEvent) => void;
setDeviceStatus: (value: {
deviceData: DeviceData;
status: DeviceStatus;
}) => void;
}

This is a type-level export; it has no call parameters.

Public members​

MemberTypeDetails
bleManagerBleManagerOptional. —
managerBluetoothRuntimeManagerOptional. —
subscribeState(callback: () => void): () => void—
getSnapshot(): BluetoothRuntimeSnapshot—
devicesreadonly RuntimeDevice[]—
getBackgroundScanEnabled(): boolean—
initializeBackgroundScanEnabled(enabled: boolean): void—
setBackgroundScanEnabled(enabled: boolean): void—
setBluetoothState(state: RuntimeBluetoothState): void—
setBluetoothPermissionStatus(status: BluetoothPermissionStatus): void—
subscribe<K extends RuntimeEvent>(event: K, callback: (value: RuntimeEventMap[K]) => void): () => void—
hasListeners(event: RuntimeEvent): boolean—
emit<K extends RuntimeEvent>(event: K, value: RuntimeEventMap[K]): void—
setManager(manager?: BluetoothRuntimeManager): void—
setAutoConnect(enabled: boolean, delayMs?: number, onDeviceSelectionRequired?: Parameters<BTManager<readonly never[]>["setAutoConnect"]>[2]): void—
getPairedDeviceIds(storageKey: string): readonly string[] | undefined—
loadPairedDeviceIds(storageKey: string, load: () => Promise<readonly string[]>): Promise<readonly string[]>—
setPairedDeviceIds(storageKey: string, ids: readonly string[]): void—
upsertDevice(device: RuntimeDevice["device"]): void—
removeDevice(deviceId: string): void—
setDeviceResult(result: RuntimeResult): void—
getResultConnectionId(result: RuntimeResult): number—
clearResults(): void—
setDeviceConnectionEvent(event: RuntimeConnectionEvent): void—
setDeviceStatus(value: { deviceData: DeviceData; status: DeviceStatus; }): void—

Learn the workflow​

Continue with Bluetooth for the workflow context and examples.

Source​

View the declaration in the SDK source.