import type { BleDeviceInfo, PluginBlecApi } from './plugin-blec.js'; export interface DiscoveredDevice { address: string; name: string; rssi: number; isConnected: boolean; services: string[]; } /** * Official DG-Lab Android fallback for devices whose AD 0x09 local name is * absent: accept AD 0xFF manufacturer payloads whose complete value is 8-16 * bytes. Android exposes the two-byte company identifier as the map key, so * each value here is valid when it contributes another 6-14 bytes. */ export declare function hasOfficialDgLabManufacturerFallback(device: BleDeviceInfo): boolean; /** * Live controller passed to `selectDevice`. The picker UI subscribes for * incremental device updates while the scan is still in progress. */ export interface DeviceSelectionController { /** Snapshot of devices already discovered when the picker opens. */ initial: DiscoveredDevice[]; /** * Receive each subsequent batch of discovered devices. Returns an * unsubscribe function the picker should call before resolving. */ subscribe(handler: (devices: DiscoveredDevice[]) => void): () => void; /** Whether the timed BLE scan is still running. */ readonly scanning: boolean; /** Receive scan-state changes, including the transition to completed. */ subscribeScanning(handler: (scanning: boolean) => void): () => void; } export interface ScanAndSelectOptions { /** * Called immediately after scan starts. The host UI opens the device * picker and subscribes to live updates via the controller. Resolves with * the chosen device address, or `null` if the user cancels. */ selectDevice: (controller: DeviceSelectionController) => Promise; /** * Optional client-side filter applied to scan results before they reach * `selectDevice`. Default: no filter (caller must filter or the picker * shows all discovered devices). */ namePrefixes?: string[]; /** Scan window in milliseconds. Defaults to 8000. */ scanDurationMs?: number; } export interface PrewarmScanOptions { namePrefixes?: string[]; scanDurationMs?: number; } /** * Quietly collect named DG-Lab advertisements while the Android shell starts. * Permission is checked without prompting; the normal connect action remains * responsible for explaining and requesting missing platform permission. */ export declare function prewarmDeviceScan(api: PluginBlecApi, options?: PrewarmScanOptions): Promise; export declare function __resetPrewarmScanForTests(): void; /** * Shared scan → live device picker flow, used by `TauriBlecDeviceClient` * (Coyote) and `connectTauriAuxDevice` (Opossum/sensor clients) alike, so * the scanning/picker-wiring logic isn't duplicated per device kind. * * Returns the picked device's address/name, or `null` if the user cancelled * (`selectDevice` resolved with `null`). */ export declare function scanAndSelectDevice(api: PluginBlecApi, options: ScanAndSelectOptions): Promise<{ address: string; name: string; services: string[]; } | null>; export declare function hasSupportedDgLabGatt(services: readonly string[]): boolean; //# sourceMappingURL=scan.d.ts.map