type PluralRuleType = "cardinal" | "ordinal";\r
\r
interface PluralRulesOptions {\r
- localeMatcher?: "lookup" | "best fit";\r
- type?: PluralRuleType;\r
- minimumIntegerDigits?: number;\r
- minimumFractionDigits?: number;\r
- maximumFractionDigits?: number;\r
- minimumSignificantDigits?: number;\r
- maximumSignificantDigits?: number;\r
+ localeMatcher?: "lookup" | "best fit" | undefined;\r
+ type?: PluralRuleType | undefined;\r
+ minimumIntegerDigits?: number | undefined;\r
+ minimumFractionDigits?: number | undefined;\r
+ maximumFractionDigits?: number | undefined;\r
+ minimumSignificantDigits?: number | undefined;\r
+ maximumSignificantDigits?: number | undefined;\r
}\r
\r
interface ResolvedPluralRulesOptions {\r
const PluralRules: {\r
new (locales?: string | string[], options?: PluralRulesOptions): PluralRules;\r
(locales?: string | string[], options?: PluralRulesOptions): PluralRules;\r
- supportedLocalesOf(\r
- locales: string | string[],\r
- options?: PluralRulesOptions,\r
- ): string[];\r
+\r
+ supportedLocalesOf(locales: string | string[], options?: { localeMatcher?: "lookup" | "best fit" }): string[];\r
};\r
+\r
+ // We can only have one definition for 'type' in TypeScript, and so you can learn where the keys come from here:\r
+ type ES2018NumberFormatPartType = "literal" | "nan" | "infinity" | "percent" | "integer" | "group" | "decimal" | "fraction" | "plusSign" | "minusSign" | "percentSign" | "currency" | "code" | "symbol" | "name";\r
+ type ES2020NumberFormatPartType = "compact" | "exponentInteger" | "exponentMinusSign" | "exponentSeparator" | "unit" | "unknown";\r
+ type NumberFormatPartTypes = ES2018NumberFormatPartType | ES2020NumberFormatPartType;\r
+\r
+ interface NumberFormatPart {\r
+ type: NumberFormatPartTypes;\r
+ value: string;\r
+ }\r
+\r
+ interface NumberFormat {\r
+ formatToParts(number?: number | bigint): NumberFormatPart[];\r
+ }\r
}\r