| 1 |
import { u8, usize } from "./diplomat-runtime" |
| 2 |
import { FFIError } from "./diplomat-runtime" |
| 3 |
import { ICU4XBidiDirection } from "./ICU4XBidiDirection"; |
| 4 |
import { ICU4XError } from "./ICU4XError"; |
| 5 |
|
| 6 |
/** |
| 7 |
|
| 8 |
* Bidi information for a single processed paragraph |
| 9 |
*/ |
| 10 |
export class ICU4XBidiParagraph { |
| 11 |
|
| 12 |
/** |
| 13 |
|
| 14 |
* Given a paragraph index `n` within the surrounding text, this sets this object to the paragraph at that index. Returns `ICU4XError::OutOfBoundsError` when out of bounds. |
| 15 |
|
| 16 |
* This is equivalent to calling `paragraph_at()` on `ICU4XBidiInfo` but doesn't create a new object |
| 17 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 18 |
*/ |
| 19 |
set_paragraph_in_text(n: usize): void | never; |
| 20 |
|
| 21 |
/** |
| 22 |
|
| 23 |
* The primary direction of this paragraph |
| 24 |
|
| 25 |
* See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at Rust documentation for `level_at`} for more information. |
| 26 |
*/ |
| 27 |
direction(): ICU4XBidiDirection; |
| 28 |
|
| 29 |
/** |
| 30 |
|
| 31 |
* The number of bytes in this paragraph |
| 32 |
|
| 33 |
* See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.ParagraphInfo.html#method.len Rust documentation for `len`} for more information. |
| 34 |
*/ |
| 35 |
size(): usize; |
| 36 |
|
| 37 |
/** |
| 38 |
|
| 39 |
* The start index of this paragraph within the source text |
| 40 |
*/ |
| 41 |
range_start(): usize; |
| 42 |
|
| 43 |
/** |
| 44 |
|
| 45 |
* The end index of this paragraph within the source text |
| 46 |
*/ |
| 47 |
range_end(): usize; |
| 48 |
|
| 49 |
/** |
| 50 |
|
| 51 |
* Reorder a line based on display order. The ranges are specified relative to the source text and must be contained within this paragraph's range. |
| 52 |
|
| 53 |
* See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at Rust documentation for `level_at`} for more information. |
| 54 |
* @throws {@link FFIError}<{@link ICU4XError}> |
| 55 |
*/ |
| 56 |
reorder_line(range_start: usize, range_end: usize): string | never; |
| 57 |
|
| 58 |
/** |
| 59 |
|
| 60 |
* Get the BIDI level at a particular byte index in this paragraph. This integer is conceptually a `unicode_bidi::Level`, and can be further inspected using the static methods on ICU4XBidi. |
| 61 |
|
| 62 |
* Returns 0 (equivalent to `Level::ltr()`) on error |
| 63 |
|
| 64 |
* See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.Paragraph.html#method.level_at Rust documentation for `level_at`} for more information. |
| 65 |
*/ |
| 66 |
level_at(pos: usize): u8; |
| 67 |
} |