Skip to content

API reference / @localizer/format-list / ListFormatOptions

Type Alias: ListFormatOptions

ListFormatOptions = { localeMatcher?: "lookup" | "best fit"; style?: "long" | "short" | "narrow"; type?: "conjunction" | "disjunction" | "unit"; } | { delimiter: Localizable; }

Defined in: options.ts:31

Options for formatting a list of localized values.

Supports two modes:

  • Intl.ListFormatOptions: Options for Intl.ListFormat API, including locale matching, format, and length.
  • Delimiter-based formatting: Uses a localized delimiter to join list items.

Includes an optional transform property for applying transformations.

Type declaration

{ localeMatcher?: "lookup" | "best fit"; style?: "long" | "short" | "narrow"; type?: "conjunction" | "disjunction" | "unit"; }

NameTypeDescription
localeMatcher?"lookup" | "best fit"Locale matching algorithm.
style?"long" | "short" | "narrow"Length of the formatted message.
type?"conjunction" | "disjunction" | "unit"Output message format.

{ delimiter: Localizable; }

NameTypeDescription
delimiterLocalizableLocalized delimiter for joining list items.