@@ -1458,7 +1458,7 @@ source.start()
14581458 * 是否使用实验worker。在iOS下,实验worker的JS运行效率比非实验worker提升数倍,如需在worker内进行重度计算的建议开启此选项。同时,实验worker存在极小概率会在系统资源紧张时被系统回收,因此建议配合 worker.onProcessKilled 事件使用,在worker被回收后可重新创建一个。 */
14591459 useExperimentalWorker?: boolean
14601460 }
1461- /** 原生模板广告组件。原生模板广告组件是一个原生组件,层级比普通组件高。原生模板广告组件默认是隐藏的,需要调用 CustomAd.show() 将其显示。如果宽度可配置,原生模板广告会根据开发者设置的宽度进行等比缩放。 */
1461+ /** 原生模板广告组件。原生模板广告组件是一个原生组件,层级比普通组件高。原生模板广告组件默认是隐藏的,需要调用 CustomAd.show() 将其显示。如果宽度可配置,原生模板广告会根据开发者设置的宽度进行等比缩放,部分模板缩放后的尺寸会通过 CustomAd.onResize() 事件中提供 。 */
14621462 interface CustomAd {
14631463 /** 原生模板广告组件的样式 */
14641464 style: CustomAdStyle
@@ -1532,6 +1532,22 @@ CustomAd.offLoad(listener) // 需传入与监听时同一个的函数对象
15321532 /** onLoad 传入的监听函数。不传此参数则移除所有监听函数。 */
15331533 listener?: OffLoadCallback
15341534 ): 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
15351551 /** [CustomAd.onClose(function listener)](https://developers.weixin.qq.com/minigame/dev/api/ad/CustomAd.onClose.html)
15361552 *
15371553 * 监听原生模板广告关闭事件。 */
@@ -1583,6 +1599,13 @@ CustomAd.offLoad(listener) // 需传入与监听时同一个的函数对象
15831599 /** 原生模板广告加载事件的监听函数 */
15841600 listener: OnLoadCallback
15851601 ): 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
15861609 /** [Promise CustomAd.hide()](https://developers.weixin.qq.com/minigame/dev/api/ad/CustomAd.hide.html)
15871610 *
15881611 * 隐藏原生模板广告。(某些模板广告无法隐藏) */
@@ -2902,10 +2925,18 @@ GameRecorderShareButton.offTap(listener) // 需传入与监听时同一个的函
29022925 errMsg: string
29032926 }
29042927 interface GetGroupEnterInfoOption {
2928+ /** 需要基础库: `3.7.8`
2929+ *
2930+ * 开启后单聊下返回 open_single_roomid */
2931+ allowSingleChat?: boolean
29052932 /** 接口调用结束的回调函数(调用成功、失败都会执行) */
29062933 complete?: GetGroupEnterInfoCompleteCallback
29072934 /** 接口调用失败的回调函数 */
29082935 fail?: GetGroupEnterInfoFailCallback
2936+ /** 需要基础库: `3.7.8`
2937+ *
2938+ * 开启后返回用户在群(含单聊)下的 group_openid */
2939+ needGroupOpenID?: boolean
29092940 /** 接口调用成功的回调函数 */
29102941 success?: GetGroupEnterInfoSuccessCallback
29112942 }
@@ -4298,6 +4329,12 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函
42984329 /** 腿部分割纹理宽 */
42994330 width: number
43004331 }
4332+ interface LoadOption {
4333+ /** 从不同渠道获得的OPENLINK字符串 */
4334+ openlink: string
4335+ /** 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 */
4336+ query?: IAnyObject
4337+ }
43014338 interface LoadSubpackageOption {
43024339 /** 分包加载结束回调事件(加载成功、失败都会执行) */
43034340 complete: (...args: any[]) => any
@@ -7125,6 +7162,13 @@ OpenSettingButton.offTap(listener) // 需传入与监听时同一个的函数对
71257162 content: string
71267163 errMsg: string
71277164 }
7165+ /** 选填,如果已经执行 `.load({ ... })` 无需填写,也允许使用 `.show({ ... })` 连贯执行 */
7166+ interface ShowOption {
7167+ /** 从不同渠道获得的OPENLINK字符串 */
7168+ openlink?: string
7169+ /** 选填,部分活动、功能允许接收自定义query参数,请参阅渠道说明,默认可不填 */
7170+ query?: IAnyObject
7171+ }
71287172 interface ShowShareImageMenuOption {
71297173 /** 要分享的图片地址,必须为本地路径或临时路径 */
71307174 path: string
@@ -7140,10 +7184,6 @@ OpenSettingButton.offTap(listener) // 需传入与监听时同一个的函数对
71407184 *
71417185 * 分享的图片消息是否要带小程序入口 (仅部分小程序类目可用) */
71427186 needShowEntrance?: boolean
7143- /** 需要基础库: `3.2.0`
7144- *
7145- * 分享样式,小程序可选 v2 */
7146- style?: string
71477187 /** 接口调用成功的回调函数 */
71487188 success?: ShowShareImageMenuSuccessCallback
71497189 }
@@ -8099,6 +8139,10 @@ session.run({
80998139 *
81008140 * 动态消息的 activityId。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) 接口获取 */
81018141 activityId?: string
8142+ /** 需要基础库: `3.7.8`
8143+ *
8144+ * 指定成员的方式 */
8145+ chooseType?: number
81028146 /** 接口调用结束的回调函数(调用成功、失败都会执行) */
81038147 complete?: UpdateShareMenuCompleteCallback
81048148 /** 接口调用失败的回调函数 */
@@ -8111,6 +8155,8 @@ session.run({
81118155 *
81128156 * 是否是动态消息,详见[动态消息](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/share/updatable-message.html) */
81138157 isUpdatableMessage?: boolean
8158+ /** 参与用户此聊天室下的 group_openid 列表 */
8159+ participant?: string[]
81148160 /** 接口调用成功的回调函数 */
81158161 success?: UpdateShareMenuSuccessCallback
81168162 /** 需要基础库: `2.4.0`
@@ -8121,6 +8167,10 @@ session.run({
81218167 *
81228168 * 群待办消息的id,通过toDoActivityId可以把多个群待办消息聚合为同一个。通过 [updatableMessage.createActivityId](https://developers.weixin.qq.com/minigame/dev/api-backend/open-api/updatable-message/updatableMessage.createActivityId.html) 接口获取。详见[群待办消息](#) */
81238169 toDoActivityId?: string
8170+ /** 需要基础库: `3.7.8`
8171+ *
8172+ * 聊天工具模式特殊动态消息 */
8173+ useForChatTool?: boolean
81248174 /** 是否使用带 shareTicket 的转发[详情](#) */
81258175 withShareTicket?: boolean
81268176 }
@@ -9516,7 +9566,7 @@ audioCtx.close().then(() => {
95169566*
95179567* **示例代码**
95189568*
9519- * 运行以下代码需先进行基础配置,详细请查阅 [多线程 Worker](# ) 文档了解基础知识和配置方法。
9569+ * 运行以下代码需先进行基础配置,详细请查阅 [多线程 Worker](https://developers.weixin.qq.com/minigame/dev/guide/base-ability/workers.html ) 文档了解基础知识和配置方法。
95209570*
95219571* ```js
95229572const worker = wx.createWorker('workers/request/index.js') // 文件名指定 worker 的入口文件路径,绝对路径
@@ -12694,6 +12744,51 @@ InterstitialAd.offLoad(listener) // 需传入与监听时同一个的函数对
1269412744 * | 3017/-15012 | | 道具id非法 |
1269512745 * | 701001 | | ios禁止支付 | */ errCode: number
1269612746 }
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+ }
1269712792 interface Performance {
1269812793 /** [number Performance.now()](https://developers.weixin.qq.com/minigame/dev/api/base/performance/Performance.now.html)
1269912794 *
@@ -13926,6 +14021,7 @@ console.log(windowInfo.screenTop)
1392614021 /** [[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)
1392714022 *
1392814023 * 需要基础库: `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) 替换
1392914025 *
1393014026 * 创建 banner 广告组件。请通过 [wx.getSystemInfoSync()](https://developers.weixin.qq.com/minigame/dev/api/base/system/wx.getSystemInfoSync.html) 返回对象的 SDKVersion 判断基础库版本号 >= 2.0.4 后再使用该 API。每次调用该方法创建 banner 广告都会返回一个全新的实例。 */
1393114027 createBannerAd(option: CreateBannerAdOption): BannerAd
@@ -14156,7 +14252,7 @@ session.destroy()
1415614252*
1415714253* 需要基础库: `1.6.0`
1415814254*
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) 对象。
1416014256*
1416114257* **示例代码**
1416214258*
@@ -14258,6 +14354,33 @@ logger.warn({str: 'hello world'}, 'warn log', 100, [1, 2, 3])
1425814354 createOpenSettingButton(
1425914355 option: CreateOpenSettingButtonOption
1426014356 ): 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
1426114384 /** [[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)
1426214385 *
1426314386 * 需要基础库: `2.24.6`
@@ -15514,6 +15637,7 @@ if (wx.getExtConfig) {
1551415637* ## 注意事项
1551515638* - 基础库 v2.10.4 开始支持获取群工具小程序启动信息
1551615639* - 基础库 v2.17.3 开始支持获取群聊小程序消息卡片、群待办小程序启动信息
15640+ * - 基础库 v3.7.8 支持获取单聊群启动信息,获取的群(含单聊)唯一标识,可用于[聊天工具模式](https://developers.weixin.qq.com/minigame/dev/api/chattool/wx.openChatTool.html)。
1551715641*
1551815642* **示例代码**
1551915643*
@@ -15538,7 +15662,10 @@ wx.getGroupEnterInfo({
1553815662*
1553915663* ```json
1554015664{
15541- "opengid": "OPENGID"
15665+ "opengid": "OPENGID", // 多聊群下返回的群唯一标识
15666+ "open_single_roomid": "", // 单聊群下返回的群唯一标识
15667+ "group_openid": "", // 用户在当前群的唯一标识
15668+ "chat_type": 3, // 聊天室类型
1554215669}
1554315670```
1554415671*
@@ -18024,7 +18151,7 @@ wx.openCustomerServiceChat({
1802418151 *
1802518152 * 需要基础库: `2.0.3`
1802618153 *
18027- * 进入客服会话。要求在用户发生过至少一次 touch 事件后才能调用。后台接入方式与小程序一致,详见 [客服消息接入](# )
18154+ * 进入客服会话。要求在用户发生过至少一次 touch 事件后才能调用。后台接入方式与小程序一致,详见 [客服消息接入](https://developers.weixin.qq.com/minigame/dev/guide/open-ability/customer-message/customer-message.html )
1802818155 *
1802918156 * **注意事项**
1803018157 *
@@ -19118,12 +19245,7 @@ wx.showModal({
1911819245 *
1911919246 * 需要基础库: `2.14.3`
1912019247 *
19121- * 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载
19122- *
19123- * **Bug & Tip**
19124- *
19125- * 1. `tip`: `needShowEntrance`分享的图片消息是否要带小程序入口,支持申明类目:商家自营、电商平台、餐饮服务(餐饮服务场所/餐饮服务管理企业、点餐平台、外卖平台)、旅游服务(住宿服务、景区服务、OTA、旅游管理单位)、生活服务(家政服务、丽人服务、宠物(非医院类)、婚庆服务、洗浴保健、休闲娱乐、百货/超市/便利店、开锁服务、营业性演出票务、其他宠物健康服务、洗浴保健平台、共享服务、跑腿、寄存、求职/招聘)
19126- * 2. `tip`: `needShowEntrance`小游戏所有类目都支持 */
19248+ * 打开分享图片弹窗,可以将图片发送给朋友、收藏或下载 */
1912719249 showShareImageMenu<
1912819250 T extends ShowShareImageMenuOption = ShowShareImageMenuOption
1912919251 >(
0 commit comments