import type { IkasTexts } from "./ikas-texts"; export declare class I18n { private static locale; private static translations; static init(locale: string, translations: Record): void; static getLocale(): string; static setLocale(locale: string): void; static translate(key: string, params?: Record): string; } export declare const i18n: I18n; /** * A code component project's UI texts, key → base text. Empty here: each project fills it in its generated * `src/i18n/index.d.ts`, which makes `t` check its keys and `{{params}}`. */ export interface UiTexts { } type UiTextParams = T extends `${string}{{${infer P}}}${infer R}` ? P | UiTextParams : never; type IkasTextKey = `ikas:${keyof IkasTexts}`; type UiTextKey = IkasTextKey | ([keyof UiTexts] extends [never] ? string : keyof UiTexts); type UiTextOf = K extends `ikas:${infer P}` ? P extends keyof IkasTexts ? IkasTexts[P] : never : K extends keyof UiTexts ? UiTexts[K] : string; type UiTextArgs = [UiTextKey] extends [K] ? [params?: Record] : string extends UiTextOf ? [params?: Record] : [UiTextParams>] extends [never] ? [] : [params: Record>, string | number>]; /** * The project's UI text `key` in the store's language, its `{{param}}`s filled; the key itself when no text has it. * `ikas:` reads the store's common texts instead (`t("ikas:validation.required")`). * Types only: the code component build binds it to the project's own texts (this shared runtime has no `t`). */ export declare function t(key: K & (K extends `ikas:${string}` ? IkasTextKey : unknown), ...[params]: UiTextArgs<[K][K extends unknown ? 0 : never]>): string; export {};