PluralRules.d.ts (2681B)
1 // generated by diplomat-tool 2 import type { DataError } from "./DataError" 3 import type { DataProvider } from "./DataProvider" 4 import type { Locale } from "./Locale" 5 import type { PluralCategories } from "./PluralCategories" 6 import type { PluralCategory } from "./PluralCategory" 7 import type { PluralOperands } from "./PluralOperands" 8 import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; 9 10 11 /** 12 * See the [Rust documentation for `PluralRules`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html) for more information. 13 */ 14 15 16 export class PluralRules { 17 get ffiValue(): pointer; 18 19 20 /** 21 * Construct an [`PluralRules`] for the given locale, for cardinal numbers, using compiled data. 22 * 23 * See the [Rust documentation for `try_new_cardinal`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_cardinal) for more information. 24 */ 25 static createCardinal(locale: Locale): PluralRules; 26 27 /** 28 * Construct an [`PluralRules`] for the given locale, for cardinal numbers, using a particular data source. 29 * 30 * See the [Rust documentation for `try_new_cardinal`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_cardinal) for more information. 31 */ 32 static createCardinalWithProvider(provider: DataProvider, locale: Locale): PluralRules; 33 34 /** 35 * Construct an [`PluralRules`] for the given locale, for ordinal numbers, using compiled data. 36 * 37 * See the [Rust documentation for `try_new_ordinal`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_ordinal) for more information. 38 */ 39 static createOrdinal(locale: Locale): PluralRules; 40 41 /** 42 * Construct an [`PluralRules`] for the given locale, for ordinal numbers, using a particular data source. 43 * 44 * See the [Rust documentation for `try_new_ordinal`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.try_new_ordinal) for more information. 45 */ 46 static createOrdinalWithProvider(provider: DataProvider, locale: Locale): PluralRules; 47 48 /** 49 * Get the category for a given number represented as operands 50 * 51 * See the [Rust documentation for `category_for`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.category_for) for more information. 52 */ 53 categoryFor(op: PluralOperands): PluralCategory; 54 55 /** 56 * Get all of the categories needed in the current locale 57 * 58 * See the [Rust documentation for `categories`](https://docs.rs/icu/latest/icu/plurals/struct.PluralRules.html#method.categories) for more information. 59 */ 60 get categories(): PluralCategories; 61 }