Files
LayaNative2.0/Conch/source/domsupport/Bluetooth.ts
T
2020-11-11 16:17:13 +08:00

57 lines
976 B
TypeScript

/**
* https://webbluetoothcg.github.io/web-bluetooth/
*/
enum VendorIDSource {
"bluetooth",
"usb"
};
interface BluetoothDeviceEventHandlers{
}
interface CharacteristicEventHandlers{
}
interface ServiceEventHandlers{
}
interface RequestDeviceOptions{
}
interface BluetoothAdvertisingData{
}
interface BluetoothRemoteGATTServer{
}
class BluetoothDevice {
id:string;
name:string;
adData:BluetoothAdvertisingData;
deviceClass:number;
vendorIDSource:VendorIDSource;
vendorID:number;
productID:number;
productVersion:number;
paired:boolean;
gatt:BluetoothRemoteGATTServer;
uuids:string;
connectGATT():Promise<any>{
return null;
}
}
class Bluetooth extends EventTarget implements BluetoothDeviceEventHandlers, CharacteristicEventHandlers, ServiceEventHandlers {
requestDevice(options:RequestDeviceOptions):Promise<BluetoothDevice>{
return null;
}
}
//applyMixins(Bluetooth,[EventTarget]);