Interface ListFormat
interface ListFormat {
format(list: Iterable<string>): string;
formatToParts(
list: Iterable<string>,
): { type: "literal" | "element"; value: string }[];
resolvedOptions(): ResolvedListFormatOptions;
}
format(list: Iterable<string>): string;
formatToParts(
list: Iterable<string>,
): { type: "literal" | "element"; value: string }[];
resolvedOptions(): ResolvedListFormatOptions;
}
Index
Methods
Methods
format
formatToParts
- formatToParts(
list: Iterable<string>,
): { type: "literal" | "element"; value: string }[] Returns an Array of objects representing the different components that can be used to format a list of values in a locale-aware fashion.
Parameters
Returns { type: "literal" | "element"; value: string }[]
An Array of components which contains the formatted parts from the list.
MDN.
resolvedOptions
- resolvedOptions(): ResolvedListFormatOptions
Returns a new object with properties reflecting the locale and style formatting options computed during the construction of the current
Intl.ListFormat
object.MDN.
Returns ResolvedListFormatOptions
Returns a string with a language-specific representation of the list.