From 8b64fb31e8840e078a9603ceb2f110e725c55584 Mon Sep 17 00:00:00 2001 From: xlfsummer <20750969+xlfsummer@users.noreply.github.com> Date: Thu, 27 May 2021 20:35:08 +0800 Subject: [PATCH 1/5] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=20Methods=20=E6=B3=9B=E5=9E=8B=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/global.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/global.d.ts b/types/global.d.ts index badd06a..763367e 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -15,7 +15,7 @@ declare function getApp(): tinyapp.IGetAppResult; * 接受一个 object 参数,其指定页面的初始数据、生命周期函数、事件处理函数等。 */ /* tslint:disable:no-unnecessary-generics */ -declare function Page(options: tinyapp.PageOptions): void; +declare function Page(options: tinyapp.PageOptions): void; /* tslint:enable:no-unnecessary-generics */ /** From 6c0ab77fc0eb53e1bc57c75cef7cdf6a0594b516 Mon Sep 17 00:00:00 2001 From: xlfsummer <20750969+xlfsummer@users.noreply.github.com> Date: Thu, 27 May 2021 20:37:41 +0800 Subject: [PATCH 2/5] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=20Methods=20=E6=B3=9B=E5=9E=8B=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/page.d.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/types/page.d.ts b/types/page.d.ts index 21ba6a3..f4c5362 100644 --- a/types/page.d.ts +++ b/types/page.d.ts @@ -115,7 +115,7 @@ declare namespace tinyapp { type SpliceDataMethod = (operations: ISpliceDataOperations, callback?: () => void) => void; - interface IPageInstance extends Record { + type IPageInstance = M & { /** * 页面数据。 */ @@ -145,7 +145,7 @@ declare namespace tinyapp { /** * Page 实现的接口对象 */ - type PageOptions> = IPageOptionsMethods + type PageOptions, M = Record> = IPageOptionsMethods & { /** * 初始数据或返回初始化数据的函数, 为对象时所有页面共享。 @@ -155,9 +155,10 @@ declare namespace tinyapp { /** * 事件处理函数集合。 */ - events?: IPageEvents & ThisType>; + events?: IPageEvents & ThisType>; [name: string]: any; } - & ThisType>; + & M + & ThisType>; } From 89038c6f5dee5de637f41d3cdb4d5ce01db51096 Mon Sep 17 00:00:00 2001 From: xlfsummer <20750969+xlfsummer@users.noreply.github.com> Date: Thu, 27 May 2021 20:38:43 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=9A=84=20any=20Record?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/page.d.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/types/page.d.ts b/types/page.d.ts index f4c5362..dc69dff 100644 --- a/types/page.d.ts +++ b/types/page.d.ts @@ -156,8 +156,6 @@ declare namespace tinyapp { * 事件处理函数集合。 */ events?: IPageEvents & ThisType>; - - [name: string]: any; } & M & ThisType>; From 460c0e1c044a491ff59b772813a03ca8b1f02eff Mon Sep 17 00:00:00 2001 From: xlfsummer <20750969+xlfsummer@users.noreply.github.com> Date: Thu, 27 May 2021 20:40:08 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BC=BA=E5=B0=91?= =?UTF-8?q?=E6=B3=9B=E5=9E=8B=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/global.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/global.d.ts b/types/global.d.ts index 763367e..d4d2be7 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -22,7 +22,7 @@ declare function Page(options: tinyapp.PageOptions): void; * getCurrentPages() 函数用于获取当前页面栈的实例, * 以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。 */ -declare function getCurrentPages(): Array>; +declare function getCurrentPages(): Array>; /* tslint:disable:no-unnecessary-generics */ declare function Component( From 50b29a366156e9039ddabd8c4c99533e6efc7813 Mon Sep 17 00:00:00 2001 From: xlfsummer <20750969+xlfsummer@users.noreply.github.com> Date: Thu, 27 May 2021 20:41:59 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=20getCurrentPages?= =?UTF-8?q?=20=E8=BF=94=E5=9B=9E=20any?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/global.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/global.d.ts b/types/global.d.ts index d4d2be7..3b0d74d 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -22,7 +22,7 @@ declare function Page(options: tinyapp.PageOptions): void; * getCurrentPages() 函数用于获取当前页面栈的实例, * 以数组形式按栈的顺序给出,第一个元素为首页,最后一个元素为当前页面。 */ -declare function getCurrentPages(): Array>; +declare function getCurrentPages(): Array>; /* tslint:disable:no-unnecessary-generics */ declare function Component(