Skip to content

Commit

Permalink
remove separate mw.Map#get() overload with selection array and <F>, a…
Browse files Browse the repository at this point in the history
…s it can't be used in the return value

(so, we can't do 'object in which key is keyof V and value is either V[key] or F')
  • Loading branch information
cAttte committed Mar 4, 2021
1 parent adcc61e commit 67c472f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions mw/Map.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ declare global {
* @see https://doc.wikimedia.org/mediawiki-core/master/js/#!/api/mw.Map-method-get
*/
get(): V;
get<S extends Array<keyof V>, F>(
selection: S,
fallback?: F
): Pick<V, S extends Array<infer SS> ? SS : never | F>;
get<S extends Array<keyof V>>(
selection: S
selection: S,
fallback?: any
): Pick<V, S extends Array<infer SS> ? SS : never>;
get<S extends keyof V>(selection: S): V[S];
get<S extends keyof V, F>(selection: S, fallback?: F): V[S] | F;
Expand Down

0 comments on commit 67c472f

Please sign in to comment.