Debian Codegraph @

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

raw
1 import { u8 } from "./diplomat-runtime"
2 import { FFIError } from "./diplomat-runtime"
3 import { ICU4XBidiInfo } from "./ICU4XBidiInfo";
4 import { ICU4XDataProvider } from "./ICU4XDataProvider";
5 import { ICU4XError } from "./ICU4XError";
6 import { ICU4XReorderedIndexMap } from "./ICU4XReorderedIndexMap";
7
8 /**
9
10 * An ICU4X Bidi object, containing loaded bidi data
11
12 * See the {@link https://docs.rs/icu/latest/icu/properties/bidi/struct.BidiClassAdapter.html Rust documentation for `BidiClassAdapter`} for more information.
13 */
14 export class ICU4XBidi {
15
16 /**
17
18 * Creates a new {@link ICU4XBidi `ICU4XBidi`} from locale data.
19
20 * See the {@link https://docs.rs/icu/latest/icu/properties/bidi/struct.BidiClassAdapter.html#method.new Rust documentation for `new`} for more information.
21 * @throws {@link FFIError}<{@link ICU4XError}>
22 */
23 static create(provider: ICU4XDataProvider): ICU4XBidi | never;
24
25 /**
26
27 * Use the data loaded in this object to process a string and calculate bidi information
28
29 * Takes in a Level for the default level, if it is an invalid value it will default to LTR
30
31 * Returns nothing if `text` is invalid UTF-8.
32
33 * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html#method.new_with_data_source Rust documentation for `new_with_data_source`} for more information.
34 */
35 for_text(text: string, default_level: u8): ICU4XBidiInfo | undefined;
36
37 /**
38
39 * Utility function for producing reorderings given a list of levels
40
41 * Produces a map saying which visual index maps to which source index.
42
43 * The levels array must not have values greater than 126 (this is the Bidi maximum explicit depth plus one). Failure to follow this invariant may lead to incorrect results, but is still safe.
44
45 * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html#method.reorder_visual Rust documentation for `reorder_visual`} for more information.
46 */
47 reorder_visual(levels: Uint8Array): ICU4XReorderedIndexMap;
48
49 /**
50
51 * Check if a Level returned by level_at is an RTL level.
52
53 * Invalid levels (numbers greater than 125) will be assumed LTR
54
55 * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.is_rtl Rust documentation for `is_rtl`} for more information.
56 */
57 static level_is_rtl(level: u8): boolean;
58
59 /**
60
61 * Check if a Level returned by level_at is an LTR level.
62
63 * Invalid levels (numbers greater than 125) will be assumed LTR
64
65 * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.is_ltr Rust documentation for `is_ltr`} for more information.
66 */
67 static level_is_ltr(level: u8): boolean;
68
69 /**
70
71 * Get a basic RTL Level value
72
73 * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.rtl Rust documentation for `rtl`} for more information.
74 */
75 static level_rtl(): u8;
76
77 /**
78
79 * Get a simple LTR Level value
80
81 * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Level.html#method.ltr Rust documentation for `ltr`} for more information.
82 */
83 static level_ltr(): u8;
84 }