| 1 |
import { FFIError } from "./diplomat-runtime" |
| 2 |
import { ICU4XDataProvider } from "./ICU4XDataProvider"; |
| 3 |
import { ICU4XError } from "./ICU4XError"; |
| 4 |
import { ICU4XLocale } from "./ICU4XLocale"; |
| 5 |
import { ICU4XPluralCategories } from "./ICU4XPluralCategories"; |
| 6 |
import { ICU4XPluralCategory } from "./ICU4XPluralCategory"; |
| 7 |
import { ICU4XPluralOperands } from "./ICU4XPluralOperands"; |
| 8 |
|
| 9 |
/** |
| 10 |
|
| 11 |
* See the {@link https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html Rust documentation for `PluralRules`} for more information. |
| 12 |
*/ |
| 13 |
export class ICU4XPluralRules { |
| 14 |
|
| 15 |
/** |
| 16 |
|
| 17 |
* Construct an {@link ICU4XPluralRules `ICU4XPluralRules`} for the given locale, for cardinal numbers |
| 18 |
|
| 19 |
* See the {@link https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_cardinal Rust documentation for `try_new_cardinal`} for more information. |
| 20 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 21 |
*/ |
| 22 |
static create_cardinal(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XPluralRules | never; |
| 23 |
|
| 24 |
/** |
| 25 |
|
| 26 |
* Construct an {@link ICU4XPluralRules `ICU4XPluralRules`} for the given locale, for ordinal numbers |
| 27 |
|
| 28 |
* See the {@link https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_ordinal Rust documentation for `try_new_ordinal`} for more information. |
| 29 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 30 |
*/ |
| 31 |
static create_ordinal(provider: ICU4XDataProvider, locale: ICU4XLocale): ICU4XPluralRules | never; |
| 32 |
|
| 33 |
/** |
| 34 |
|
| 35 |
* Get the category for a given number represented as operands |
| 36 |
|
| 37 |
* See the {@link https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.category_for Rust documentation for `category_for`} for more information. |
| 38 |
*/ |
| 39 |
category_for(op: ICU4XPluralOperands): ICU4XPluralCategory; |
| 40 |
|
| 41 |
/** |
| 42 |
|
| 43 |
* Get all of the categories needed in the current locale |
| 44 |
|
| 45 |
* See the {@link https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.categories Rust documentation for `categories`} for more information. |
| 46 |
*/ |
| 47 |
categories(): ICU4XPluralCategories; |
| 48 |
} |