@hi18n/core
Version:
Message internationalization meets immutability and type-safety - core runtime
60 lines • 1.69 kB
TypeScript
export declare type CompiledMessage = string | CompiledMessage[] | VarArg | PluralArg | NumberSign | ElementArg;
export declare type VarArg = StringArg | NumberArg | DateArg | TimeArg | SpelloutArg | OrdinalArg | DurationArg;
export declare type StringArg = {
type: "Var";
name: string | number;
argType?: undefined;
};
export declare type NumberArg = {
type: "Var";
name: string | number;
argType: "number";
argStyle?: "integer" | "currency" | "percent" | undefined;
};
export declare type DateArg = {
type: "Var";
name: string | number;
argType: "date";
argStyle?: "short" | "medium" | "long" | "full" | Intl.DateTimeFormatOptions;
};
export declare type TimeArg = {
type: "Var";
name: string | number;
argType: "time";
argStyle?: "short" | "medium" | "long" | "full";
};
export declare type SpelloutArg = {
type: "Var";
name: string | number;
argType: "spellout";
};
export declare type OrdinalArg = {
type: "Var";
name: string | number;
argType: "ordinal";
};
export declare type DurationArg = {
type: "Var";
name: string | number;
argType: "duration";
};
export declare type PluralArg = {
type: "Plural";
name: string | number;
offset?: number | undefined;
branches: PluralBranch[];
};
export declare type PluralBranch = {
selector: number | string;
message: CompiledMessage;
};
export declare type NumberSign = {
type: "Number";
};
export declare type ArgType = NonNullable<VarArg["argType"]>;
export declare type ElementArg = {
type: "Element";
name: string | number;
message?: CompiledMessage | undefined;
};
//# sourceMappingURL=msgfmt.d.ts.map