summaryrefslogtreecommitdiff
path: root/src/types
diff options
context:
space:
mode:
Diffstat (limited to 'src/types')
-rw-r--r--src/types/TranslationsDictionary.d.ts10
1 files changed, 8 insertions, 2 deletions
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<Keys> = {
- [key in Keys]: { [key in Locale]?: string } & { [key in typeof defaultLocale]: string };
+export type Translation<Params> = (params: { [key in keyof Params]: string }) => string;
+
+export type TranslationsDictionary<Raw> = {
+ [key in keyof Raw]: {
+ [locale in Locale]?: Translation<Parameters<Raw[key][typeof defaultLocale]>[0]>;
+ } & {
+ [locale in typeof defaultLocale]: Translation<Parameters<Raw[key][typeof defaultLocale]>[0]>;
+ };
};