summaryrefslogtreecommitdiffstats
path: root/intl/icu_capi/js/package/lib/ICU4XComposingNormalizer.d.ts
blob: 7417e6257b3247375611e5b7d3872d2c4138b33a (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
import { FFIError } from "./diplomat-runtime"
import { ICU4XDataProvider } from "./ICU4XDataProvider";
import { ICU4XError } from "./ICU4XError";

/**

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

  /**

   * Construct a new ICU4XComposingNormalizer instance for NFC

   * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.new_nfc Rust documentation for `new_nfc`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static create_nfc(provider: ICU4XDataProvider): ICU4XComposingNormalizer | never;

  /**

   * Construct a new ICU4XComposingNormalizer instance for NFKC

   * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.new_nfkc Rust documentation for `new_nfkc`} for more information.
   * @throws {@link FFIError}<{@link ICU4XError}>
   */
  static create_nfkc(provider: ICU4XDataProvider): ICU4XComposingNormalizer | never;

  /**

   * Normalize a (potentially ill-formed) UTF8 string

   * Errors are mapped to REPLACEMENT CHARACTER

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

  /**

   * Check if a (potentially ill-formed) UTF8 string is normalized

   * Errors are mapped to REPLACEMENT CHARACTER

   * See the {@link https://docs.rs/icu/latest/icu/normalizer/struct.ComposingNormalizer.html#method.is_normalized_utf8 Rust documentation for `is_normalized_utf8`} for more information.
   */
  is_normalized(s: string): boolean;
}