import type { Language, Translation } from "./types.js"; export declare const translations: Record; export type { Language, Translation } from "./types.js"; export { en } from "./en.js"; export { no } from "./no.js"; export * from "./LocalizationProvider.js"; /** * Translation utility function, convenient in functions that are **not** React components or hooks, * e.g. validation steps, where the language will be supplied at render time. * * For use in components or hooks, it's easier to use {@link useTranslation}. * @param selector Select the wanted translation from the translations object * @returns A function which accepts a language and returns the wanted translation */ export declare function translate(selector: (translation: Translation) => T): (lang: Language) => T; /** * Utility function to reduce the need for repeating the same path in multiple {@link translate} selectors. * Convenient when you need several texts from a specific slice of the translations. * * For use in components or hooks, it's easier to use {@link useTranslation}. * @param selectSlice Select the wanted slice of the translation object * @returns A {@link translate} function which operates on the wanted slice of the translations object */ export declare const sliceTranslate: (selectSlice: (translation: Translation) => S) => (selector: (slice: S) => T) => (lang: Language) => T; /** * Returns the whole translations object for the currently active language. * * For translations outside of components or hooks, see {@link translate}. */ export declare function useTranslation(): Translation; /** * Returns the wanted translation slice for the currently active language. * @param selectSlice Select the wanted slice of the translations object * * For translations outside of components or hooks, see {@link sliceTranslate}. */ export declare function useTranslation(selectSlice: (translation: Translation) => S): S; //# sourceMappingURL=index.d.ts.map