import { BleEvent, Subscription, BleOpenRequest, BleOpenResult, BleAttribute, BleService, BleWriteOptions } from '@napplet/core'; /** * Napplet NAP ble shim entrypoint. * * @module */ /** * Handle ble.* result and event messages from the shell via the central listener. * * @param msg The shell envelope to route */ declare function handleBleMessage(msg: { type: string; [key: string]: unknown; }): void; /** * Open a runtime-owned BLE session. * * @param openRequest Device selection and optional service request * @returns Promise resolving to the opened session result */ declare function open(openRequest: BleOpenRequest): Promise; /** * List exposed GATT services for a session. * * @param sessionId BLE session id * @returns Promise resolving to exposed services */ declare function services(sessionId: string): Promise; /** * Read a characteristic or descriptor value. * * @param sessionId BLE session id * @param target GATT attribute target * @returns Promise resolving to bytes */ declare function read(sessionId: string, target: BleAttribute): Promise; /** * Write bytes to a characteristic or descriptor. * * @param sessionId BLE session id * @param target GATT attribute target * @param data Byte array * @param options Write mode preference * @returns Promise resolving when the write completes */ declare function write(sessionId: string, target: BleAttribute, data: number[], options?: BleWriteOptions): Promise; /** * Start notifications or indications for a characteristic. * * @param sessionId BLE session id * @param target Characteristic target * @returns Promise resolving when subscription starts */ declare function subscribe(sessionId: string, target: BleAttribute): Promise; /** * Stop notifications or indications for a characteristic. * * @param sessionId BLE session id * @param target Characteristic target * @returns Promise resolving when subscription stops */ declare function unsubscribe(sessionId: string, target: BleAttribute): Promise; /** * Close a BLE session. * * @param sessionId BLE session id * @param reason Optional close reason * @returns Promise resolving when the session is closed */ declare function close(sessionId: string, reason?: string): Promise; /** * Subscribe to runtime-pushed BLE events. * * @param handler Event handler * @returns Subscription handle */ declare function onEvent(handler: (event: BleEvent) => void): Subscription; /** * Install the BLE shim. Registration-only -- sessions are opened on demand. * * @returns cleanup function that clears pending requests and event handlers */ declare function installBleShim(): () => void; export { close, handleBleMessage, installBleShim, onEvent, open, read, services, subscribe, unsubscribe, write };