export interface BluetoothRequestDeviceOptions { /** * An array of filter objects indicating the properties of devices that will be matched. * * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/requestDevice#filters | requestDevice#filters - MDN} */ filters?: BluetoothLEScanFilter[] | undefined; /** * A list of services that the application wishes to access on the remote device. * * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTService/uuid | BluetoothRemoteGATTService/uuid - MDN} */ optionalServices?: BluetoothServiceUUID[] | undefined; } export interface UseBluetoothOptions extends BluetoothRequestDeviceOptions { /** * Whether to accept all devices * * @defaultValue false * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/requestDevice#acceptAllDevices | requestDevice#acceptAllDevices - MDN} */ acceptAllDevices?: boolean; /** * Whether to connect immediately * * @defaultValue true */ immediate?: boolean; } export interface UseBlueToothReturns { /** * Whether the device is connected */ isConnected: boolean; /** * Whether the device is connecting */ isConnecting: boolean; /** * The error that occurred while connecting */ error: unknown | null; /** * The GATT server */ server: BluetoothRemoteGATTServer | undefined; /** * The device */ device: BluetoothDevice | undefined; /** * Connect to the Bluetooth GATT server * * @returns {Promise} The GATT server, see {@link BluetoothRemoteGATTServer} * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer | BluetoothRemoteGATTServer - MDN} */ connect(): Promise; /** * Disconnect from the Bluetooth GATT server * * @returns {void} `void` * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/BluetoothRemoteGATTServer/disconnect | BluetoothRemoteGATTServer.disconnect - MDN} */ disconnect(): void; /** * Whether the browser supports the Web Bluetooth API */ isSupported: boolean; /** * Request a Bluetooth device * * @returns {Promise} The Bluetooth device, see {@link BluetoothDevice} * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Bluetooth/requestDevice | Bluetooth.requestDevice - MDN} */ requestDevice(): Promise; } /** * A React Hook that provides a simple API to interact with the Web [Bluetooth API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Bluetooth_API). * * @param {UseBluetoothOptions} [options={}] - `UseBluetoothOptions`, options to configure the hook, see {@link UseBluetoothOptions} * @returns {UseBlueToothReturns} `UseBlueToothReturns`, see {@link UseBlueToothReturns} */ export declare function useBluetooth(options?: UseBluetoothOptions): UseBlueToothReturns;