Debian Codegraph @

intl/icu_capi/bindings/js/ICU4XCaseMapper.d.ts

raw
1 import { char } from "./diplomat-runtime"
2 import { FFIError } from "./diplomat-runtime"
3 import { ICU4XCodePointSetBuilder } from "./ICU4XCodePointSetBuilder";
4 import { ICU4XDataProvider } from "./ICU4XDataProvider";
5 import { ICU4XError } from "./ICU4XError";
6 import { ICU4XLocale } from "./ICU4XLocale";
7 import { ICU4XTitlecaseOptionsV1 } from "./ICU4XTitlecaseOptionsV1";
8
9 /**
10
11 * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html Rust documentation for `CaseMapper`} for more information.
12 */
13 export class ICU4XCaseMapper {
14
15 /**
16
17 * Construct a new ICU4XCaseMapper instance
18
19 * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.new Rust documentation for `new`} for more information.
20 * @throws {@link FFIError}<{@link ICU4XError}>
21 */
22 static create(provider: ICU4XDataProvider): ICU4XCaseMapper | never;
23
24 /**
25
26 * Returns the full lowercase mapping of the given string
27
28 * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.lowercase Rust documentation for `lowercase`} for more information.
29 * @throws {@link FFIError}<{@link ICU4XError}>
30 */
31 lowercase(s: string, locale: ICU4XLocale): string | never;
32
33 /**
34
35 * Returns the full uppercase mapping of the given string
36
37 * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.uppercase Rust documentation for `uppercase`} for more information.
38 * @throws {@link FFIError}<{@link ICU4XError}>
39 */
40 uppercase(s: string, locale: ICU4XLocale): string | never;
41
42 /**
43
44 * Returns the full titlecase mapping of the given string, performing head adjustment without loading additional data. (if head adjustment is enabled in the options)
45
46 * The `v1` refers to the version of the options struct, which may change as we add more options
47
48 * 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.
49 * @throws {@link FFIError}<{@link ICU4XError}>
50 */
51 titlecase_segment_with_only_case_data_v1(s: string, locale: ICU4XLocale, options: ICU4XTitlecaseOptionsV1): string | never;
52
53 /**
54
55 * Case-folds the characters in the given string
56
57 * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.fold Rust documentation for `fold`} for more information.
58 * @throws {@link FFIError}<{@link ICU4XError}>
59 */
60 fold(s: string): string | never;
61
62 /**
63
64 * Case-folds the characters in the given string using Turkic (T) mappings for dotted/dotless I.
65
66 * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.fold_turkic Rust documentation for `fold_turkic`} for more information.
67 * @throws {@link FFIError}<{@link ICU4XError}>
68 */
69 fold_turkic(s: string): string | never;
70
71 /**
72
73 * Adds all simple case mappings and the full case folding for `c` to `builder`. Also adds special case closure mappings.
74
75 * In other words, this adds all characters that this casemaps to, as well as all characters that may casemap to this one.
76
77 * Note that since ICU4XCodePointSetBuilder does not contain strings, this will ignore string mappings.
78
79 * Identical to the similarly named method on `ICU4XCaseMapCloser`, use that if you plan on using string case closure mappings too.
80
81 * 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.
82 */
83 add_case_closure_to(c: char, builder: ICU4XCodePointSetBuilder): void;
84
85 /**
86
87 * Returns the simple lowercase mapping of the given character.
88
89 * 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`.
90
91 * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_lowercase Rust documentation for `simple_lowercase`} for more information.
92 */
93 simple_lowercase(ch: char): char;
94
95 /**
96
97 * Returns the simple uppercase mapping of the given character.
98
99 * 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`.
100
101 * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_uppercase Rust documentation for `simple_uppercase`} for more information.
102 */
103 simple_uppercase(ch: char): char;
104
105 /**
106
107 * Returns the simple titlecase mapping of the given character.
108
109 * 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`.
110
111 * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_titlecase Rust documentation for `simple_titlecase`} for more information.
112 */
113 simple_titlecase(ch: char): char;
114
115 /**
116
117 * Returns the simple casefolding of the given character.
118
119 * This function only implements simple folding. For full folding, use `ICU4XCaseMapper::fold`.
120
121 * See the {@link https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.simple_fold Rust documentation for `simple_fold`} for more information.
122 */
123 simple_fold(ch: char): char;
124
125 /**
126
127 * Returns the simple casefolding of the given character in the Turkic locale
128
129 * This function only implements simple folding. For full folding, use `ICU4XCaseMapper::fold_turkic`.
130
131 * 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.
132 */
133 simple_fold_turkic(ch: char): char;
134 }