Skip to content

Commit 5d63f61

Browse files
committed
Add conditional return type for Clients.matchAll
When specifically querying for clients of type window, return the specific WindowClient type.
1 parent 469ba81 commit 5d63f61

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

baselines/webworker.generated.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ declare var Client: {
900900
interface Clients {
901901
claim(): Promise<void>;
902902
get(id: string): Promise<Client | undefined>;
903-
matchAll(options?: ClientQueryOptions): Promise<ReadonlyArray<Client>>;
903+
matchAll<T extends ClientQueryOptions>(options?: T): Promise<ReadonlyArray<T extends { type: "window" } ? WindowClient : Client>>;
904904
openWindow(url: string): Promise<WindowClient | null>;
905905
}
906906

inputfiles/overridingTypes.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2563,6 +2563,11 @@
25632563
"override-signatures": [
25642564
"get(id: string): Promise<Client | undefined>"
25652565
]
2566+
},
2567+
"matchAll": {
2568+
"override-signatures": [
2569+
"matchAll<T extends ClientQueryOptions>(options?: T): Promise<ReadonlyArray<T extends { type: \"window\" } ? WindowClient : Client>>"
2570+
]
25662571
}
25672572
}
25682573
}

0 commit comments

Comments
 (0)