export type TranslationMap = Record<string, Record<string, unknown>>;

export type InterpolationParams = Record<string, string | number>;

export type I18nContextValue = {
  t: (key: string, params?: InterpolationParams) => string;
  locale: string;
};

export type TranslationKeys<T, Prefix extends string = ''> = T extends string
  ? Prefix
  : T extends Record<string, unknown>
    ? {
        [K in keyof T & string]: TranslationKeys<T[K], Prefix extends '' ? K : `${Prefix}.${K}`>;
      }[keyof T & string]
    : never;
