| 1 |
import { u8, u32, char } from "./diplomat-runtime" |
| 2 |
import { FFIError } from "./diplomat-runtime" |
| 3 |
import { CodePointRangeIterator } from "./CodePointRangeIterator"; |
| 4 |
import { ICU4XCodePointSetData } from "./ICU4XCodePointSetData"; |
| 5 |
import { ICU4XDataProvider } from "./ICU4XDataProvider"; |
| 6 |
import { ICU4XError } from "./ICU4XError"; |
| 7 |
|
| 8 |
/** |
| 9 |
|
| 10 |
* An ICU4X Unicode Map Property object, capable of querying whether a code point (key) to obtain the Unicode property value, for a specific Unicode property. |
| 11 |
|
| 12 |
* For properties whose values fit into 8 bits. |
| 13 |
|
| 14 |
* See the {@link https://docs.rs/icu/latest/icu/properties/index.html Rust documentation for `properties`} for more information. |
| 15 |
|
| 16 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapData.html Rust documentation for `CodePointMapData`} for more information. |
| 17 |
|
| 18 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html Rust documentation for `CodePointMapDataBorrowed`} for more information. |
| 19 |
*/ |
| 20 |
export class ICU4XCodePointMapData8 { |
| 21 |
|
| 22 |
/** |
| 23 |
|
| 24 |
* Gets the value for a code point. |
| 25 |
|
| 26 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get Rust documentation for `get`} for more information. |
| 27 |
*/ |
| 28 |
get(cp: char): u8; |
| 29 |
|
| 30 |
/** |
| 31 |
|
| 32 |
* Gets the value for a code point (specified as a 32 bit integer, in UTF-32) |
| 33 |
*/ |
| 34 |
get32(cp: u32): u8; |
| 35 |
|
| 36 |
/** |
| 37 |
|
| 38 |
* Converts a general category to its corresponding mask value |
| 39 |
|
| 40 |
* Nonexistent general categories will map to the empty mask |
| 41 |
|
| 42 |
* See the {@link https://docs.rs/icu/latest/icu/properties/struct.GeneralCategoryGroup.html Rust documentation for `GeneralCategoryGroup`} for more information. |
| 43 |
*/ |
| 44 |
static general_category_to_mask(gc: u8): u32; |
| 45 |
|
| 46 |
/** |
| 47 |
|
| 48 |
* Produces an iterator over ranges of code points that map to `value` |
| 49 |
|
| 50 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value Rust documentation for `iter_ranges_for_value`} for more information. |
| 51 |
*/ |
| 52 |
iter_ranges_for_value(value: u8): CodePointRangeIterator; |
| 53 |
|
| 54 |
/** |
| 55 |
|
| 56 |
* Produces an iterator over ranges of code points that do not map to `value` |
| 57 |
|
| 58 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_value_complemented Rust documentation for `iter_ranges_for_value_complemented`} for more information. |
| 59 |
*/ |
| 60 |
iter_ranges_for_value_complemented(value: u8): CodePointRangeIterator; |
| 61 |
|
| 62 |
/** |
| 63 |
|
| 64 |
* Given a mask value (the nth bit marks property value = n), produce an iterator over ranges of code points whose property values are contained in the mask. |
| 65 |
|
| 66 |
* The main mask property supported is that for General_Category, which can be obtained via `general_category_to_mask()` or by using `ICU4XGeneralCategoryNameToMaskMapper` |
| 67 |
|
| 68 |
* Should only be used on maps for properties with values less than 32 (like Generak_Category), other maps will have unpredictable results |
| 69 |
|
| 70 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.iter_ranges_for_group Rust documentation for `iter_ranges_for_group`} for more information. |
| 71 |
*/ |
| 72 |
iter_ranges_for_mask(mask: u32): CodePointRangeIterator; |
| 73 |
|
| 74 |
/** |
| 75 |
|
| 76 |
* Gets a {@link ICU4XCodePointSetData `ICU4XCodePointSetData`} representing all entries in this map that map to the given value |
| 77 |
|
| 78 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get_set_for_value Rust documentation for `get_set_for_value`} for more information. |
| 79 |
*/ |
| 80 |
get_set_for_value(value: u8): ICU4XCodePointSetData; |
| 81 |
|
| 82 |
/** |
| 83 |
|
| 84 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.general_category.html Rust documentation for `general_category`} for more information. |
| 85 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 86 |
*/ |
| 87 |
static load_general_category(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; |
| 88 |
|
| 89 |
/** |
| 90 |
|
| 91 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.bidi_class.html Rust documentation for `bidi_class`} for more information. |
| 92 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 93 |
*/ |
| 94 |
static load_bidi_class(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; |
| 95 |
|
| 96 |
/** |
| 97 |
|
| 98 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.east_asian_width.html Rust documentation for `east_asian_width`} for more information. |
| 99 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 100 |
*/ |
| 101 |
static load_east_asian_width(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; |
| 102 |
|
| 103 |
/** |
| 104 |
|
| 105 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.hangul_syllable_type.html Rust documentation for `hangul_syllable_type`} for more information. |
| 106 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 107 |
*/ |
| 108 |
static load_hangul_syllable_type(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; |
| 109 |
|
| 110 |
/** |
| 111 |
|
| 112 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.indic_syllabic_category.html Rust documentation for `indic_syllabic_category`} for more information. |
| 113 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 114 |
*/ |
| 115 |
static load_indic_syllabic_category(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; |
| 116 |
|
| 117 |
/** |
| 118 |
|
| 119 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.line_break.html Rust documentation for `line_break`} for more information. |
| 120 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 121 |
*/ |
| 122 |
static load_line_break(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; |
| 123 |
|
| 124 |
/** |
| 125 |
|
| 126 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.grapheme_cluster_break.html Rust documentation for `grapheme_cluster_break`} for more information. |
| 127 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 128 |
*/ |
| 129 |
static try_grapheme_cluster_break(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; |
| 130 |
|
| 131 |
/** |
| 132 |
|
| 133 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.word_break.html Rust documentation for `word_break`} for more information. |
| 134 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 135 |
*/ |
| 136 |
static load_word_break(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; |
| 137 |
|
| 138 |
/** |
| 139 |
|
| 140 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.sentence_break.html Rust documentation for `sentence_break`} for more information. |
| 141 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 142 |
*/ |
| 143 |
static load_sentence_break(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; |
| 144 |
|
| 145 |
/** |
| 146 |
|
| 147 |
* See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.joining_type.html Rust documentation for `joining_type`} for more information. |
| 148 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 149 |
*/ |
| 150 |
static load_joining_type(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never; |
| 151 |
} |