type FarmI18nRouting = "prefix-always" | "prefix-except-default" | "none"; type FarmI18nDetectionSignal = "url" | "cookie" | "accept-language"; type FarmI18nLocaleSource = FarmI18nDetectionSignal | "default" | "explicit"; type FarmI18nDirection = "ltr" | "rtl"; interface FarmI18nCookieConfig { name?: string; maxAge?: number; path?: string; sameSite?: "lax" | "strict" | "none"; secure?: boolean; } interface FarmI18nUserConfig { locales: readonly string[]; defaultLocale: string; /** Directory containing `.json`, or a path containing `{locale}`. */ messages?: string; routing?: FarmI18nRouting; detection?: false | readonly FarmI18nDetectionSignal[]; fallbackLocale?: string; strict?: boolean; cookie?: FarmI18nCookieConfig; direction?: Partial>; /** @deprecated Use `detection: false` to disable automatic detection. */ localeDetection?: boolean; } interface ResolvedFarmI18nCookieConfig { name: string; maxAge: number; path: string; sameSite: "lax" | "strict" | "none"; secure: boolean; } interface ResolvedFarmI18nConfig { enabled: boolean; /** Normalized public pathname where the application is mounted. */ basePath: string; locales: readonly string[]; defaultLocale: string; messages: string; routing: FarmI18nRouting; detection: readonly FarmI18nDetectionSignal[]; fallbackLocale: string; strict: boolean; cookie: ResolvedFarmI18nCookieConfig; direction: Readonly>; } type FarmI18nCatalog = Record; type FarmI18nCatalogs = Record; interface FarmI18nClientSnapshot { locale: string; source: FarmI18nLocaleSource; locales: readonly string[]; defaultLocale: string; routing: FarmI18nRouting; /** Public application mount path. Optional for compatibility with older snapshots. */ basePath?: string; cookie: ResolvedFarmI18nCookieConfig; direction: FarmI18nDirection; messages: FarmI18nCatalog; } /** The generated `farm.d.ts` file augments this interface. */ interface FarmI18nMessageRegistry { } /** The generated `farm.d.ts` file augments this interface. */ interface FarmI18nLocaleRegistry { } type RegisteredMessageKey = Extract; type RegisteredLocale = Extract; type FarmI18nMessageKey = [RegisteredMessageKey] extends [never] ? string : RegisteredMessageKey; type FarmI18nLocale = [RegisteredLocale] extends [never] ? string : RegisteredLocale; type FarmI18nMessageValues = TKey extends RegisteredMessageKey ? FarmI18nMessageRegistry[TKey] : Record; type FarmI18nMessageArgs = TKey extends RegisteredMessageKey ? keyof FarmI18nMessageRegistry[TKey] extends never ? [values?: FarmI18nMessageRegistry[TKey]] : [values: FarmI18nMessageRegistry[TKey]] : [values?: Record]; interface FarmTranslator { (key: TKey, ...args: FarmI18nMessageArgs): string; rich(key: TKey, ...args: FarmI18nMessageArgs): unknown; raw(key: TKey): string; has(key: string): boolean; } declare global { interface Window { __FARM_I18N__?: FarmI18nClientSnapshot; } } export type { FarmI18nClientSnapshot as F, ResolvedFarmI18nConfig as R, FarmTranslator as a, FarmI18nLocale as b, FarmI18nCatalogs as c, FarmI18nLocaleSource as d, FarmI18nMessageArgs as e, FarmI18nMessageKey as f, FarmI18nCookieConfig as g, FarmI18nDetectionSignal as h, FarmI18nDirection as i, FarmI18nRouting as j, FarmI18nUserConfig as k, FarmI18nCatalog as l, FarmI18nLocaleRegistry as m, FarmI18nMessageRegistry as n, FarmI18nMessageValues as o };