summaryrefslogtreecommitdiff
path: root/src/types/TranslationsDictionary.d.ts
blob: 5033ecd72d295b1a56292dc82f7b1e2ad3338c7f (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> = {
  readonly [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]>;
  };
};