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

SelectMessage interface

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.

SelectMessage generalises the plural, selectordinal and select argument types of MessageFormat 1. Each case is defined by a key of one or more string identifiers, and selection between them is made according to the values of a corresponding number of placeholders. Selection iterates among the variants in order, and terminates when all of the Variant keys match. The result of the selection is always a single Pattern.

Signature:

export interface SelectMessage 

Properties

Property Modifiers Type Description
comment?   string (BETA) (Optional)
declarations   Declaration[] (BETA)
errors?   ParseError[] (BETA) (Optional)
selectors   PatternElement[] (BETA)
type   ‘select’ (BETA)
variants   Variant[] (BETA)