@pagamio/frontend-commons-lib
Version:
Pagamio library for Frontend reusable components like the form engine and table container
25 lines (24 loc) • 779 B
TypeScript
import type React from 'react';
export interface TranslationDictionary {
[key: string]: string | TranslationDictionary;
}
export interface LocaleData {
locale: string;
messages: TranslationDictionary;
}
export interface TranslationContextType {
locale: string;
setLocale: (locale: string) => void;
t: (key: string, defaultValue?: string, variables?: Record<string, any>) => string;
isLoading: boolean;
availableLocales: string[];
}
export interface TranslationProviderProps {
children: React.ReactNode;
defaultLocale?: string;
localeData?: LocaleData[];
loadPath?: string;
}
export type LibTranslationKey = 'changePassword' | 'signOut' | 'search' | 'cancel' | 'submit' | 'save' | (string & {
__brand?: 'LibTranslationKey';
});