From 5d63f61298b433edbeca8c18f454fc3f6e0541f5 Mon Sep 17 00:00:00 2001 From: Job Date: Mon, 5 Oct 2020 21:53:03 +0200 Subject: [PATCH 1/3] Add conditional return type for Clients.matchAll When specifically querying for clients of type window, return the specific WindowClient type. --- baselines/webworker.generated.d.ts | 2 +- inputfiles/overridingTypes.json | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index f24219da5..418563b9c 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -900,7 +900,7 @@ declare var Client: { interface Clients { claim(): Promise; get(id: string): Promise; - matchAll(options?: ClientQueryOptions): Promise>; + matchAll(options?: T): Promise>; openWindow(url: string): Promise; } diff --git a/inputfiles/overridingTypes.json b/inputfiles/overridingTypes.json index f77363efc..bdb10306e 100644 --- a/inputfiles/overridingTypes.json +++ b/inputfiles/overridingTypes.json @@ -2563,6 +2563,11 @@ "override-signatures": [ "get(id: string): Promise" ] + }, + "matchAll": { + "override-signatures": [ + "matchAll(options?: T): Promise>" + ] } } } From 48d0918ca9f36858788c33ec72bc135c2657f801 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 11 Dec 2020 11:19:22 -0800 Subject: [PATCH 2/3] Update baselines/webworker.generated.d.ts Use narrower `extends` test in conditional type. --- baselines/webworker.generated.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baselines/webworker.generated.d.ts b/baselines/webworker.generated.d.ts index 418563b9c..42ab59520 100644 --- a/baselines/webworker.generated.d.ts +++ b/baselines/webworker.generated.d.ts @@ -900,7 +900,7 @@ declare var Client: { interface Clients { claim(): Promise; get(id: string): Promise; - matchAll(options?: T): Promise>; + matchAll(options?: T): Promise>; openWindow(url: string): Promise; } From 0f803746b95b235e633c59bcc2a689a99966b29c Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Fri, 11 Dec 2020 11:20:17 -0800 Subject: [PATCH 3/3] Update inputfiles/overridingTypes.json Add missed source JSON update --- inputfiles/overridingTypes.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inputfiles/overridingTypes.json b/inputfiles/overridingTypes.json index bdb10306e..8c1f836ae 100644 --- a/inputfiles/overridingTypes.json +++ b/inputfiles/overridingTypes.json @@ -2566,7 +2566,7 @@ }, "matchAll": { "override-signatures": [ - "matchAll(options?: T): Promise>" + "matchAll(options?: T): Promise>" ] } }