Skip to content

Commit 0080a92

Browse files
committed
fix(page): Autocomplete IShareOption 'from' field
1 parent 1cc8ccb commit 0080a92

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

test/page.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Page({
8383
onUnload() {},
8484
onPullDownRefresh() {},
8585
onShareAppMessage(res) {
86-
expectType<string>(res.from)
86+
expectType<'button' | 'menu' | (string & {})>(res.from)
8787
if (res.from === 'button') {
8888
expectType<string | undefined>(res.webViewUrl)
8989
}

types/wx/lib.wx.page.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ declare namespace WechatMiniprogram.Page {
199199
*
200200
* 最低基础库: `1.2.4`
201201
*/
202-
from: 'button' | 'menu' | string
202+
from: 'button' | 'menu' | (string & {})
203203
/** 如果 `from` 值是 `button`,则 `target` 是触发这次转发事件的 `button`,否则为 `undefined`
204204
*
205205
* 最低基础库: `1.2.4` */

0 commit comments

Comments
 (0)