@@ -1458,7 +1458,7 @@ source.start()
1458
1458
* 是否使用实验worker。在iOS下,实验worker的JS运行效率比非实验worker提升数倍,如需在worker内进行重度计算的建议开启此选项。同时,实验worker存在极小概率会在系统资源紧张时被系统回收,因此建议配合 worker.onProcessKilled 事件使用,在worker被回收后可重新创建一个。 */
1459
1459
useExperimentalWorker?: boolean
1460
1460
}
1461
- /** 原生模板广告组件。原生模板广告组件是一个原生组件,层级比普通组件高。原生模板广告组件默认是隐藏的,需要调用 CustomAd.show() 将其显示。如果宽度可配置,原生模板广告会根据开发者设置的宽度进行等比缩放。 */
1461
+ /** 原生模板广告组件。原生模板广告组件是一个原生组件,层级比普通组件高。原生模板广告组件默认是隐藏的,需要调用 CustomAd.show() 将其显示。如果宽度可配置,原生模板广告会根据开发者设置的宽度进行等比缩放,部分模板缩放后的尺寸会通过 CustomAd.onResize() 事件中提供 。 */
1462
1462
interface CustomAd {
1463
1463
/** 原生模板广告组件的样式 */
1464
1464
style: CustomAdStyle
@@ -1532,6 +1532,22 @@ CustomAd.offLoad(listener) // 需传入与监听时同一个的函数对象
1532
1532
/** onLoad 传入的监听函数。不传此参数则移除所有监听函数。 */
1533
1533
listener?: OffLoadCallback
1534
1534
): void
1535
+ /** [CustomAd.offResize(function listener)](https://developers.weixin.qq.com/minigame/dev/api/ad/CustomAd.offResize.html)
1536
+ *
1537
+ * 移除原生模板广告宽高回调事件的监听函数
1538
+ *
1539
+ * **示例代码**
1540
+ *
1541
+ * ```js
1542
+ const listener = function (res) { console.log(res) }
1543
+
1544
+ CustomAd.onResize(listener)
1545
+ CustomAd.offResize(listener) // 需传入与监听时同一个的函数对象
1546
+ ``` */
1547
+ offResize(
1548
+ /** onResize 传入的监听函数。不传此参数则移除所有监听函数。 */
1549
+ listener?: OffResizeCallback
1550
+ ): void
1535
1551
/** [CustomAd.onClose(function listener)](https://developers.weixin.qq.com/minigame/dev/api/ad/CustomAd.onClose.html)
1536
1552
*
1537
1553
* 监听原生模板广告关闭事件。 */
@@ -1583,6 +1599,13 @@ CustomAd.offLoad(listener) // 需传入与监听时同一个的函数对象
1583
1599
/** 原生模板广告加载事件的监听函数 */
1584
1600
listener: OnLoadCallback
1585
1601
): void
1602
+ /** [CustomAd.onResize(function listener)](https://developers.weixin.qq.com/minigame/dev/api/ad/CustomAd.onResize.html)
1603
+ *
1604
+ * 监听原生模板广告宽高回调事件(部分横幅模板支持)。 */
1605
+ onResize(
1606
+ /** 原生模板广告宽高回调事件的监听函数 */
1607
+ listener: OnResizeCallback
1608
+ ): void
1586
1609
/** [Promise CustomAd.hide()](https://developers.weixin.qq.com/minigame/dev/api/ad/CustomAd.hide.html)
1587
1610
*
1588
1611
* 隐藏原生模板广告。(某些模板广告无法隐藏) */
@@ -2902,10 +2925,18 @@ GameRecorderShareButton.offTap(listener) // 需传入与监听时同一个的函
2902
2925
errMsg: string
2903
2926
}
2904
2927
interface GetGroupEnterInfoOption {
2928
+ /** 需要基础库: `3.7.8`
2929
+ *
2930
+ * 开启后单聊下返回 open_single_roomid */
2931
+ allowSingleChat?: boolean
2905
2932
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
2906
2933
complete?: GetGroupEnterInfoCompleteCallback
2907
2934
/** 接口调用失败的回调函数 */
2908
2935
fail?: GetGroupEnterInfoFailCallback
2936
+ /** 需要基础库: `3.7.8`
2937
+ *
2938
+ * 开启后返回用户在群(含单聊)下的 group_openid */
2939
+ needGroupOpenID?: boolean
2909
2940
/** 接口调用成功的回调函数 */
2910
2941
success?: GetGroupEnterInfoSuccessCallback
2911
2942
}
@@ -4298,6 +4329,12 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函
4298
4329
/** 腿部分割纹理宽 */
4299
4330
width: number
4300
4331
}
4332
+ interface LoadOption {
4333
+ /** 从不同渠道获得的OPENLINK字符串 */
4334
+ openlink: string
4335
+ /** 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 */
4336
+ query?: IAnyObject
4337
+ }
4301
4338
interface LoadSubpackageOption {
4302
4339
/** 分包加载结束回调事件(加载成功、失败都会执行) */
4303
4340
complete: (...args: any[]) => any
@@ -7125,6 +7162,13 @@ OpenSettingButton.offTap(listener) // 需传入与监听时同一个的函数对
7125
7162
content: string
7126
7163
errMsg: string
7127
7164
}
7165
+ /** 选填,如果已经执行 `.load({ ... })` 无需填写,也允许使用 `.show({ ... })` 连贯执行 */
7166
+ interface ShowOption {
7167
+ /** 从不同渠道获得的OPENLINK字符串 */
7168
+ openlink?: string
7169
+ /** 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 */
7170
+ query?: IAnyObject
7171
+ }
7128
7172
interface ShowShareImageMenuOption {
7129
7173
/** 要分享的图片地址,必须为本地路径或临时路径 */
7130
7174
path: string
@@ -7140,10 +7184,6 @@ OpenSettingButton.offTap(listener) // 需传入与监听时同一个的函数对
7140
7184
*
7141
7185
* 分享的图片消息是否要带小程序入口 (仅部分小程序类目可用) */
7142
7186
needShowEntrance?: boolean
7143
- /** 需要基础库: `3.2.0`
7144
- *
7145
- * 分享样式,小程序可选 v2 */
7146
- style?: string
7147
7187
/** 接口调用成功的回调函数 */
7148
7188
success?: ShowShareImageMenuSuccessCallback
7149
7189
}
@@ -8099,6 +8139,10 @@ session.run({
8099
8139
*
8100
8140
* 动态消息的 activityId。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) 接口获取 */
8101
8141
activityId?: string
8142
+ /** 需要基础库: `3.7.8`
8143
+ *
8144
+ * 指定成员的方式 */
8145
+ chooseType?: number
8102
8146
/** 接口调用结束的回调函数(调用成功、失败都会执行) */
8103
8147
complete?: UpdateShareMenuCompleteCallback
8104
8148
/** 接口调用失败的回调函数 */
@@ -8111,6 +8155,8 @@ session.run({
8111
8155
*
8112
8156
* 是否是动态消息,详见[动态消息](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/updatable-message.html) */
8113
8157
isUpdatableMessage?: boolean
8158
+ /** 参与用户此聊天室下的 group_openid 列表 */
8159
+ participant?: string[]
8114
8160
/** 接口调用成功的回调函数 */
8115
8161
success?: UpdateShareMenuSuccessCallback
8116
8162
/** 需要基础库: `2.4.0`
@@ -8121,6 +8167,10 @@ session.run({
8121
8167
*
8122
8168
* 群待办消息的id,通过toDoActivityId可以把多个群待办消息聚合为同一个。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) 接口获取。详见[群待办消息](#) */
8123
8169
toDoActivityId?: string
8170
+ /** 需要基础库: `3.7.8`
8171
+ *
8172
+ * 聊天工具模式特殊动态消息 */
8173
+ useForChatTool?: boolean
8124
8174
/** 是否使用带 shareTicket 的转发[详情](#) */
8125
8175
withShareTicket?: boolean
8126
8176
}
@@ -9516,7 +9566,7 @@ audioCtx.close().then(() => {
9516
9566
*
9517
9567
* **示例代码**
9518
9568
*
9519
- * 运行以下代码需先进行基础配置,详细请查阅 [多线程 Worker](# ) 文档了解基础知识和配置方法。
9569
+ * 运行以下代码需先进行基础配置,详细请查阅 [多线程 Worker](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/workers.html ) 文档了解基础知识和配置方法。
9520
9570
*
9521
9571
* ```js
9522
9572
const worker = wx.createWorker('workers/request/index.js') // 文件名指定 worker 的入口文件路径,绝对路径
@@ -12694,6 +12744,51 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对
12694
12744
* | 3017/-15012 | | 道具id非法 |
12695
12745
* | 701001 | | ios禁止支付 | */ errCode: number
12696
12746
}
12747
+ interface PageManager {
12748
+ /** [PageManager.destroy()](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/PageManager.destroy.html)
12749
+ *
12750
+ * 需要基础库: `3.6.7`
12751
+ *
12752
+ * 销毁开放页面实例。 */
12753
+ destroy(): void
12754
+ /** [PageManager.off(string eventName, function callback)](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/PageManager.off.html)
12755
+ *
12756
+ * 需要基础库: `3.6.7`
12757
+ *
12758
+ * 取消监听来自活动、功能向开发者产生的某些事件。 */
12759
+ off(
12760
+ /** 取消的事件名称,如果仅填写事件名称则注销该名称下所有的监听 */
12761
+ eventName: string,
12762
+ /** 取消的事件名称及其对应的回调函数指针,可缺省,若填写则仅注销该事件名称下的单个回调函数 */
12763
+ callback?: (...args: any[]) => any
12764
+ ): void
12765
+ /** [PageManager.on(string eventName, function callback)](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/PageManager.on.html)
12766
+ *
12767
+ * 需要基础库: `3.6.7`
12768
+ *
12769
+ * 监听来自活动、功能向开发者产生的某些事件。 */
12770
+ on(
12771
+ /** 事件名称,由渠道获得需要监听的事件名称 */
12772
+ eventName: string,
12773
+ /** 发生某种事件时的回调函数指针 */
12774
+ callback: (...args: any[]) => any
12775
+ ): void
12776
+ /** [Promise PageManager.load(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/PageManager.load.html)
12777
+ *
12778
+ * 需要基础库: `3.6.7`
12779
+ *
12780
+ * 提供OPENLINK加载活动、功能信息。 */
12781
+ load(option: LoadOption): Promise<any>
12782
+ /** [Promise PageManager.show(Object object)](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/PageManager.show.html)
12783
+ *
12784
+ * 需要基础库: `3.6.7`
12785
+ *
12786
+ * 显示已经成功加载信息的开放页面活动、功能。如果调用前未执行 `.load({ ... })` 将自动调用1次并返回加载信息结果。 */
12787
+ show(
12788
+ /** 选填,如果已经执行 `.load({ ... })` 无需填写,也允许使用 `.show({ ... })` 连贯执行 */
12789
+ option?: ShowOption
12790
+ ): Promise<any>
12791
+ }
12697
12792
interface Performance {
12698
12793
/** [number Performance.now()](https://developers.weixin.qq.com/minigame/dev/api/base/performance/Performance.now.html)
12699
12794
*
@@ -13926,6 +14021,7 @@ console.log(windowInfo.screenTop)
13926
14021
/** [[BannerAd](https://developers.weixin.qq.com/minigame/dev/api/ad/BannerAd.html) wx.createBannerAd(Object object)](https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createBannerAd.html)
13927
14022
*
13928
14023
* 需要基础库: `2.0.4`
14024
+ * @deprecated 基础库版本 [3.5.5](https://developers.weixin.qq.com/miniprogram/dev/framework/compatibility.html) 起已废弃,请使用 [wx.createCustomAd](https://developers.weixin.qq.com/minigame/dev/api/ad/wx.createCustomAd.html) 替换
13929
14025
*
13930
14026
* 创建 banner 广告组件。请通过 [wx.getSystemInfoSync()](https://developers.weixin.qq.com/minigame/dev/api/base/system/wx.getSystemInfoSync.html) 返回对象的 SDKVersion 判断基础库版本号 >= 2.0.4 后再使用该 API。每次调用该方法创建 banner 广告都会返回一个全新的实例。 */
13931
14027
createBannerAd(option: CreateBannerAdOption): BannerAd
@@ -14156,7 +14252,7 @@ session.destroy()
14156
14252
*
14157
14253
* 需要基础库: `1.6.0`
14158
14254
*
14159
- * 创建内部 [audio](# ) 上下文 [InnerAudioContext](https://developers.weixin.qq.com/minigame/dev/api/media/audio/InnerAudioContext.html) 对象。
14255
+ * 创建内部 [audio](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/audio.html ) 上下文 [InnerAudioContext](https://developers.weixin.qq.com/minigame/dev/api/media/audio/InnerAudioContext.html) 对象。
14160
14256
*
14161
14257
* **示例代码**
14162
14258
*
@@ -14258,6 +14354,33 @@ logger.warn({str: 'hello world'}, 'warn log', 100, [1, 2, 3])
14258
14354
createOpenSettingButton(
14259
14355
option: CreateOpenSettingButtonOption
14260
14356
): OpenSettingButton
14357
+ /** [[PageManager](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/PageManager.html) wx.createPageManager()](https://developers.weixin.qq.com/minigame/dev/api/open-api/openlink/wx.createPageManager.html)
14358
+ *
14359
+ * 需要基础库: `3.6.7`
14360
+ *
14361
+ * 小游戏开放页面管理器,用于启动微信内置的各种小游戏活动、功能页面。具体OPENLINK值由不同的能力渠道获得。
14362
+ *
14363
+ * **示例代码**
14364
+ *
14365
+ * ```js
14366
+ const pageManager = wx.createPageManager();
14367
+
14368
+ pageManager.load({
14369
+ openlink: 'xxxxxxx-xxxxxx', // 由不同渠道获得的OPENLINK值
14370
+ }).then((res) => {
14371
+ // 加载成功,res 可能携带不同活动、功能返回的特殊回包信息(具体请参阅渠道说明)
14372
+ console.log(res);
14373
+
14374
+ // 加载成功后按需显示
14375
+ pageManager.show();
14376
+
14377
+ }).catch((err) => {
14378
+ // 加载失败,请查阅 err 给出的错误信息
14379
+ console.error(err);
14380
+ })
14381
+
14382
+ ``` */
14383
+ createPageManager(): PageManager
14261
14384
/** [[Path2D](https://developers.weixin.qq.com/minigame/dev/api/render/canvas/Path2D.html) wx.createPath2D()](https://developers.weixin.qq.com/minigame/dev/api/render/canvas/wx.createPath2D.html)
14262
14385
*
14263
14386
* 需要基础库: `2.24.6`
@@ -15514,6 +15637,7 @@ if (wx.getExtConfig) {
15514
15637
* ## 注意事项
15515
15638
* - 基础库 v2.10.4 开始支持获取群工具小程序启动信息
15516
15639
* - 基础库 v2.17.3 开始支持获取群聊小程序消息卡片、群待办小程序启动信息
15640
+ * - 基础库 v3.7.8 支持获取单聊群启动信息,获取的群(含单聊)唯一标识,可用于[聊天工具模式](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.openChatTool.html)。
15517
15641
*
15518
15642
* **示例代码**
15519
15643
*
@@ -15538,7 +15662,10 @@ wx.getGroupEnterInfo({
15538
15662
*
15539
15663
* ```json
15540
15664
{
15541
- "opengid": "OPENGID"
15665
+ "opengid": "OPENGID", // 多聊群下返回的群唯一标识
15666
+ "open_single_roomid": "", // 单聊群下返回的群唯一标识
15667
+ "group_openid": "", // 用户在当前群的唯一标识
15668
+ "chat_type": 3, // 聊天室类型
15542
15669
}
15543
15670
```
15544
15671
*
@@ -18024,7 +18151,7 @@ wx.openCustomerServiceChat({
18024
18151
*
18025
18152
* 需要基础库: `2.0.3`
18026
18153
*
18027
- * 进入客服会话。要求在用户发生过至少一次 touch 事件后才能调用。后台接入方式与小程序一致,详见 [客服消息接入](# )
18154
+ * 进入客服会话。要求在用户发生过至少一次 touch 事件后才能调用。后台接入方式与小程序一致,详见 [客服消息接入](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/customer-message/customer-message.html )
18028
18155
*
18029
18156
* **注意事项**
18030
18157
*
@@ -19118,12 +19245,7 @@ wx.showModal({
19118
19245
*
19119
19246
* 需要基础库: `2.14.3`
19120
19247
*
19121
- * 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载
19122
- *
19123
- * **Bug & Tip**
19124
- *
19125
- * 1. `tip`: `needShowEntrance`分享的图片消息是否要带小程序入口,支持申明类目:商家自营、电商平台、餐饮服务(餐饮服务场所/餐饮服务管理企业、点餐平台、外卖平台)、旅游服务(住宿服务、景区服务、OTA、旅游管理单位)、生活服务(家政服务、丽人服务、宠物(非医院类)、婚庆服务、洗浴保健、休闲娱乐、百货/超市/便利店、开锁服务、营业性演出票务、其他宠物健康服务、洗浴保健平台、共享服务、跑腿、寄存、求职/招聘)
19126
- * 2. `tip`: `needShowEntrance`小游戏所有类目都支持 */
19248
+ * 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载 */
19127
19249
showShareImageMenu<
19128
19250
T extends ShowShareImageMenuOption = ShowShareImageMenuOption
19129
19251
>(
0 commit comments