Skip to content

Commit

Permalink
feat(typings): support readonly namespaces in TFuncKey (#1340)
Browse files Browse the repository at this point in the history
  • Loading branch information
belgattitude committed Jul 14, 2021
1 parent 4f5ee74 commit ddb3ea6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ts4.1/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,9 @@ type NormalizeMultiReturn<T, V> = V extends `${infer N}:${infer R}`
: never
: never;

export type TFuncKey<
N extends Namespace = DefaultNamespace,
T = DefaultResources
> = N extends (keyof T)[]
export type TFuncKey<N extends Namespace = DefaultNamespace, T = DefaultResources> = N extends
| (keyof T)[]
| Readonly<(keyof T)[]>
? NormalizeMulti<T, N[number]>
: N extends keyof T
? Normalize<T[N]>
Expand Down

0 comments on commit ddb3ea6

Please sign in to comment.