import type { SFPToolboxError } from '../error/error'; import type Mutex from '../mutex/Mutex'; import React from 'react'; import type { BleManager } from 'react-native-ble-plx'; export interface TimeOuts { probeBatteryTimeOutInMs: number; batteryIntervalInMs: number; firmwareTimeOutInMs: number; reconnectInMs: number; } export interface BluetoothContextType { startScan: Function; stopScan: Function; autoConnect: Function; setTargetDevice: (targetDevice: { name: string; id: string }) => void; connect: Function; reconnect: Function; unlink: Function; setBatteryPercentage: Function; getConnectedDeviceSerialNumber: Function; setFirmware: Function; isConnected: Function; scannedDevices: Array; connectionError: SFPToolboxError | null; scanError: SFPToolboxError | null; status: String; bluetoothState: string; connectedDevice: any; mutex: Mutex; batteryPercentage: number | null; version: string; batteryLoading: boolean; UNKNOWN_FIRMWARE_VERSION: string; mockProbe: boolean; timeOuts: TimeOuts; targetDevice: { name: string; id: string } | null; manager: BleManager; error2Message(error: SFPToolboxError): string; isBluetoothUnavailable: Function; } export const BluetoothContext = React.createContext({} as BluetoothContextType);