@hyext/types-ext-sdk-hy 4.2.5-beta.7 → 4.2.5-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.d.ts +562 -0
  2. package/package.json +1 -1
package/index.d.ts CHANGED
@@ -4426,6 +4426,108 @@ namespace device {
4426
4426
  * 获取系统信息
4427
4427
  */
4428
4428
  function getSystemInfo(): Promise<SystemInfo>;
4429
+ /**
4430
+ * 断开与蓝牙低功耗设备的连接
4431
+ * @param params - 输入参数
4432
+ */
4433
+ function closeBLEConnection(params: CloseBLEConnectionReq): Promise<CloseBLEConnectionRsp>;
4434
+ /**
4435
+ * 关闭蓝牙模块
4436
+ */
4437
+ function closeBluetoothAdapter(): Promise<CloseBluetoothAdapterRsp>;
4438
+ /**
4439
+ * 连接蓝牙低功耗设备
4440
+ * @param params - 输入参数
4441
+ */
4442
+ function createBLEConnection(params: CreateBLEConnectionReq): Promise<CreateBLEConnectionRsp>;
4443
+ /**
4444
+ * 获取蓝牙低功耗设备某个服务中所有特征 (characteristic)
4445
+ * @param params - 输入参数
4446
+ */
4447
+ function getBLEDeviceCharacteristics(params: GetBLEDeviceCharacteristicsReq): Promise<GetBLEDeviceCharacteristicsRsp>;
4448
+ /**
4449
+ * 获取蓝牙低功耗设备所有服务 (service)
4450
+ * @param params - 输入参数
4451
+ */
4452
+ function getBLEDeviceServices(params: GetBLEDeviceServicesReq): Promise<GetBLEDeviceServicesRsp>;
4453
+ /**
4454
+ * 获取设备设置
4455
+ */
4456
+ function getSystemSetting(): Promise<GetSystemSettingRsp>;
4457
+ /**
4458
+ * 请求获取 Wi-Fi 列表。wifiList 数据会在 onGetWifiList 注册的回调中返回
4459
+ */
4460
+ function getWifiList(): Promise<GetWifiListRsp>;
4461
+ /**
4462
+ * 启用蓝牙低功耗设备特征值变化时的 notify 功能,订阅特征
4463
+ * @param params - 输入参数
4464
+ */
4465
+ function notifyBLECharacteristicValueChange(params: NotifyBLECharacteristicValueChangeReq): Promise<NotifyBLECharacteristicValueChangeRsp>;
4466
+ /**
4467
+ * 监听蓝牙适配器状态变化事件
4468
+ * @param params - 输入参数
4469
+ */
4470
+ function onBluetoothAdapterStateChange(params: OnBluetoothAdapterStateChangeReq): Promise<void>;
4471
+ /**
4472
+ * 移除蓝牙适配器状态变化事件的全部监听函数
4473
+ */
4474
+ function offBluetoothAdapterStateChange(): Promise<void>;
4475
+ /**
4476
+ * 监听搜索到新设备的事件
4477
+ * @param params - 输入参数
4478
+ */
4479
+ function onBluetoothDeviceFound(params: OnBluetoothDeviceFoundReq): Promise<void>;
4480
+ /**
4481
+ * 监听获取到 Wi-Fi 列表数据事件
4482
+ * @param params - 输入参数
4483
+ */
4484
+ function onGetWifiList(params: OnGetWifiListReq): Promise<void>;
4485
+ /**
4486
+ * 初始化蓝牙模块
4487
+ * @param params - 输入参数
4488
+ */
4489
+ function openBluetoothAdapter(params: OpenBluetoothAdapterReq): Promise<OpenBluetoothAdapterRsp>;
4490
+ /**
4491
+ * 跳转系统蓝牙设置页
4492
+ */
4493
+ function openSystemBluetoothSetting(): Promise<OpenSystemBluetoothSettingRsp>;
4494
+ /**
4495
+ * 读取蓝牙低功耗设备特征值的二进制数据。注意:必须设备的特征支持 read 才可以成功调用
4496
+ * @param params - 输入参数
4497
+ */
4498
+ function readBLECharacteristicValue(params: ReadBLECharacteristicValueReq): Promise<ReadBLECharacteristicValueRsp>;
4499
+ /**
4500
+ * 开始搜寻附近的蓝牙外围设备
4501
+ * @param [params] - 输入参数
4502
+ */
4503
+ function startBluetoothDevicesDiscovery(params?: StartBluetoothDevicesDiscoveryReq): Promise<StartBluetoothDevicesDiscoveryRsp>;
4504
+ /**
4505
+ * 初始化 Wi-Fi 模块
4506
+ */
4507
+ function startWifi(): Promise<StartWifiRsp>;
4508
+ /**
4509
+ * 停止搜寻附近的蓝牙外围设备
4510
+ */
4511
+ function stopBluetoothDevicesDiscovery(): Promise<StopBluetoothDevicesDiscoveryRsp>;
4512
+ /**
4513
+ * 关闭 Wi-Fi 模块
4514
+ */
4515
+ function stopWifi(): Promise<StopWifiRsp>;
4516
+ /**
4517
+ * 向蓝牙低功耗设备特征值中写入二进制数据。注意:必须设备的特征支持 write 才可以成功调用
4518
+ * @param params - 输入参数
4519
+ */
4520
+ function writeBLECharacteristicValue(params: WriteBLECharacteristicValueReq): Promise<WriteBLECharacteristicValueRsp>;
4521
+ /**
4522
+ * 监听蓝牙低功耗设备的特征值变化事件
4523
+ * @param params - 输入参数
4524
+ */
4525
+ function onBLECharacteristicValueChange(params: OnBLECharacteristicValueChangeReq): Promise<void>;
4526
+ /**
4527
+ * 监听蓝牙低功耗连接状态改变事件
4528
+ * @param params - 输入参数
4529
+ */
4530
+ function onBLEConnectionStateChange(params: OnBLEConnectionStateChangeReq): Promise<void>;
4429
4531
  }
