From e0c5ec43f5c2a105dc3c626d7c4bc74b512662f4 Mon Sep 17 00:00:00 2001 From: Joe Carstairs <65492573+Sycamost@users.noreply.github.com> Date: Sat, 12 Aug 2023 17:22:33 +0100 Subject: Parameterises translation --- src/types/TranslationsDictionary.d.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/types/TranslationsDictionary.d.ts') diff --git a/src/types/TranslationsDictionary.d.ts b/src/types/TranslationsDictionary.d.ts index 5a8a251..d62947c 100644 --- a/src/types/TranslationsDictionary.d.ts +++ b/src/types/TranslationsDictionary.d.ts @@ -1,6 +1,12 @@ import type { defaultLocale } from '../i18n/locales'; import type Locale from './Locale'; -type TranslationsDictionary = { - [key in Keys]: { [key in Locale]?: string } & { [key in typeof defaultLocale]: string }; +export type Translation = (params: { [key in keyof Params]: string }) => string; + +export type TranslationsDictionary = { + [key in keyof Raw]: { + [locale in Locale]?: Translation[0]>; + } & { + [locale in typeof defaultLocale]: Translation[0]>; + }; }; -- cgit v1.2.3