wuchale
Version:
Protobuf-like i18n from plain code
21 lines (20 loc) • 806 B
TypeScript
import type { Mixed, CompiledElement, CompositePayload } from "./compile.js";
export declare const catalogVarName: "c";
export type CatalogModule = {
[catalogVarName]: CompiledElement[];
p?: (n: number) => number;
update?: Function;
};
declare let onInvalidFunc: (i: number, c: CompiledElement[]) => string;
export declare function onInvalid(newOnInvalid: typeof onInvalidFunc): void;
export type Runtime = {
_: CatalogModule;
l?: string;
cx: (id: number) => Mixed | CompositePayload[];
tx: (ctx: Mixed, args?: any[], start?: number) => string;
tt: (tag: CallableFunction, id: number, args?: any[]) => any;
tp: (id: number) => any;
t: (id: number, args?: any[]) => any;
};
export default function toRuntime(mod?: CatalogModule, locale?: string): Runtime;
export {};