From 43e0f53a3bb7a7d89ccf05f314b6caf35709a544 Mon Sep 17 00:00:00 2001 From: yassinedorbozgithub Date: Wed, 2 Oct 2024 05:24:52 +0100 Subject: [PATCH] feat(frontend): add intersection between available translation types --- frontend/src/i18n/i18n.types.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/frontend/src/i18n/i18n.types.ts b/frontend/src/i18n/i18n.types.ts index a9ac772..ad50417 100644 --- a/frontend/src/i18n/i18n.types.ts +++ b/frontend/src/i18n/i18n.types.ts @@ -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; +type TEnTranslation = (typeof translations)["en"]; +type TFrTranslation = (typeof translations)["fr"]; + +export type TTranslation = TEnTranslation & TFrTranslation; +export type TTranslationKeys = TFilterNestedKeysOfType & + TFilterNestedKeysOfType; export type TNestedTranslation = TFilterNestedKeysOfType;