[Go to site: main page, start]

DefaultFunctions: {
    integer: (
        ctx: MessageFunctionContext,
        exprOpt: Record<string, unknown>,
        operand?: unknown,
    ) => MessageNumber;
    number: (
        ctx: MessageFunctionContext,
        exprOpt: Record<string, unknown>,
        operand?: unknown,
    ) => MessageNumber;
    offset: (
        ctx: MessageFunctionContext,
        exprOpt: Record<string | symbol, unknown>,
        operand?: unknown,
    ) => MessageNumber;
    string: (
        ctx: Pick<MessageFunctionContext, "dir" | "locales">,
        _options: Record<string, unknown>,
        operand?: unknown,
    ) => MessageString;
} = ...

Functions classified as REQUIRED by the LDML 48 MessageFormat specification.

Type Declaration

  • integer: (
        ctx: MessageFunctionContext,
        exprOpt: Record<string, unknown>,
        operand?: unknown,
    ) => MessageNumber

    Supports formatting and selection as defined in LDML 48 for the :integer function.

    The operand must be a number, BigInt, or string representing a JSON number, or an object wrapping such a value, with a valueOf() accessor and an optional options object.

  • number: (
        ctx: MessageFunctionContext,
        exprOpt: Record<string, unknown>,
        operand?: unknown,
    ) => MessageNumber

    Supports formatting and selection as defined in LDML 48 for the :number function.

    The operand must be a number, BigInt, or string representing a JSON number, or an object wrapping such a value, with a valueOf() accessor and an optional options object.

  • offset: (
        ctx: MessageFunctionContext,
        exprOpt: Record<string | symbol, unknown>,
        operand?: unknown,
    ) => MessageNumber

    Supports formatting and selection as defined in LDML 48 for the :offset function.

    The operand must be a number, BigInt, or string representing a JSON number, or an object wrapping such a value, with a valueOf() accessor and an optional options object.

  • string: (
        ctx: Pick<MessageFunctionContext, "dir" | "locales">,
        _options: Record<string, unknown>,
        operand?: unknown,
    ) => MessageString

    Supports formatting and selection as defined in LDML 48 for the :string function.

    The operand must be a stringifiable value. An undefined value is resolved as an empty string.