wuchale
Version:
Protobuf-like i18n from normal code
23 lines • 872 B
TypeScript
import type { Mixed, CompiledElement } from "./compile.js";
type PluralsRule = (n: number) => number;
export declare const catalogVarName: "c";
export type CatalogModule = {
[catalogVarName]: CompiledElement[];
p: PluralsRule;
onUpdate?: (callback: (newData: CompiledElement[]) => void) => void;
};
export declare const defaultPluralsRule: PluralsRule;
export declare class Runtime {
_: CatalogModule;
constructor(module?: CatalogModule);
/** get composite context */
cx: (id: number) => Mixed | import("./compile.js").Composite;
/** get translation using composite context */
tx: (ctx: Mixed, args?: any[], start?: number) => string;
/** get translation for plural */
tp: (id: number) => CompiledElement;
/** get translation */
t: (id: number, args?: any[]) => string;
}
export {};
//# sourceMappingURL=runtime.d.ts.map