@formatjs/intl-pluralrules

  • Version 7.1.2
  • Published
  • 1.03 MB
  • 2 dependencies
  • MIT license

Install

npm i @formatjs/intl-pluralrules
yarn add @formatjs/intl-pluralrules
pnpm add @formatjs/intl-pluralrules

Overview

Polyfill for Intl.PluralRules

Index

Variables

variable nullClassBase

const nullClassBase: abstract new () => object;

    Classes

    class PluralRules

    class PluralRules extends nullClassBase {}

      constructor

      constructor(locales?: string | string[], options?: Intl.PluralRulesOptions);

        property availableLocales

        static availableLocales: Set<string>;

          property localeData

          static localeData: Record<string, PluralRulesData>;

            property polyfilled

            static polyfilled: boolean;

              property relevantExtensionKeys

              static relevantExtensionKeys: never[];

                method getDefaultLocale

                static getDefaultLocale: () => string;

                  method resolvedOptions

                  resolvedOptions: () => Intl.ResolvedPluralRulesOptions;

                    method select

                    select: (val?: number | bigint | string) => LDMLPluralRule;

                      method selectRange

                      selectRange: (
                      start: number | bigint | string,
                      end: number | bigint | string
                      ) => LDMLPluralRule;

                        method supportedLocalesOf

                        static supportedLocalesOf: (
                        locales?: string | string[],
                        options?: Pick<Intl.PluralRulesOptions, 'localeMatcher'>
                        ) => string[];

                          Interfaces

                          interface PluralRulesInternal

                          interface PluralRulesInternal extends NumberFormatDigitInternalSlots {}

                            property compactDisplay

                            compactDisplay?: 'short' | 'long';

                              property compactExponents

                              compactExponents?: CompactExponentData;

                                property initializedPluralRules

                                initializedPluralRules: boolean;

                                  property locale

                                  locale: string;

                                    property localeData

                                    localeData?: PluralRulesData;

                                      property notation

                                      notation: 'standard' | 'scientific' | 'engineering' | 'compact';

                                        property type

                                        type: 'cardinal' | 'ordinal';

                                          Namespaces

                                          namespace global

                                          namespace global {}
                                          • Type augmentation for Intl.PluralRules

                                            ECMA-402 Spec: selectRange method (Intl.PluralRules.prototype.selectRange) https://tc39.es/ecma402/#sec-intl.pluralrules.prototype.selectrange

                                            ECMA-402 notation and compactDisplay options Mirrors Intl.NumberFormat notation option for proper plural selection with compact numbers

                                          namespace global.Intl

                                          namespace global.Intl {}

                                            interface PluralRules

                                            interface PluralRules {}

                                              method select

                                              select: {
                                              (n: number): LDMLPluralRule;
                                              (value?: number | bigint | string): LDMLPluralRule;
                                              };

                                                method selectRange

                                                selectRange: (
                                                start: number | bigint | string,
                                                end: number | bigint | string
                                                ) => LDMLPluralRule;

                                                  interface PluralRulesOptions

                                                  interface PluralRulesOptions extends NumberFormatDigitOptions {}

                                                    property compactDisplay

                                                    compactDisplay?: 'short' | 'long';

                                                      property notation

                                                      notation?: 'standard' | 'scientific' | 'engineering' | 'compact';

                                                        interface ResolvedPluralRulesOptions

                                                        interface ResolvedPluralRulesOptions {}

                                                          property trailingZeroDisplay

                                                          trailingZeroDisplay: NumberFormatDigitInternalSlots['trailingZeroDisplay'];

                                                            Package Files (1)

                                                            Dependencies (2)

                                                            Dev Dependencies (0)

                                                            No dev dependencies.

                                                            Peer Dependencies (0)

                                                            No peer dependencies.

                                                            Badge

                                                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@formatjs/intl-pluralrules.

                                                            • Markdown
                                                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@formatjs/intl-pluralrules)
                                                            • HTML
                                                              <a href="https://www.jsdocs.io/package/@formatjs/intl-pluralrules"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>