summaryrefslogtreecommitdiff
path: root/src/types/TranslationsDictionary.d.ts
blob: d62947cb41f5a39386091475dd26170bb9e7076d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import type { defaultLocale } from '../i18n/locales';
import type Locale from './Locale';

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]>;
  };
};