# @types/plurals-cldr

> TypeScript definitions for plurals-cldr

Latest version **1.0.5** (published 2023-11-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/plurals-cldr
pnpm add @types/plurals-cldr
yarn add @types/plurals-cldr
bun add @types/plurals-cldr
```

## Health

**Score 45/100 (D)** — status: abandoned.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2023-11-07 |
| First published | 2019-03-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51446 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/plurals-cldr
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/plurals-cldr
- npm.io page: https://npm.io/package/@types/plurals-cldr

## Recent versions

- 1.0.5 (latest) — 2023-11-07
- 1.0.2 (ts3.8) — 2021-12-24
- 1.0.1 (ts3.0) — 2020-05-15
- 1.0.0 (ts2.0) — 2019-03-08
- 1.0.4 — 2023-10-18
- 1.0.3 — 2023-09-24

## README

# Installation
> `npm install --save @types/plurals-cldr`

# Summary
This package contains type definitions for plurals-cldr (https://github.com/nodeca/plurals-cldr).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/plurals-cldr.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/plurals-cldr/index.d.ts)
````ts
type Form = "zero" | "one" | "two" | "few" | "many" | "other";

interface Plural {
    /**
     * Returns the form name for a given number. If the locale is not
     * supported, returns `null`.
     *
     * @param locale The locale code.
     * @param number The number to check. May be passed as a string to keep
     *     trailing zeroes.
     */
    (locale: string, number: number | string): Form | null;

    /**
     * Returns an array of available forms for the given locale. If the
     * locale is not supported, returns `null`.
     *
     * @param locale The locale code.
     */
    forms(locale: string): Form[] | null;

    /**
     * Returns the index of the form for a given number. If the locale is
     * not supported, returns `-1`.
     *
     * This is convenient for implementing a lookup from a compact, ordered
     * list. The order of forms for all locales is `zero`, `one`, `two`,
     * `few`, `many`, `other`. Remove the forms not used by a locale to get
     * the indices of each.
     *
     * @param locale The locale code.
     * @param number The number to check. May be passed as a string to keep
     *     trailing zeroes.
     */
    indexOf(locale: string, number: number | string): number;
}

/**
 * Gets the CLDR cardinal plural forms for numbers in different locales.
 */
declare const plural: Plural & {
    /**
     * Gets the CLDR ordinal plural forms for numbers in different locales.
     */
    ordinal: Plural;
};

export = plural;

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 09:09:39 GMT
 * Dependencies: none

# Credits
These definitions were written by .

---
_Source: https://npm.io/package/@types/plurals-cldr · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
