From 0b83979f02e0b84646da35f0afc6a11654a8b507 Mon Sep 17 00:00:00 2001 From: anyesu Date: Sat, 6 Jul 2024 18:34:46 +0800 Subject: [PATCH] =?UTF-8?q?fix(types):=20=E8=A1=A5=E5=85=85=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=8E=88=E6=9D=83=E7=B1=BB=E5=9E=8B=20-=20=E8=93=9D?= =?UTF-8?q?=E7=89=99=20-=20`scope.bluetooth`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html - https://developers.weixin.qq.com/community/develop/doc/000e881c7046a8fa1f4d464105b001 --- .../taro/types/api/device/bluetooth-peripheral.d.ts | 3 +++ packages/taro/types/api/device/bluetooth.d.ts | 10 ++++++---- packages/taro/types/api/open-api/settings.d.ts | 2 ++ 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/taro/types/api/device/bluetooth-peripheral.d.ts b/packages/taro/types/api/device/bluetooth-peripheral.d.ts index e8f63a72a752..3681a0d3f922 100644 --- a/packages/taro/types/api/device/bluetooth-peripheral.d.ts +++ b/packages/taro/types/api/device/bluetooth-peripheral.d.ts @@ -420,6 +420,9 @@ declare module '../../index' { ): void /** 建立本地作为蓝牙低功耗外围设备的服务端,可创建多个 + * + * > [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html):需要 `scope.bluetooth` + * * @supported weapp, jd * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/wx.createBLEPeripheralServer.html */ diff --git a/packages/taro/types/api/device/bluetooth.d.ts b/packages/taro/types/api/device/bluetooth.d.ts index 9775de7c4b06..20da0652785f 100644 --- a/packages/taro/types/api/device/bluetooth.d.ts +++ b/packages/taro/types/api/device/bluetooth.d.ts @@ -287,6 +287,8 @@ declare module '../../index' { ): Promise /** 初始化蓝牙模块 + * + * > [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html):需要 `scope.bluetooth` * * **注意** * - 其他蓝牙相关 API 必须在 Taro.openBluetoothAdapter 调用之后使用。否则 API 会返回错误(errCode=10000)。 @@ -359,7 +361,7 @@ declare module '../../index' { /** 寻找到新设备的事件的回调函数 */ callback: onBluetoothDeviceFound.Callback, ): void - + /** 取消监听蓝牙适配器状态变化事件 * @supported weapp, alipay * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.offBluetoothAdapterStateChange.html @@ -368,15 +370,15 @@ declare module '../../index' { /** 蓝牙适配器状态变化事件的回调函数 */ callback: onBluetoothAdapterStateChange.Callback, ): void - + /** 蓝牙配对接口,仅安卓支持 - * + * * 通常情况下(需要指定 pin 码或者密码时)系统会接管配对流程,直接调用 [Taro.createBLEConnection](/docs/apis/device/bluetooth-ble/createBLEConnection) 即可。该接口只应当在开发者不想让用户手动输入 pin 码且真机验证确认可以正常生效情况下用。 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.makeBluetoothPair.html */ makeBluetoothPair(option: makeBluetoothPair.Option): Promise - + /** 查询蓝牙设备是否配对,仅安卓支持 * @supported weapp * @see https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.isBluetoothDevicePaired.html diff --git a/packages/taro/types/api/open-api/settings.d.ts b/packages/taro/types/api/open-api/settings.d.ts index 83672d1e9531..236639a4f661 100644 --- a/packages/taro/types/api/open-api/settings.d.ts +++ b/packages/taro/types/api/open-api/settings.d.ts @@ -76,6 +76,8 @@ declare module '../../index' { 'scope.camera'?: boolean /** 是否授权小程序在后台运行蓝牙,对应接口 [Taro.openBluetoothAdapterBackground](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/setting/(wx.openBluetoothAdapterBackground).html) */ 'scope.bluetoothBackground'?: boolean + /** 是否授权蓝牙功能,对应接口 [Taro.openBluetoothAdapter](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.openBluetoothAdapter.html), [Taro.createBLEPeripheralServer](https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth-peripheral/wx.createBLEPeripheralServer.html) */ + 'scope.bluetooth'?: boolean } /** 订阅消息设置