summaryrefslogtreecommitdiffstats
path: root/intl/icu_capi/js/package/lib/ICU4XCodePointMapData8.d.ts
blob: 700695044e7b68948c166fb9b07cd266d90051d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import { u8, u32, char } from "./diplomat-runtime"
import { FFIError } from "./diplomat-runtime"
import { CodePointRangeIterator } from "./CodePointRangeIterator";
import { ICU4XCodePointSetData } from "./ICU4XCodePointSetData";
import { ICU4XDataProvider } from "./ICU4XDataProvider";
import { ICU4XError } from "./ICU4XError";

/**

 * 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.

 * For properties whose values fit into 8 bits.

 * See the {@link https://docs.rs/icu/latest/icu/properties/index.html Rust documentation for `properties`} for more information.

 * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapData.html Rust documentation for `CodePointMapData`} for more information.

 * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html Rust documentation for `CodePointMapDataBorrowed`} for more information.
 */
export class ICU4XCodePointMapData8 {

  /**

   * Gets the value for a code point.

   * See the {@link https://docs.rs/icu/latest/icu/properties/maps/struct.CodePointMapDataBorrowed.html#method.get Rust documentation for `get`} for more information.
   */
  get(cp: char): u8;

  /**

   * Gets the value for a code point (specified as a 32 bit integer, in UTF-32)
   */
  get32(cp: u32): u8;

  /**

   * Converts a general category to its corresponding mask value

   * Nonexistant general categories will map to the empty mask

   * See the {@link https://docs.rs/icu/latest/icu/properties/struct.GeneralCategoryGroup.html Rust documentation for `GeneralCategoryGroup`} for more information.
   */
  static general_category_to_mask(gc: u8): u32;

  /**

   * Produces an iterator over ranges of code points that map to `value`

   * 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.
   */
  iter_ranges_for_value(value: u8): CodePointRangeIterator;

  /**

   * Produces an iterator over ranges of code points that do not map to `value`

   * 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.
   */
  iter_ranges_for_value_complemented(value: u8): CodePointRangeIterator;

  /**

   * 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.

   * The main mask property supported is that for General_Category, which can be obtained via `general_category_to_mask()` or by using `ICU4XGeneralCategoryNameToMaskMapper`

   * Should only be used on maps for properties with values less than 32 (like Generak_Category), other maps will have unpredictable results

   * 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.
   */
  iter_ranges_for_mask(mask: u32): CodePointRangeIterator;

  /**

   * Gets a {@link ICU4XCodePointSetData `ICU4XCodePointSetData`} representing all entries in this map that map to the given value

   * 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.
   */
  get_set_for_value(value: u8): ICU4XCodePointSetData;

  /**

   * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.general_category.html Rust documentation for `general_category`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static load_general_category(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never;

  /**

   * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.bidi_class.html Rust documentation for `bidi_class`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static load_bidi_class(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never;

  /**

   * 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.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static load_east_asian_width(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never;

  /**

   * 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.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static load_indic_syllabic_category(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never;

  /**

   * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.line_break.html Rust documentation for `line_break`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static load_line_break(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never;

  /**

   * 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.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static try_grapheme_cluster_break(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never;

  /**

   * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.word_break.html Rust documentation for `word_break`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static load_word_break(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never;

  /**

   * See the {@link https://docs.rs/icu/latest/icu/properties/maps/fn.sentence_break.html Rust documentation for `sentence_break`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static load_sentence_break(provider: ICU4XDataProvider): ICU4XCodePointMapData8 | never;
}