mirror of
https://github.com/hexastack/hexabot
synced 2024-11-24 13:05:15 +00:00
feat(frontend): add intersection between available translation types
This commit is contained in:
parent
8b0b388c0d
commit
43e0f53a3b
@ -12,10 +12,12 @@ import { translations } from ".";
|
||||
|
||||
import { TFilterNestedKeysOfType } from "@/types/common/object.types";
|
||||
|
||||
export type TTranslation =
|
||||
| (typeof translations)["en"]
|
||||
| (typeof translations)["fr"];
|
||||
export type TTranslationKeys = TFilterNestedKeysOfType<TTranslation>;
|
||||
type TEnTranslation = (typeof translations)["en"];
|
||||
type TFrTranslation = (typeof translations)["fr"];
|
||||
|
||||
export type TTranslation = TEnTranslation & TFrTranslation;
|
||||
export type TTranslationKeys = TFilterNestedKeysOfType<TEnTranslation> &
|
||||
TFilterNestedKeysOfType<TFrTranslation>;
|
||||
|
||||
export type TNestedTranslation<T extends keyof TTranslation> =
|
||||
TFilterNestedKeysOfType<TTranslation[T]>;
|
||||
|
Loading…
Reference in New Issue
Block a user