UNPKG

@bemedev/i18n

Version:

Internationalization library for Bemedev projects, providing utilities for managing translations and locale-specific content.

16 lines 1.09 kB
import { defineTranslation } from './helpers'; import { infer18, type LanguageMessages, type RequiredTranslations, type Simple18, type Translate_F2 } from './types'; /** * Creates a translation object from a function or object. * Utility helper to create type-safe translations that match a root config. * * @param func - A function that receives defineTranslation or a plain translation object * @param _ - Optional root config for type inference (not used at runtime) * @returns The resolved translation object */ export declare const translation: { <const R extends LanguageMessages>(func: ((define: typeof defineTranslation) => R) | R, locale?: string): Translate_F2<R>; derived<const R extends LanguageMessages>(func: ((define: typeof defineTranslation) => RequiredTranslations<R>) | RequiredTranslations<R>, locale?: string): Translate_F2<RequiredTranslations<R>>; fromMachine<const T extends Simple18>(func: ((define: typeof defineTranslation) => infer18<T>) | infer18<T>, locale?: string): Translate_F2<infer18<T>>; }; //# sourceMappingURL=translation.d.ts.map