4430
4532
 
4431
4533
  /**
@@ -4815,6 +4917,466 @@ type SystemInfo = {
4815
4917
  host: HostInfo;
4816
4918
  };
4817
4919
 
4920
+ /**
4921
+ * 断开蓝牙低功耗设备连接参数
4922
+ * @property deviceId - 蓝牙设备 id
4923
+ */
4924
+ type CloseBLEConnectionReq = {
4925
+ deviceId: string;
4926
+ };
4927
+
4928
+ /**
4929
+ * 断开蓝牙低功耗设备连接结果
4930
+ * @property errMsg - 错误信息,如果调用成功返回 closeBLEConnection:ok
4931
+ * @property errCode - 错误码,成功时为 0
4932
+ */
4933
+ type CloseBLEConnectionRsp = {
4934
+ errMsg: string;
4935
+ errCode: number;
4936
+ };
4937
+
4938
+ /**
4939
+ * 关闭蓝牙模块结果
4940
+ * @property errMsg - 错误信息,如果调用成功返回 closeBluetoothAdapter:ok
4941
+ * @property errCode - 错误码,成功时为 0
4942
+ */
4943
+ type CloseBluetoothAdapterRsp = {
4944
+ errMsg: string;
4945
+ errCode: number;
4946
+ };
4947
+
4948
+ /**
4949
+ * 连接蓝牙低功耗设备参数
4950
+ * @property deviceId - 蓝牙设备 id
4951
+ * @property [timeout] - 超时时间,单位 ms,不传表示不会超时
4952
+ */
4953
+ type CreateBLEConnectionReq = {
4954
+ deviceId: string;
4955
+ timeout?: number;
4956
+ };
4957
+
4958
+ /**
4959
+ * 连接蓝牙低功耗设备结果
4960
+ * @property errMsg - 错误信息,如果调用成功返回 createBLEConnection:ok
4961
+ * @property errCode - 错误码,成功时为 0
4962
+ * @property errno - 错误码,成功时为 0
4963
+ */
4964
+ type CreateBLEConnectionRsp = {
4965
+ errMsg: string;
4966
+ errCode: number;
4967
+ errno: number;
4968
+ };
4969
+
4970
+ /**
4971
+ * 获取蓝牙低功耗设备特征参数
4972
+ * @property deviceId - 蓝牙设备 id
4973
+ * @property serviceId - 蓝牙服务 UUID,需要使用 getBLEDeviceServices 获取
4974
+ */
4975
+ type GetBLEDeviceCharacteristicsReq = {
4976
+ deviceId: string;
4977
+ serviceId: string;
4978
+ };
4979
+
4980
+ /**
4981
+ * 蓝牙设备特征支持的操作类型
4982
+ * @property read - 该特征是否支持 read 操作
4983
+ * @property write - 该特征是否支持 write 操作
4984
+ * @property notify - 该特征是否支持 notify 操作
4985
+ * @property indicate - 该特征是否支持 indicate 操作
4986
+ * @property writeNoResponse - 该特征是否支持无回应写操作
4987
+ * @property writeDefault - 该特征是否支持有回应写操作
4988
+ */
4989
+ type BLECharacteristicProperties = {
4990
+ read: boolean;
4991
+ write: boolean;
4992
+ notify: boolean;
4993
+ indicate: boolean;
4994
+ writeNoResponse: boolean;
4995
+ writeDefault: boolean;
4996
+ };
4997
+
4998
+ /**
4999
+ * 蓝牙设备特征
5000
+ * @property uuid - 蓝牙设备特征的 UUID
5001
+ * @property properties - 该特征支持的操作类型
5002
+ */
5003
+ type BLECharacteristic = {
5004
+ uuid: string;
5005
+ properties: BLECharacteristicProperties;
5006
+ };
5007
+
5008
+ /**
5009
+ * 获取蓝牙低功耗设备特征结果
5010
+ * @property errMsg - 错误信息,如果调用成功返回 getBLEDeviceCharacteristics:ok
5011
+ * @property errCode - 错误码,成功时为 0
5012
+ * @property characteristics - 设备特征列表
5013
+ */
5014
+ type GetBLEDeviceCharacteristicsRsp = {
5015
+ errMsg: string;
5016
+ errCode: number;
5017
+ characteristics: BLECharacteristic[];
5018
+ };
5019
+
5020
+ /**
5021
+ * 获取蓝牙低功耗设备服务参数
5022
+ * @property deviceId - 蓝牙设备 id
5023
+ */
5024
+ type GetBLEDeviceServicesReq = {
5025
+ deviceId: string;
5026
+ };
5027
+
5028
+ /**
5029
+ * 蓝牙设备服务
5030
+ * @property uuid - 蓝牙设备服务的 UUID
5031
+ * @property isPrimary - 该服务是否为主服务
5032
+ */
5033
+ type BLEService = {
5034
+ uuid: string;
5035
+ isPrimary: boolean;
5036
+ };
5037
+
5038
+ /**
5039
+ * 获取蓝牙低功耗设备服务结果
5040
+ * @property errMsg - 错误信息,如果调用成功返回 getBLEDeviceServices:ok
5041
+ * @property errCode - 错误码,成功时为 0
5042
+ * @property services - 设备服务列表
5043
+ */
5044
+ type GetBLEDeviceServicesRsp = {
5045
+ errMsg: string;
5046
+ errCode: number;
5047
+ services: BLEService[];
5048
+ };
5049
+
5050
+ /**
5051
+ * 获取设备设置结果
5052
+ * @property bluetoothEnabled - 蓝牙的系统开关
5053
+ * @property locationEnabled - 地理位置的系统开关
5054
+ * @property wifiEnabled - Wi-Fi 的系统开关
5055
+ * @property deviceOrientation - 设备方向,竖屏 portrait、横屏 landscape
5056
+ * @property errMsg - 错误信息,如果调用成功返回 getSystemSetting:ok
5057
+ * @property errCode - 错误码,成功时为 0
5058
+ */
5059
+ type GetSystemSettingRsp = {
5060
+ bluetoothEnabled: boolean;
5061
+ locationEnabled: boolean;
5062
+ wifiEnabled: boolean;
5063
+ deviceOrientation: string;
5064
+ errMsg: string;
5065
+ errCode: number;
5066
+ };
5067
+
5068
+ /**
5069
+ * 请求获取 Wi-Fi 列表结果
5070
+ * @property errMsg - 错误信息,如果调用成功返回 getWifiList:ok
5071
+ * @property errCode - 错误码,成功时为 0
5072
+ */
5073
+ type GetWifiListRsp = {
5074
+ errMsg: string;
5075
+ errCode: number;
5076
+ };
5077
+
5078
+ /**
5079
+ * 启用蓝牙低功耗设备特征值变化时的 notify 功能参数
5080
+ * @property deviceId - 蓝牙设备 id
5081
+ * @property serviceId - 蓝牙特征对应服务的 UUID
5082
+ * @property characteristicId - 蓝牙特征的 UUID
5083
+ * @property state - 是否启用 notify,true 为启用,false 为取消
5084
+ * @property [type] - 设置特征订阅类型,有效值有 `notification` 和 `indication`
5085
+ */
5086
+ type NotifyBLECharacteristicValueChangeReq = {
5087
+ deviceId: string;
5088
+ serviceId: string;
5089
+ characteristicId: string;
5090
+ state: boolean;
5091
+ type?: string;
5092
+ };
5093
+
5094
+ /**
5095
+ * 启用蓝牙低功耗设备特征值变化时的 notify 功能结果
5096
+ * @property errMsg - 错误信息,如果调用成功返回 notifyBLECharacteristicValueChange:ok
5097
+ * @property errCode - 错误码,成功时为 0
5098
+ */
5099
+ type NotifyBLECharacteristicValueChangeRsp = {
5100
+ errMsg: string;
5101
+ errCode: number;
5102
+ };
5103
+
5104
+ /**
5105
+ * @property available - 蓝牙适配器是否可用
5106
+ * @property discovering - 蓝牙适配器是否处于搜索状态
5107
+ */
5108
+ type OnBluetoothAdapterStateChangeNotice = {
5109
+ available: boolean;
5110
+ discovering: boolean;
5111
+ };
5112
+
5113
+ /**
5114
+ * @param res - 蓝牙适配器状态变化事件的回调参数
5115
+ */
5116
+ type OnBluetoothAdapterStateChangeCallback = (res: OnBluetoothAdapterStateChangeNotice) => void;
5117
+
5118
+ /**
5119
+ * @property callback - 蓝牙适配器状态变化事件的回调函数
5120
+ */
5121
+ type OnBluetoothAdapterStateChangeReq = {
5122
+ callback: OnBluetoothAdapterStateChangeCallback;
5123
+ };
5124
+
5125
+ /**
5126
+ * @property name - 蓝牙设备名称,某些设备可能没有
5127
+ * @property deviceId - 蓝牙设备 id
5128
+ * @property RSSI - 当前蓝牙设备的信号强度,单位 dBm
5129
+ * @property advertisData - 当前蓝牙设备的广播数据段中的 ManufacturerData 数据段
5130
+ * @property advertisServiceUUIDs - 当前蓝牙设备的广播数据段中的 ServiceUUIDs 数据段
5131
+ * @property localName - 当前蓝牙设备的广播数据段中的 LocalName 数据段
5132
+ * @property serviceData - 当前蓝牙设备的广播数据段中的 ServiceData 数据段
5133
+ * @property connectable - 当前蓝牙设备是否可连接(仅 iOS 支持)
5134
+ */
5135
+ type BluetoothDeviceInfo = {
5136
+ name: string;
5137
+ deviceId: string;
5138
+ RSSI: number;
5139
+ advertisData: ArrayBuffer;
5140
+ advertisServiceUUIDs: string[];
5141
+ localName: string;
5142
+ serviceData: any;
5143
+ connectable: boolean;
5144
+ };
5145
+
5146
+ /**
5147
+ * @property devices - 新搜索到的设备列表
5148
+ */
5149
+ type OnBluetoothDeviceFoundNotice = {
5150
+ devices: BluetoothDeviceInfo[];
5151
+ };
5152
+
5153
+ /**
5154
+ * @param res - 搜索到新设备事件的回调参数
5155
+ */
5156
+ type OnBluetoothDeviceFoundCallback = (res: OnBluetoothDeviceFoundNotice) => void;
5157
+
5158
+ /**
5159
+ * @property callback - 搜索到新设备事件的回调函数
5160
+ */
5161
+ type OnBluetoothDeviceFoundReq = {
5162
+ callback: OnBluetoothDeviceFoundCallback;
5163
+ };
5164
+
5165
+ /**
5166
+ * @property SSID - Wi-Fi 的 SSID
5167
+ * @property BSSID - Wi-Fi 的 BSSID
5168
+ * @property secure - Wi-Fi 是否安全
5169
+ * @property signalStrength - Wi-Fi 信号强度,安卓取值 0 ~ 100 ,iOS 取值 0 ~ 1
5170
+ * @property frequency - Wi-Fi 频段单位 MHz
5171
+ */
5172
+ type WifiInfo = {
5173
+ SSID: string;
5174
+ BSSID: string;
5175
+ secure: boolean;
5176
+ signalStrength: number;
5177
+ frequency: number;
5178
+ };
5179
+
5180
+ /**
5181
+ * @property wifiList - Wi-Fi 列表数据
5182
+ */
5183
+ type OnGetWifiListNotice = {
5184
+ wifiList: WifiInfo[];
5185
+ };
5186
+
5187
+ /**
5188
+ * @param notice - 监听获取到 Wi-Fi 列表数据事件的回调参数
5189
+ */
5190
+ type OnGetWifiListCallback = (notice: OnGetWifiListNotice) => void;
5191
+
5192
+ /**
5193
+ * @property callback - 监听获取到 Wi-Fi 列表数据事件的回调函数
5194
+ */
5195
+ type OnGetWifiListReq = {
5196
+ callback: OnGetWifiListCallback;
5197
+ };
5198
+
5199
+ /**
5200
+ * @property mode - 蓝牙模式,可作为主/从设备,仅 iOS 需要
5201
+ */
5202
+ type OpenBluetoothAdapterReq = {
5203
+ mode: string;
5204
+ };
5205
+
5206
+ /**
5207
+ * @property errMsg - 错误信息,如果调用成功返回 ${apiName}:ok
5208
+ * @property errCode - 错误码,成功时为 0,失败时参考错误码说明
5209
+ * @property state - 失败时返回的参数,仅iOS支持,参考state说明
5210
+ * @property errno - 错误码,成功时为 0,失败时参考错误码说明
5211
+ */
5212
+ type OpenBluetoothAdapterRsp = {
5213
+ errMsg: string;
5214
+ errCode: number;
5215
+ state: number;
5216
+ errno: number;
5217
+ };
5218
+
5219
+ /**
5220
+ * @property errMsg - 错误信息,如果调用成功返回 ${apiName}:ok
5221
+ * @property errCode - 错误码,成功时为 0,失败时参考错误码说明
5222
+ */
5223
+ type OpenSystemBluetoothSettingRsp = {
5224
+ errMsg: string;
5225
+ errCode: number;
5226
+ };
5227
+
5228
+ /**
5229
+ * 读取蓝牙低功耗设备特征值参数
5230
+ * @property deviceId - 蓝牙设备 id
5231
+ * @property serviceId - 蓝牙特征对应服务的 UUID
5232
+ * @property characteristicId - 蓝牙特征的 UUID
5233
+ */
5234
+ type ReadBLECharacteristicValueReq = {
5235
+ deviceId: string;
5236
+ serviceId: string;
5237
+ characteristicId: string;
5238
+ };
5239
+
5240
+ /**
5241
+ * 读取蓝牙低功耗设备特征值结果
5242
+ * @property errMsg - 错误信息,如果调用成功返回 readBLECharacteristicValue:ok
5243
+ * @property errCode - 错误码,成功时为 0
5244
+ */
5245
+ type ReadBLECharacteristicValueRsp = {
5246
+ errMsg: string;
5247
+ errCode: number;
5248
+ };
5249
+
5250
+ /**
5251
+ * 开始搜寻附近的蓝牙外围设备参数
5252
+ * @property [services] - 要搜索的蓝牙设备主服务的 UUID 列表(iOS 平台必填)
5253
+ * @property [allowDuplicatesKey] - 是否允许重复上报同一设备
5254
+ * @property [interval] - 上报设备的间隔,单位 ms。0 表示找到新设备立即上报
5255
+ * @property [powerLevel] - 扫描模式,可选值:"low"、"balanced"、"high"
5256
+ */
5257
+ type StartBluetoothDevicesDiscoveryReq = {
5258
+ services?: string[];
5259
+ allowDuplicatesKey?: boolean;
5260
+ interval?: number;
5261
+ powerLevel?: string;
5262
+ };
5263
+
5264
+ /**
5265
+ * 开始搜寻附近的蓝牙外围设备结果
5266
+ * @property errMsg - 错误信息,如果调用成功返回 startBluetoothDevicesDiscovery:ok
5267
+ * @property errCode - 错误码,成功时为 0
5268
+ * @property errno - 错误码,成功时为 0
5269
+ */
5270
+ type StartBluetoothDevicesDiscoveryRsp = {
5271
+ errMsg: string;
5272
+ errCode: number;
5273
+ errno: number;
5274
+ };
5275
+
5276
+ /**
5277
+ * 初始化 Wi-Fi 模块结果
5278
+ * @property errMsg - 错误信息,如果调用成功返回 startWifi:ok
5279
+ * @property errCode - 错误码,成功时为 0
5280
+ */
5281
+ type StartWifiRsp = {
5282
+ errMsg: string;
5283
+ errCode: number;
5284
+ };
5285
+
5286
+ /**
5287
+ * 停止搜寻附近的蓝牙外围设备结果
5288
+ * @property errMsg - 错误信息,如果调用成功返回 stopBluetoothDevicesDiscovery:ok
5289
+ * @property errCode - 错误码,成功时为 0
5290
+ */
5291
+ type StopBluetoothDevicesDiscoveryRsp = {
5292
+ errMsg: string;
5293
+ errCode: number;
5294
+ };
5295
+
5296
+ /**
5297
+ * 关闭 Wi-Fi 模块结果
5298
+ * @property errMsg - 错误信息,如果调用成功返回 stopWifi:ok
5299
+ * @property errCode - 错误码,成功时为 0
5300
+ */
5301
+ type StopWifiRsp = {
5302
+ errMsg: string;
5303
+ errCode: number;
5304
+ };
5305
+
5306
+ /**
5307
+ * 向蓝牙低功耗设备特征值中写入二进制数据参数
5308
+ * @property deviceId - 蓝牙设备 id
5309
+ * @property serviceId - 蓝牙特征对应服务的 UUID
5310
+ * @property characteristicId - 蓝牙特征的 UUID
5311
+ * @property value - 蓝牙设备特征对应的二进制值
5312
+ * @property [writeType] - 蓝牙特征值的写模式设置,有效值有 write(需要从机确认)和 writeNoResponse(不需要从机确认)
5313
+ */
5314
+ type WriteBLECharacteristicValueReq = {
5315
+ deviceId: string;
5316
+ serviceId: string;
5317
+ characteristicId: string;
5318
+ value: ArrayBuffer;
5319
+ writeType?: string;
5320
+ };
5321
+
5322
+ /**
5323
+ * 向蓝牙低功耗设备特征值中写入二进制数据结果
5324
+ * @property errMsg - 错误信息,如果调用成功返回 writeBLECharacteristicValue:ok
5325
+ * @property errCode - 错误码,成功时为 0
5326
+ */
5327
+ type WriteBLECharacteristicValueRsp = {
5328
+ errMsg: string;
5329
+ errCode: number;
5330
+ };
5331
+
5332
+ /**
5333
+ * 蓝牙低功耗设备的特征值变化事件通知
5334
+ * @property deviceId - 蓝牙设备 id
5335
+ * @property serviceId - 蓝牙特征对应服务的 UUID
5336
+ * @property characteristicId - 蓝牙特征的 UUID
5337
+ * @property value - 特征值最新的值
5338
+ */
5339
+ type OnBLECharacteristicValueChangeNotice = {
5340
+ deviceId: string;
5341
+ serviceId: string;
5342
+ characteristicId: string;
5343
+ value: ArrayBuffer;
5344
+ };
5345
+
5346
+ /**
5347
+ * @param res - 蓝牙低功耗设备的特征值变化事件通知
5348
+ */
5349
+ type OnBLECharacteristicValueChangeCallback = (res: OnBLECharacteristicValueChangeNotice) => void;
5350
+
5351
+ /**
5352
+ * 监听蓝牙低功耗设备的特征值变化事件参数
5353
+ * @property callback - 蓝牙低功耗设备的特征值变化事件的回调函数
5354
+ */
5355
+ type OnBLECharacteristicValueChangeReq = {
5356
+ callback: OnBLECharacteristicValueChangeCallback;
5357
+ };
5358
+
5359
+ /**
5360
+ * @property deviceId - 蓝牙设备 id
5361
+ * @property connected - 是否处于已连接状态
5362
+ */
5363
+ type OnBLEConnectionStateChangeNotice = {
5364
+ deviceId: string;
5365
+ connected: boolean;
5366
+ };
5367
+
5368
+ /**
5369
+ * @param res - 蓝牙低功耗连接状态改变事件的回调参数
5370
+ */
5371
+ type OnBLEConnectionStateChangeCallback = (res: OnBLEConnectionStateChangeNotice) => void;
5372
+
5373
+ /**
5374
+ * @property callback - 蓝牙低功耗连接状态改变事件的回调函数
5375
+ */
5376
+ type OnBLEConnectionStateChangeReq = {
5377
+ callback: OnBLEConnectionStateChangeCallback;
5378
+ };
5379
+
4818
5380
  /**
4819
5381
  * 逐步废弃
4820
5382
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyext/types-ext-sdk-hy",
3
- "version": "4.2.5-beta.7",
3
+ "version": "4.2.5-beta.9",
4
4
  "description": "TypeScript definitions for sdk",
5
5
  "types": "./index.d.ts",
6
6
  "main": "",