Interface ListFormat
interface ListFormat {
format(list: Iterable<string, any, any>): string;
formatToParts(list: Iterable<string, any, any>): {
type: "literal" | "element";
value: string;
}[];
resolvedOptions(): ResolvedListFormatOptions;
}
format(list: Iterable<string, any, any>): string;
formatToParts(list: Iterable<string, any, any>): {
type: "literal" | "element";
value: string;
}[];
resolvedOptions(): ResolvedListFormatOptions;
}
Index
Methods
Methods
format
- format(list): string
Returns string
A language-specific formatted string representing the elements of the list.
MDN.
formatToParts
- format
To (list): {Parts
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
- resolved
Options (): 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.