import type { TranslationMessages, Translations } from './types'; /** * Load translations from a directory */ export declare function loadFromDirectory(options: LoaderOptions): Promise; /** * Load a single translation file */ export declare function loadFile(filePath: string): Promise; /** * Load a single locale from a file or directory */ export declare function loadLocale(locale: string, path: string): Promise; /** * Create a translation loader for a specific directory */ export declare function createLoader(directory: string, options?: Partial>): { load: () => unknown; loadLocale: (locale: string, filename: string) => unknown }; /** * Load translations via `@stacksjs/ts-i18n` and register them with the * global translator. This is the recommended path for new projects — * it gets you: * * - Per-locale subdirectory namespacing (en/auth.yaml → en.auth.*) * - First-class .ts/.json/.yaml support with consistent error * messages * - Optional `.d.ts` codegen via `generateI18nTypes()` so message * keys autocomplete in `t('…')` calls * * The legacy `loadFromDirectory()` remains for projects that depend * on its specific behavior; new code should prefer this entry. * * @example * ```ts * await loadFromTsI18n({ * translationsDir: path.userI18nPath(), * defaultLocale: 'en', * fallbackLocale: 'en', * sources: ['yaml', 'ts', 'json'], * optional: true, * }) * ``` */ export declare function loadFromTsI18n(config: import('@stacksjs/ts-i18n').I18nConfig): Promise; export declare interface LoaderOptions { directory: string extensions?: string[] recursive?: boolean namespaceSeparator?: string }