summaryrefslogtreecommitdiffstats
path: root/intl/icu_capi/js/package/lib/ICU4XCaseMapper.d.ts
blob: eb472c809bfb92219f9c19ba61a33195c37214cc (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
import { char } from "./diplomat-runtime"
import { FFIError } from "./diplomat-runtime"
import { ICU4XCodePointSetBuilder } from "./ICU4XCodePointSetBuilder";
import { ICU4XDataProvider } from "./ICU4XDataProvider";
import { ICU4XError } from "./ICU4XError";
import { ICU4XLocale } from "./ICU4XLocale";
import { ICU4XTitlecaseOptionsV1 } from "./ICU4XTitlecaseOptionsV1";

/**

 * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html Rust documentation for `CaseMapper`} for more information.
 */
export class ICU4XCaseMapper {

  /**

   * Construct a new ICU4XCaseMapper instance

   * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.new Rust documentation for `new`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static create(provider: ICU4XDataProvider): ICU4XCaseMapper | never;

  /**

   * Returns the full lowercase mapping of the given string

   * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.lowercase Rust documentation for `lowercase`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  lowercase(s: string, locale: ICU4XLocale): string | never;

  /**

   * Returns the full uppercase mapping of the given string

   * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.uppercase Rust documentation for `uppercase`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  uppercase(s: string, locale: ICU4XLocale): string | never;

  /**

   * Returns the full titlecase mapping of the given string, performing head adjustment without loading additional data. (if head adjustment is enabled in the options)

   * The `v1` refers to the version of the options struct, which may change as we add more options

   * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.titlecase_segment_with_only_case_data Rust documentation for `titlecase_segment_with_only_case_data`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  titlecase_segment_with_only_case_data_v1(s: string, locale: ICU4XLocale, options: ICU4XTitlecaseOptionsV1): string | never;

  /**

   * Case-folds the characters in the given string

   * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.fold Rust documentation for `fold`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  fold(s: string): string | never;

  /**

   * Case-folds the characters in the given string using Turkic (T) mappings for dotted/dotless I.

   * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.fold_turkic Rust documentation for `fold_turkic`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  fold_turkic(s: string): string | never;

  /**

   * Adds all simple case mappings and the full case folding for `c` to `builder`. Also adds special case closure mappings.

   * In other words, this adds all characters that this casemaps to, as well as all characters that may casemap to this one.

   * Note that since ICU4XCodePointSetBuilder does not contain strings, this will ignore string mappings.

   * Identical to the similarly named method on `ICU4XCaseMapCloser`, use that if you plan on using string case closure mappings too.

   * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.add_case_closure_to Rust documentation for `add_case_closure_to`} for more information.
   */
  add_case_closure_to(c: char, builder: ICU4XCodePointSetBuilder): void;

  /**

   * Returns the simple lowercase mapping of the given character.

   * This function only implements simple and common mappings. Full mappings, which can map one char to a string, are not included. For full mappings, use `ICU4XCaseMapper::lowercase`.

   * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_lowercase Rust documentation for `simple_lowercase`} for more information.
   */
  simple_lowercase(ch: char): char;

  /**

   * Returns the simple uppercase mapping of the given character.

   * This function only implements simple and common mappings. Full mappings, which can map one char to a string, are not included. For full mappings, use `ICU4XCaseMapper::uppercase`.

   * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_uppercase Rust documentation for `simple_uppercase`} for more information.
   */
  simple_uppercase(ch: char): char;

  /**

   * Returns the simple titlecase mapping of the given character.

   * This function only implements simple and common mappings. Full mappings, which can map one char to a string, are not included. For full mappings, use `ICU4XCaseMapper::titlecase_segment`.

   * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_titlecase Rust documentation for `simple_titlecase`} for more information.
   */
  simple_titlecase(ch: char): char;

  /**

   * Returns the simple casefolding of the given character.

   * This function only implements simple folding. For full folding, use `ICU4XCaseMapper::fold`.

   * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_fold Rust documentation for `simple_fold`} for more information.
   */
  simple_fold(ch: char): char;

  /**

   * Returns the simple casefolding of the given character in the Turkic locale

   * This function only implements simple folding. For full folding, use `ICU4XCaseMapper::fold_turkic`.

   * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_fold_turkic Rust documentation for `simple_fold_turkic`} for more information.
   */
  simple_fold_turkic(ch: char): char;
}