Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): 补充用户授权类型 - 蓝牙 - scope.bluetooth #16054

Merged
merged 3 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/taro/types/api/device/bluetooth-peripheral.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
10 changes: 6 additions & 4 deletions packages/taro/types/api/device/bluetooth.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ declare module '../../index' {
): Promise<startBluetoothDevicesDiscovery.Promised>

/** 初始化蓝牙模块
*
* > [用户授权](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/authorize.html):需要 `scope.bluetooth`
*
* **注意**
* - 其他蓝牙相关 API 必须在 Taro.openBluetoothAdapter 调用之后使用。否则 API 会返回错误(errCode=10000)。
Expand Down Expand Up @@ -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
Expand All @@ -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<TaroGeneral.CallbackResult>

/** 查询蓝牙设备是否配对,仅安卓支持
* @supported weapp
* @see https://developers.weixin.qq.com/miniprogram/dev/api/device/bluetooth/wx.isBluetoothDevicePaired.html
Expand Down
2 changes: 2 additions & 0 deletions packages/taro/types/api/open-api/settings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/** 订阅消息设置
Expand Down
Loading