Skip to main content Link Search Menu Expand Document (external link)

getFluentRuntime() function

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Build a MessageFormat runtime to use with Fluent messages.


export declare function getFluentRuntime(res: Map<string, MessageFormat>): {
    DATETIME: RuntimeFunction<import("messageformat").MessageDateTime>;
    MESSAGE: RuntimeFunction<ResolvedMessage>;
    NUMBER: RuntimeFunction<import("messageformat").MessageNumber>;


Parameter Type Description
res Map<string, MessageFormat> A Map of MessageFormat instances, for use by MESSAGE. This Map may be passed in as initially empty, and later filled out by the caller.


{ DATETIME: RuntimeFunction<import(“messageformat”).MessageDateTime>; MESSAGE: RuntimeFunction<ResolvedMessage>; NUMBER: RuntimeFunction<import(“messageformat”).MessageNumber>; }


This builds on top of the default runtime, but uses all-caps names for the DATETIME and NUMBER message formatters. A custom function MESSAGE is also included to support Fluent term and message references.