UNPKG

@formatjs/intl-pluralrules

Version:
24 lines (23 loc) 1.41 kB
import { type LDMLPluralRule, type PluralRulesInternal } from "@formatjs/ecma402-abstract"; import type Decimal from "decimal.js"; import { type OperandsRecord } from "./GetOperands.js"; /** * ResolvePluralRange ( pluralRules, x, y ) * * The ResolvePluralRange abstract operation is called with arguments pluralRules (which must be * an object initialized as a PluralRules), x (a mathematical value), and y (a mathematical value). * It resolves the appropriate plural form for a range by determining the plural forms of both the * start and end values, then consulting locale-specific range data. * * Specification: https://tc39.es/ecma402/#sec-resolvepluralrange * * @param pluralRules - An initialized PluralRules object * @param x - Mathematical value for the range start * @param y - Mathematical value for the range end * @returns The plural category for the range (zero, one, two, few, many, or other) */ export declare function ResolvePluralRange(pluralRules: Intl.PluralRules, x: Decimal, y: Decimal, { getInternalSlots, PluralRuleSelect, PluralRuleSelectRange }: { getInternalSlots(pl: Intl.PluralRules): PluralRulesInternal; PluralRuleSelect: (locale: string, type: "cardinal" | "ordinal", n: Decimal, operands: OperandsRecord) => LDMLPluralRule; PluralRuleSelectRange: (locale: string, type: "cardinal" | "ordinal", xp: LDMLPluralRule, yp: LDMLPluralRule) => LDMLPluralRule; }): LDMLPluralRule;