Skip to content

Commit

Permalink
feat: fix return type for plural forms
Browse files Browse the repository at this point in the history
  • Loading branch information
itwillwork committed Nov 13, 2024
1 parent af05ca2 commit e99c589
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,17 +78,17 @@ export type StrictTypedParamsI18NFn<T = any> = {
keysetName: K,
key: G | NoEnumLikeStringLiteral<S>,
params?: StrictTypedParams<T[K][G]>,
): S extends G ? T[K][G] : string;
): string;
keyset<K extends keyof T>(
keysetName: K,
): <G extends keyof T[K], S extends string>(
key: G | NoEnumLikeStringLiteral<S>,
params?: StrictTypedParams<T[K][G]>,
) => S extends G ? T[K][G] : string;
) => string;
i18n<K extends keyof T, G extends keyof T[K], S extends string>(
keysetName: K,
key: G | NoEnumLikeStringLiteral<S>,
): () => S extends G ? T[K][G] : string;
): () => string;
has<K extends keyof T>(
keysetName: K,
key: string
Expand All @@ -99,25 +99,25 @@ export type StrictTypedParamsI18NFn<T = any> = {
keysetName: K,
key: G | NoEnumLikeStringLiteral<S>,
params?: StrictTypedParams<T[K][G]>,
) => S extends G ? T[K][G] : string;
) => string;
bind<K extends keyof T>(
thisArg: any,
keysetName: K,
): <G extends keyof T[K], S extends string>(
key: G | NoEnumLikeStringLiteral<S>,
params?: StrictTypedParams<T[K][G]>,
) => S extends G ? T[K][G] : string;
) => string;
bind<K extends keyof T, G extends keyof T[K], S extends string>(
thisArg: any,
keysetName: K,
key: G | NoEnumLikeStringLiteral<S>,
): (params?: StrictTypedParams<T[K][G]>) => S extends G ? T[K][G] : string;
): (params?: StrictTypedParams<T[K][G]>) => string;
bind<K extends keyof T, G extends keyof T[K], S extends string>(
thisArg: any,
keysetName: K,
key: G | NoEnumLikeStringLiteral<S>,
params?: StrictTypedParams<T[K][G]>,
): () => S extends G ? T[K][G] : string;
): () => string;
};

export type Params = {[key: string]: any};
Expand Down

0 comments on commit e99c589

Please sign in to comment.