Skip to content

META-27089: formatjs ListFormat def #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions npm/react-intl/3.0/@n4jsd/react-intl/lib/index.n4jsd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,36 @@ export external public interface ~__MessageDescriptor {
public description?: string | Object;
}

/**
* @see https://formatjs.io/docs/react-intl/api#formatlist
*/
export external public interface ~IntlListFormatOptions {
/**
* The locale matching algorithm to use.
* Possible values are "lookup" and "best fit"; the default is "best fit".
* For information about this option, see
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#Locale_negotiation.
*/
public localeMatcher?: 'best fit' | 'lookup';
/**
* The format of output message.
* Possible values are :
* - "conjunction" that stands for "and"-based lists (default, e.g., "A, B, and C")
* - "disjunction" that stands for "or"-based lists (e.g., "A, B, or C").
* - "unit" stands for lists of values with units (e.g., "5 pounds, 12 ounces").
*/
public type?: 'conjunction' | 'disjunction' | 'unit';
/**
* The length of the formatted message.
* Possible values are:
* - "long" (default, e.g., "A, B, and C");
* - "short" (e.g., "A, B, C"), or
* - "narrow" (e.g., "A B C").
* When style is "short" or "narrow", "unit" is the only allowed value for the type option.
*/
public style?: 'long' | 'short' | 'narrow';
}

/**
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RelativeTimeFormat
* without localeMatcher
Expand Down Expand Up @@ -48,6 +78,7 @@ export external public interface ~__IntlFormat {
*/
public formatRelativeTime: (value: number, unit: string=, opts: FormatRelativeTimeOptions=) => string;
public formatNumber: (value: any, options: NumberFormatOptions=) => string;
public formatList: (elements: string[], options: IntlListFormatOptions=) => string;
public formatMessage: (messageDescriptor: __MessageDescriptor, values: Object=) => string;
}

Expand Down