Skip to content

Commit 7c7e76f

Browse files
author
peaceouyang
committed
feat: update baselib defs to 3.15.2
1 parent 874acdc commit 7c7e76f

2 files changed

Lines changed: 165 additions & 19 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2026-04-22 v5.1.3
2+
- 更新 API 定义到 3.15.2
3+
14
## 2026-03-13 v5.1.2
25
- 更新 API 定义到 3.14.3
36

types/wx/lib.wx.api.d.ts

Lines changed: 162 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3683,6 +3683,14 @@ ctx.draw()
36833683
/** 是否已录入信息 */
36843684
isEnrolled: boolean
36853685
}
3686+
interface CheckIsSupportFacialRecognitionOption {
3687+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
3688+
complete?: CheckIsSupportFacialRecognitionCompleteCallback
3689+
/** 接口调用失败的回调函数 */
3690+
fail?: CheckIsSupportFacialRecognitionFailCallback
3691+
/** 接口调用成功的回调函数 */
3692+
success?: CheckIsSupportFacialRecognitionSuccessCallback
3693+
}
36863694
interface CheckIsSupportSoterAuthenticationOption {
36873695
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
36883696
complete?: CheckIsSupportSoterAuthenticationCompleteCallback
@@ -3846,9 +3854,9 @@ ctx.draw()
38463854
/** 抬头类型
38473855
*
38483856
* 可选值:
3849-
* - '0': 单位;
3850-
* - '1': 个人; */
3851-
type: '0' | '1'
3857+
* - 0: 单位;
3858+
* - 1: 个人; */
3859+
type: 0 | 1
38523860
}
38533861
interface ChooseLicensePlateOption {
38543862
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
@@ -4912,6 +4920,20 @@ ctx.draw()
49124920
/** 接口调用成功的回调函数 */
49134921
success?: EnableAlertBeforeUnloadSuccessCallback
49144922
}
4923+
interface EnterChatToolModeOption {
4924+
/** 聊天室 id,不传则拉起群选择框,可以传入多聊群的 opengid 值 */
4925+
chatToolRooms?: string[]
4926+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
4927+
complete?: EnterChatToolModeCompleteCallback
4928+
/** 接口调用失败的回调函数 */
4929+
fail?: EnterChatToolModeFailCallback
4930+
/** 多选模式下最多选择的群聊数量 */
4931+
selectLimit?: number
4932+
/** 是否单选群聊,true 为单选,false 为多选 */
4933+
singleChatRoom?: boolean
4934+
/** 接口调用成功的回调函数 */
4935+
success?: EnterChatToolModeSuccessCallback
4936+
}
49154937
/** 文件读取结果。res.entries 是一个对象,key是文件路径,value是一个对象 FileItem ,表示该文件的读取结果。每个 FileItem 包含 data (文件内容) 和 errMsg (错误信息) 属性。 */
49164938
interface EntriesResult {
49174939
/** 文件路径 */
@@ -8175,10 +8197,8 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
81758197
routeType?: string
81768198
/** 接口调用成功的回调函数 */
81778199
success?: NavigateToSuccessCallback
8178-
/** [OpenContainer](https://developers.weixin.qq.com/miniprogram/dev/api/skyline/OpenContainer.html)
8179-
*
8180-
* 3.12.2 skyline 下指定路由动画所用OpenContainerContext,相关文档 [OpenContainerContext] (#) */
8181-
withOpenContainer?: OpenContainer
8200+
/** 3.12.2 skyline 下指定路由动画所用OpenContainerContext,相关文档 [OpenContainerContext](#) */
8201+
withOpenContainer?: IAnyObject
81828202
}
81838203
interface NavigateToSuccessCallbackResult {
81848204
/** [EventChannel](https://developers.weixin.qq.com/miniprogram/dev/api/route/EventChannel.html)
@@ -8643,6 +8663,8 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
86438663
interface OnCopyUrlListenerResult {
86448664
/** 用短链打开小程序时当前页面携带的查询字符串。小程序中使用时,应在进入页面时调用 `wx.onCopyUrl` 自定义 `query`,退出页面时调用 `wx.offCopyUrl`,防止影响其它页面。 */
86458665
query: string
8666+
/** 短链中的自定义标题,显示在小程序名称之后,可以不填 */
8667+
title: string
86468668
}
86478669
interface OnCustomRendererEventCallbackResult {
86488670
/** 推流高度 */
@@ -10488,6 +10510,16 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
1048810510
/** 本次请求底层重试次数 */
1048910511
retryCount: number
1049010512
}
10513+
interface RequestFacialVerifyOption {
10514+
/** 人脸核身会话唯一标识(小程序后台根据「用户实名信息(姓名+身份证)」调用微信后台[getVerifyId](https://developers.weixin.qq.com/miniprogram/dev/server/API/face/api_getverifyid.html)接口获取) */
10515+
verifyId: string
10516+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
10517+
complete?: RequestFacialVerifyCompleteCallback
10518+
/** 接口调用失败的回调函数 */
10519+
fail?: RequestFacialVerifyFailCallback
10520+
/** 接口调用成功的回调函数 */
10521+
success?: RequestFacialVerifySuccessCallback
10522+
}
1049110523
interface RequestFailCallbackErr {
1049210524
/** 错误信息 */
1049310525
errMsg: string
@@ -11282,13 +11314,13 @@ wx.createSelectorQuery()
1128211314
interface ScrollViewContextScrollToOption {
1128311315
/** 是否启用滚动动画 */
1128411316
animated?: boolean
11285-
/** 滚动动画时长 (仅在 iOS 下生效) */
11317+
/** 滚动动画时长 (webview 仅在 iOS 下生效;skyline 在 3.14.3 后支持) */
1128611318
duration?: number
1128711319
/** 左边界距离 */
1128811320
left?: number
1128911321
/** 顶部距离 */
1129011322
top?: number
11291-
/** 初始速度 (仅在 iOS 下生效) */
11323+
/** 初始速度 (webview 仅在 iOS 下生效;skyline 在 3.14.3 后支持) */
1129211324
velocity?: number
1129311325
}
1129411326
interface SeekBackgroundAudioOption {
@@ -11776,21 +11808,21 @@ wx.createSelectorQuery()
1177611808
success?: ShareImageToGroupSuccessCallback
1177711809
}
1177811810
interface ShareToOfficialAccountOption {
11779-
/** 公众号文章标题 */
11811+
/** 贴图的标题 */
1178011812
title: string
1178111813
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
1178211814
complete?: ShareToOfficialAccountCompleteCallback
11783-
/** 公众号文章正文 */
11815+
/** 贴图的正文 */
1178411816
content?: string
1178511817
/** 接口调用失败的回调函数 */
1178611818
fail?: ShareToOfficialAccountFailCallback
11787-
/** 公众号文章图片,必须为本地路径或临时路径 */
11819+
/** 贴图的图片,必须为本地路径或临时路径 */
1178811820
images?: string[]
1178911821
/** 开发者自定义小程序路径 */
1179011822
path?: string
1179111823
/** 接口调用成功的回调函数 */
1179211824
success?: ShareToOfficialAccountSuccessCallback
11793-
/** 公众号文章标签 */
11825+
/** 贴图的标签 */
1179411826
tags?: string[]
1179511827
}
1179611828
interface ShareToWeRunOption {
@@ -12028,6 +12060,8 @@ wx.createSelectorQuery()
1202812060
offerId: string
1202912061
/** 业务订单号, 每个订单号只能使用一次, 重复使用会失败(极端情况不保证唯一, 不建议业务强依赖唯一性). 要求8-32个字符内, 只能是数字、大小写字母、符号 _-|*@组成, 不能以下划线(_)开头 */
1203012062
outTradeNo: string
12063+
/** 道具优惠价格(分),**非必填,该字段需与goodsPrice一起传入**。如用户使用优惠券、积分等,需要以低于道具价格下单时可传入,传入后该价格即为实际下单价格,优惠价格最低为道具价格的40%。 */
12064+
activitySellingPrice?: number
1203112065
/** 环境配置, 0 米大师正式环境, 1 米大师沙箱环境, 默认为 0 */
1203212066
env?: number
1203312067
/** 道具单价(分), **该字段仅mode=short_series_goods时需要必填**, 用来校验价格与后台道具价格是否一致, 避免用户在业务商城页看到的价格与实际价格不一致导致投诉 */
@@ -12981,6 +13015,10 @@ wx.getSetting({
1298113015
port: number
1298213016
}
1298313017
interface TakePhotoOption {
13018+
/** 需要基础库: `3.15.0`
13019+
*
13020+
* 是否返回照片的拍摄信息 */
13021+
captureMetadata?: boolean
1298413022
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
1298513023
complete?: TakePhotoCompleteCallback
1298613024
/** 接口调用失败的回调函数 */
@@ -13001,6 +13039,10 @@ wx.getSetting({
1300113039
success?: TakePhotoSuccessCallback
1300213040
}
1300313041
interface TakePhotoSuccessCallbackResult {
13042+
/** 需要基础库: `3.15.0`
13043+
*
13044+
* 照片的拍摄信息,仅当传入的 captureMetadata 属性值为 true 时返回该字段 */
13045+
metadata: IAnyObject
1300413046
/** 照片文件的临时路径 (本地路径),安卓是jpg图片格式,ios是png */
1300513047
tempImagePath: string
1300613048
errMsg: string
@@ -20289,6 +20331,18 @@ Page({
2028920331
* 停止录音 */
2029020332
stop(): void
2029120333
}
20334+
interface RequestFacialVerifyError {
20335+
/** 错误信息
20336+
*
20337+
* | 错误码 | 错误信息 | 说明 |
20338+
* | - | - | - |
20339+
* | 0 | 人脸识别完成(需要通过[queryVerifyInfo](https://developers.weixin.qq.com/miniprogram/dev/server/API/face/api_queryverifyinfo.html)接口查询人脸核身真实验证结果) | | */ errMsg: string
20340+
/** 错误码
20341+
*
20342+
* | 错误码 | 错误信息 | 说明 |
20343+
* | - | - | - |
20344+
* | 0 | 人脸识别完成(需要通过[queryVerifyInfo](https://developers.weixin.qq.com/miniprogram/dev/server/API/face/api_queryverifyinfo.html)接口查询人脸核身真实验证结果) | | */ errCode: number
20345+
}
2029220346
interface RequestTask {
2029320347
/** [RequestTask.abort()](https://developers.weixin.qq.com/miniprogram/dev/api/network/request/RequestTask.abort.html)
2029420348
*
@@ -23691,6 +23745,29 @@ wx.checkIsSoterEnrolledInDevice({
2369123745
>(
2369223746
option: T
2369323747
): PromisifySuccessResult<T, CheckIsSoterEnrolledInDeviceOption>
23748+
/** [wx.checkIsSupportFacialRecognition(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/face/wx.checkIsSupportFacialRecognition.html)
23749+
*
23750+
* 需要基础库: `3.8.12`
23751+
*
23752+
* 在插件中使用:不支持
23753+
*
23754+
* 检查当前设备是否支持人脸识别能力
23755+
*
23756+
* **示例代码**
23757+
*
23758+
* ```js
23759+
wx.checkIsSupportFacialRecognition({
23760+
success() {
23761+
// 支持人脸识别
23762+
},
23763+
fail() {
23764+
// 不支持人脸识别
23765+
},
23766+
})
23767+
``` */
23768+
checkIsSupportFacialRecognition(
23769+
option?: CheckIsSupportFacialRecognitionOption
23770+
): void
2369423771
/** [wx.checkIsSupportSoterAuthentication(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/soter/wx.checkIsSupportSoterAuthentication.html)
2369523772
*
2369623773
* 需要基础库: `1.5.0`
@@ -24252,6 +24329,17 @@ wx.editImage({
2425224329
*
2425324330
* [在微信开发者工具中查看示例](https://developers.weixin.qq.com/s/MTPm9Cmh7VfT) */
2425424331
enableAlertBeforeUnload(option: EnableAlertBeforeUnloadOption): void
24332+
/** [wx.enterChatToolMode(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/chattool/wx.enterChatToolMode.html)
24333+
*
24334+
* 需要基础库: `3.12.0`
24335+
*
24336+
* 在插件中使用:不支持
24337+
*
24338+
* 进入聊天工具开放能力模式。
24339+
*
24340+
* 1. 不传入聊天室id列表时,微信会拉起聊天列表让用户选择,用户选择后绑定聊天室进入聊天工具模式。
24341+
* 2. 传入聊天室id列表时(群聊为opengid),会直接绑定这批聊天室进入。 */
24342+
enterChatToolMode(option: EnterChatToolModeOption): void
2425524343
/** [wx.exitMiniProgram(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/navigate/wx.exitMiniProgram.html)
2425624344
*
2425724345
* 需要基础库: `2.17.3`
@@ -25087,7 +25175,7 @@ Page({
2508725175
*
2508825176
* ```js
2508925177
wx.getRandomValues({
25090-
length: 6 // 生成 6 个字节长度的随机数,
25178+
length: 6, // 生成 6 个字节长度的随机数
2509125179
success: res => {
2509225180
console.log(wx.arrayBufferToBase64(res.randomValues)) // 转换为 base64 字符串后打印
2509325181
}
@@ -28944,7 +29032,7 @@ wx.openInquiriesTopic({
2894429032
*
2894529033
* 需要基础库: `3.4.8`
2894629034
*
28947-
* 在插件中使用:不支持
29035+
* 在插件中使用:需要基础库 `3.15.1`
2894829036
*
2894929037
* 通过小程序打开任意公众号文章(不包括临时链接等异常状态下的公众号文章),必须有点击行为才能调用成功。
2895029038
*
@@ -29778,6 +29866,29 @@ wx.requestDeviceVoIP({
2977829866
})
2977929867
``` */
2978029868
requestDeviceVoIP(option: RequestDeviceVoIPOption): void
29869+
/** [wx.requestFacialVerify(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/face/wx.requestFacialVerify.html)
29870+
*
29871+
* 需要基础库: `3.8.12`
29872+
*
29873+
* 在插件中使用:不支持
29874+
*
29875+
* 对用户实名信息进行基于生物识别的人脸核身验证
29876+
*
29877+
* **示例代码**
29878+
*
29879+
* ```js
29880+
wx.requestFacialVerify({
29881+
// 人脸核身会话唯一标识
29882+
verifyId: 'xxx',
29883+
success() {
29884+
// 人脸核身验证成功,需要通知小程序后台根据本次人脸核身会话唯一标识 verifyId 字段调用微信后台 queryVerifyInfo 接口查询人脸核身真实验证结果。
29885+
},
29886+
fail() {
29887+
// 人脸核身验证失败
29888+
},
29889+
})
29890+
``` */
29891+
requestFacialVerify(option: RequestFacialVerifyOption): void
2978129892
/** [wx.requestIdleCallback(function callback, Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/base/performance/wx.requestIdleCallback.html)
2978229893
*
2978329894
* 需要基础库: `3.10.0`
@@ -30963,17 +31074,17 @@ wx.getWifiList()
3096331074
*
3096431075
* 在插件中使用:不支持
3096531076
*
30966-
* 支持拉起公众号图文发表页,用户可将图片与文字内容发表至公众号
31077+
* 支持拉起贴图发表页,用户可将图片与文字内容发表为贴图。
3096731078
*
3096831079
* ****
3096931080
*
3097031081
* ## 推荐图标
3097131082
*
30972-
* 推荐使用公众号品牌图标作为该功能按钮,可使用下列高清素材:
31083+
* 推荐使用贴图品牌图标作为该功能按钮,可使用下列高清素材:
3097331084
*
30974-
* ![推荐图标1](https://res.wx.qq.com/op_res/sUpSkdOuTXzdE2AcUlfESWWjDekvvsIpAB5LkXDz68XiwaYUxjHhMRe9aUxQeFKKpeodbEXzywEC4FITblbJwA)
31085+
* ![推荐图标1](https://res.wx.qq.com/op_res/92p2SWttdiOWvv5u9ZnyZwZrBXYrnz8TwwQNyOnfjFK2EG_Veqj4i0Gvs_EzXzzoXSByoaXkou7gw5_UIHiYRg)
3097531086
*
30976-
* ![推荐图标2](https://res.wx.qq.com/op_res/CtbPHCu5Ado0lGDHwEHsP4HAdafJu48A6P8O5ajOoZqle7XIlALejtqID9DcMGtTJHXOJYq91wXrbmQ7MjFi1w) */
31087+
* ![推荐图标2](https://res.wx.qq.com/op_res/T9EwP8p1f6xuyLUDFdfVP7qiQsqrm203K6PeQdxjh87W_ME_-ht8nLLdtMZmapwdrfgpmMctsjiBwZpkIyfxgA) */
3097731088
shareToOfficialAccount(option: ShareToOfficialAccountOption): void
3097831089
/** [wx.shareToWeRun(Object object)](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/werun/wx.shareToWeRun.html)
3097931090
*
@@ -32375,6 +32486,18 @@ wx.writeBLECharacteristicValue({
3237532486
result: CheckIsSoterEnrolledInDeviceSuccessCallbackResult
3237632487
) => void
3237732488
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
32489+
type CheckIsSupportFacialRecognitionCompleteCallback = (
32490+
res: GeneralCallbackResult
32491+
) => void
32492+
/** 接口调用失败的回调函数 */
32493+
type CheckIsSupportFacialRecognitionFailCallback = (
32494+
res: GeneralCallbackResult
32495+
) => void
32496+
/** 接口调用成功的回调函数 */
32497+
type CheckIsSupportFacialRecognitionSuccessCallback = (
32498+
res: GeneralCallbackResult
32499+
) => void
32500+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
3237832501
type CheckIsSupportSoterAuthenticationCompleteCallback = (
3237932502
res: GeneralCallbackResult
3238032503
) => void
@@ -32674,6 +32797,14 @@ wx.writeBLECharacteristicValue({
3267432797
res: GeneralCallbackResult
3267532798
) => void
3267632799
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
32800+
type EnterChatToolModeCompleteCallback = (
32801+
res: GeneralCallbackResult
32802+
) => void
32803+
/** 接口调用失败的回调函数 */
32804+
type EnterChatToolModeFailCallback = (res: GeneralCallbackResult) => void
32805+
/** 接口调用成功的回调函数 */
32806+
type EnterChatToolModeSuccessCallback = (res: GeneralCallbackResult) => void
32807+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
3267732808
type EraseLinesCompleteCallback = (res: GeneralCallbackResult) => void
3267832809
/** 接口调用失败的回调函数 */
3267932810
type EraseLinesFailCallback = (res: GeneralCallbackResult) => void
@@ -34803,6 +34934,18 @@ wx.writeBLECharacteristicValue({
3480334934
type RequestDeviceVoIPFailCallback = (res: GeneralCallbackResult) => void
3480434935
/** 接口调用成功的回调函数 */
3480534936
type RequestDeviceVoIPSuccessCallback = (res: GeneralCallbackResult) => void
34937+
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
34938+
type RequestFacialVerifyCompleteCallback = (
34939+
res: RequestFacialVerifyError
34940+
) => void
34941+
/** 接口调用失败的回调函数 */
34942+
type RequestFacialVerifyFailCallback = (
34943+
res: RequestFacialVerifyError
34944+
) => void
34945+
/** 接口调用成功的回调函数 */
34946+
type RequestFacialVerifySuccessCallback = (
34947+
res: RequestFacialVerifyError
34948+
) => void
3480634949
/** 接口调用失败的回调函数 */
3480734950
type RequestFailCallback = (err: RequestFailCallbackErr) => void
3480834951
/** 接口调用结束的回调函数(调用成功、失败都会执行) */

0 commit comments

Comments
 (0)