Skip to content

Commit 7da83ca

Browse files
committed
fix: typing of referrerInfo in App#onShow and query in LaunchOptions
1 parent 7c22bf6 commit 7da83ca

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2023-08-24 v3.12.0
2+
- `App` 生命周期 `onLaunch`, `onShow` 参数中的 `referrerInfo` 字段类型对齐 API 定义中的 `ReferrerInfo`。这是一个 **破坏性改动**,其中 `extraData` 的类型从 `any` 收窄到了 `Record<string, any>`
3+
- 根据实际实现,修改了 `LaunchOptions``query` 字段的类型。这是一个 **破坏性改动**,该类型从 `Record<string, any>` 收窄到了 `Record<string, string>`
4+
15
## 2023-08-24 v3.11.1
26
- 更新 API 定义到 3.0.1
37

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6924,7 +6924,7 @@ InnerAudioContext.offWaiting(listener) // 需传入与监听时同一个的函
69246924
/** 启动小程序的路径 (代码包路径) */
69256925
path: string
69266926
/** 启动小程序的 query 参数 */
6927-
query: IAnyObject
6927+
query: Record<string, string>
69286928
/** 来源信息。从另一个小程序、公众号或 App 进入小程序时返回。否则返回 `{}`。(参见后文注意) */
69296929
referrerInfo: ReferrerInfo
69306930
/** 启动小程序的[场景值](https://developers.weixin.qq.com/miniprogram/dev/framework/app-service/scene.html) */
@@ -7938,7 +7938,7 @@ NFCAdapter.offDiscovered(listener) // 需传入与监听时同一个的函数对
79387938
/** 不存在页面的路径 (代码包路径) */
79397939
path: string
79407940
/** 打开不存在页面的 query 参数 */
7941-
query: IAnyObject
7941+
query: Record<string, string>
79427942
}
79437943
interface OnScreenRecordingStateChangedListenerResult {
79447944
/** 录屏状态

types/wx/lib.wx.app.d.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,6 @@ SOFTWARE.
2121
***************************************************************************** */
2222

2323
declare namespace WechatMiniprogram.App {
24-
interface ReferrerInfo {
25-
/** 来源小程序或公众号或App的 appId
26-
*
27-
* 以下场景支持返回 referrerInfo.appId:
28-
* - 1020(公众号 profile 页相关小程序列表): appId
29-
* - 1035(公众号自定义菜单):来源公众号 appId
30-
* - 1036(App 分享消息卡片):来源应用 appId
31-
* - 1037(小程序打开小程序):来源小程序 appId
32-
* - 1038(从另一个小程序返回):来源小程序 appId
33-
* - 1043(公众号模板消息):来源公众号 appId
34-
*/
35-
appId: string
36-
/** 来源小程序传过来的数据,scene=1037或1038时支持 */
37-
extraData?: any
38-
}
39-
4024
type SceneValues =
4125
| 1000
4226
| 1001

0 commit comments

Comments
 (0)