@formatjs/intl-pluralrules 6.3.13 → 6.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -12,7 +12,9 @@ interface PluralRangesData {
12
12
  cardinal?: Record<string, LDMLPluralRule>;
13
13
  ordinal?: Record<string, LDMLPluralRule>;
14
14
  }
15
+ type CompactExponentData = Record<"short" | "long", Record<number, number>>;
15
16
  interface PluralRulesData {
17
+ compactExponents?: CompactExponentData;
16
18
  categories: {
17
19
  cardinal: string[];
18
20
  ordinal: string[];
@@ -49,7 +51,7 @@ type TrailingZeroDisplay = "auto" | "stripIfInteger";
49
51
  * ECMA-402 Spec: selectRange method (Intl.PluralRules.prototype.selectRange)
50
52
  * https://tc39.es/ecma402/#sec-intl.pluralrules.prototype.selectrange
51
53
  *
52
- * Extension: notation and compactDisplay options (not in ECMA-402 spec)
54
+ * ECMA-402 notation and compactDisplay options
53
55
  * Mirrors Intl.NumberFormat notation option for proper plural selection with compact numbers
54
56
  */
55
57
  declare global {
@@ -58,20 +60,20 @@ declare global {
58
60
  selectRange(start: number | bigint, end: number | bigint): LDMLPluralRule;
59
61
  }
60
62
  interface PluralRulesOptions {
61
- notation?: "standard" | "compact";
63
+ notation?: "standard" | "scientific" | "engineering" | "compact";
62
64
  compactDisplay?: "short" | "long";
63
65
  }
64
66
  }
65
67
  }
66
- interface PluralRulesInternal extends NumberFormatDigitInternalSlots {
68
+ export interface PluralRulesInternal extends NumberFormatDigitInternalSlots {
67
69
  initializedPluralRules: boolean;
68
70
  locale: string;
69
71
  type: "cardinal" | "ordinal";
70
- notation: "standard" | "compact";
72
+ notation: "standard" | "scientific" | "engineering" | "compact";
71
73
  compactDisplay?: "short" | "long";
72
- dataLocaleData?: any;
74
+ compactExponents?: CompactExponentData;
73
75
  }
74
- declare class PluralRules {
76
+ export declare class PluralRules {
75
77
  constructor(locales?: string | string[], options?: Intl.PluralRulesOptions);
76
78
  resolvedOptions(): Intl.ResolvedPluralRulesOptions;
77
79
  select(val: number | bigint): LDMLPluralRule;
@@ -103,7 +105,7 @@ declare class PluralRules {
103
105
  * pr.selectRange(BigInt(1), BigInt(2)); // "other"
104
106
  *
105
107
  * @throws {TypeError} If start or end is undefined
106
- * @throws {RangeError} If start or end is not a finite number (Infinity, NaN)
108
+ * @throws {RangeError} If start or end converts to NaN
107
109
  *
108
110
  * @note Chrome's native implementation (as of early 2025) has a bug where it throws
109
111
  * "Cannot convert a BigInt value to a number" when using BigInt arguments. This is
@@ -121,5 +123,4 @@ declare class PluralRules {
121
123
  static polyfilled: boolean;
122
124
  }
123
125
  //#endregion
124
- export { PluralRules, PluralRulesInternal };
125
126
  //# sourceMappingURL=index.d.ts.map