import { IBleAdapter, JobStartOptions, LPA_AdapterInitOptions, LPA_AuthorizeOptions, LPA_BleDeviceConnectOptions, LPA_BleDiscoveryOptions, LPA_ConnectionStateChangeResult, LPA_Device, LPA_DeviceRequestOptions, LPA_GattCharacteristic, LPA_GattService, LPA_GetCharacteristicsOptions, LPA_GetServicesOptions, LPA_NotifyCharacteristicOptions, LPA_ReadCharacteristicOptions, LPA_ReadResult, LPA_RequestOptions, LPA_Response, LPA_SetMtuOptions, LPA_SetMtuResult, LPA_WriteCharacteristicOptions } from "lpapi-ble"; import { IUniInitOptions } from "./UniContext"; type CharacteristicValueChangeListener = (result: UniNamespace.OnBLECharacteristicValueChangeSuccess) => void; type BluetoothAdapterStateChangeListener = (result: UniNamespace.OnBluetoothAdapterStateChangeResult) => void; export interface IBleAdapter2 { onBLECharacteristicValueChange?: (callback: CharacteristicValueChangeListener) => void; onBluetoothAdapterStateChange?: (callback: BluetoothAdapterStateChangeListener) => void; } export interface IUniAdapterInitOptions extends IUniInitOptions { bleAdapter?: IBleAdapter2; } export interface Uni_JobStartOptions extends JobStartOptions { canvasId: string; } export interface Uni_Base64SaveResult { target: string; width: number; height: number; size: number; } export interface IConnectionInfo { deviceId: string; connected: boolean; connectStateChange?: (res: LPA_ConnectionStateChangeResult) => void; } export declare class BleAdapter implements IBleAdapter { private static _instance?; private mConnectionMap; private mContext; private mDeviceInfo?; private mSystemInfo?; private mIsAdapterOpened?; private mShowWriteLog?; private mCharacteristicValueChangeMap?; private mCharacteristicMap; /** * 打印机链接状态变化回调函数。 */ private mConnectionStateChangeAction?; private mDeviceGetTimer?; /** * 蓝牙适配器状态变化通知回调函数。 */ private mAdapterStateChange?; private mAdapterStateChangeAction?; static getInstance(): BleAdapter; constructor(options?: IUniAdapterInitOptions); get isH5(): boolean | undefined; get Context(): IUniAdapterInitOptions; get platform(): string; protected isAndroid(): boolean; protected isHarmonyOS(): boolean; getDeviceInfo(): UniApp.GetDeviceInfoResult | undefined; protected androidAPILevel(): number; protected requestPermissions(): Promise; /** * 蓝牙授权认证。 */ authorize(options?: LPA_AuthorizeOptions): Promise>; createAdapterStateChangeAction(): void; openAdapter(options?: LPA_AdapterInitOptions): Promise>; private resetAllEventListener; closeAdapter(options?: LPA_RequestOptions): Promise>; resetAdapter(options?: LPA_RequestOptions): Promise>; startDiscovery(options?: LPA_BleDiscoveryOptions): Promise>; stopDiscovery(options?: LPA_RequestOptions): Promise>; getFoundDevices(options?: LPA_RequestOptions): Promise>; createConnectionStateChangeAction(): void; connect(options: LPA_BleDeviceConnectOptions): Promise>; private resetCharacteristicValueChange; disconnect(options: LPA_DeviceRequestOptions): Promise>; getConnectedDevices(options?: LPA_RequestOptions): Promise>; setBleMtu(options: LPA_SetMtuOptions): Promise; getGATTServices(options: LPA_GetServicesOptions): Promise; getGATTCharacteristics(options: LPA_GetCharacteristicsOptions): Promise; onBLECharacteristicValueChange(characterId: string, callback: CharacteristicValueChangeListener): void; offBLECharacteristicValueChange(cid: string): void; read(options: LPA_ReadCharacteristicOptions): Promise; notify(options: LPA_NotifyCharacteristicOptions): Promise>; write(options: LPA_WriteCharacteristicOptions): Promise>; } export {};