CaseMapper.d.ts (6824B)
1 // generated by diplomat-tool 2 import type { CodePointSetBuilder } from "./CodePointSetBuilder" 3 import type { DataError } from "./DataError" 4 import type { DataProvider } from "./DataProvider" 5 import type { Locale } from "./Locale" 6 import type { TitlecaseOptions } from "./TitlecaseOptions" 7 import type { TitlecaseOptions_obj } from "./TitlecaseOptions" 8 import type { pointer, codepoint } from "./diplomat-runtime.d.ts"; 9 10 11 /** 12 * See the [Rust documentation for `CaseMapper`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html) for more information. 13 */ 14 15 16 export class CaseMapper { 17 get ffiValue(): pointer; 18 19 20 /** 21 * Construct a new CaseMapper instance using a particular data source. 22 * 23 * See the [Rust documentation for `new`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapper.html#method.new) for more information. 24 */ 25 static createWithProvider(provider: DataProvider): CaseMapper; 26 27 /** 28 * Returns the full lowercase mapping of the given string 29 * 30 * See the [Rust documentation for `lowercase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.lowercase) for more information. 31 */ 32 lowercase(s: string, locale: Locale): string; 33 34 /** 35 * Returns the full uppercase mapping of the given string 36 * 37 * See the [Rust documentation for `uppercase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.uppercase) for more information. 38 */ 39 uppercase(s: string, locale: Locale): string; 40 41 /** 42 * Returns the full lowercase mapping of the given string, using compiled data (avoids having to allocate a CaseMapper object) 43 * 44 * See the [Rust documentation for `lowercase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.lowercase) for more information. 45 */ 46 static lowercaseWithCompiledData(s: string, locale: Locale): string; 47 48 /** 49 * Returns the full uppercase mapping of the given string, using compiled data (avoids having to allocate a CaseMapper object) 50 * 51 * See the [Rust documentation for `uppercase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.uppercase) for more information. 52 */ 53 static uppercaseWithCompiledData(s: string, locale: Locale): string; 54 55 /** 56 * Returns the full titlecase mapping of the given string, performing head adjustment without 57 * loading additional data. 58 * (if head adjustment is enabled in the options) 59 * 60 * The `v1` refers to the version of the options struct, which may change as we add more options 61 * 62 * See the [Rust documentation for `titlecase_segment_with_only_case_data`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.titlecase_segment_with_only_case_data) for more information. 63 */ 64 titlecaseSegmentWithOnlyCaseData(s: string, locale: Locale, options: TitlecaseOptions_obj): string; 65 66 /** 67 * Case-folds the characters in the given string 68 * 69 * See the [Rust documentation for `fold`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.fold) for more information. 70 */ 71 fold(s: string): string; 72 73 /** 74 * Case-folds the characters in the given string 75 * using Turkic (T) mappings for dotted/dotless I. 76 * 77 * See the [Rust documentation for `fold_turkic`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.fold_turkic) for more information. 78 */ 79 foldTurkic(s: string): string; 80 81 /** 82 * Adds all simple case mappings and the full case folding for `c` to `builder`. 83 * Also adds special case closure mappings. 84 * 85 * In other words, this adds all characters that this casemaps to, as 86 * well as all characters that may casemap to this one. 87 * 88 * Note that since CodePointSetBuilder does not contain strings, this will 89 * ignore string mappings. 90 * 91 * Identical to the similarly named method on `CaseMapCloser`, use that if you 92 * plan on using string case closure mappings too. 93 * 94 * See the [Rust documentation for `add_case_closure_to`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.add_case_closure_to) for more information. 95 */ 96 addCaseClosureTo(c: codepoint, builder: CodePointSetBuilder): void; 97 98 /** 99 * Returns the simple lowercase mapping of the given character. 100 * 101 * This function only implements simple and common mappings. 102 * Full mappings, which can map one char to a string, are not included. 103 * For full mappings, use `CaseMapperBorrowed::lowercase`. 104 * 105 * See the [Rust documentation for `simple_lowercase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.simple_lowercase) for more information. 106 */ 107 simpleLowercase(ch: codepoint): codepoint; 108 109 /** 110 * Returns the simple uppercase mapping of the given character. 111 * 112 * This function only implements simple and common mappings. 113 * Full mappings, which can map one char to a string, are not included. 114 * For full mappings, use `CaseMapperBorrowed::uppercase`. 115 * 116 * See the [Rust documentation for `simple_uppercase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.simple_uppercase) for more information. 117 */ 118 simpleUppercase(ch: codepoint): codepoint; 119 120 /** 121 * Returns the simple titlecase mapping of the given character. 122 * 123 * This function only implements simple and common mappings. 124 * Full mappings, which can map one char to a string, are not included. 125 * For full mappings, use `CaseMapperBorrowed::titlecase_segment`. 126 * 127 * See the [Rust documentation for `simple_titlecase`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.simple_titlecase) for more information. 128 */ 129 simpleTitlecase(ch: codepoint): codepoint; 130 131 /** 132 * Returns the simple casefolding of the given character. 133 * 134 * This function only implements simple folding. 135 * For full folding, use `CaseMapperBorrowed::fold`. 136 * 137 * See the [Rust documentation for `simple_fold`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.simple_fold) for more information. 138 */ 139 simpleFold(ch: codepoint): codepoint; 140 141 /** 142 * Returns the simple casefolding of the given character in the Turkic locale 143 * 144 * This function only implements simple folding. 145 * For full folding, use `CaseMapperBorrowed::fold_turkic`. 146 * 147 * See the [Rust documentation for `simple_fold_turkic`](https://docs.rs/icu/latest/icu/casemap/struct.CaseMapperBorrowed.html#method.simple_fold_turkic) for more information. 148 */ 149 simpleFoldTurkic(ch: codepoint): codepoint; 150 151 constructor(); 152 }