summaryrefslogtreecommitdiffstats
path: root/intl/icu_capi/js/package/lib/ICU4XBidiInfo.d.ts
blob: bdbb3f43ef6046f228db3ce44af3d9b009fe3b8b (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
import { u8, usize } from "./diplomat-runtime"
import { ICU4XBidiParagraph } from "./ICU4XBidiParagraph";

/**

 * An object containing bidi information for a given string, produced by `for_text()` on `ICU4XBidi`

 * See the {@link https://docs.rs/unicode_bidi/latest/unicode_bidi/struct.BidiInfo.html Rust documentation for `BidiInfo`} for more information.
 */
export class ICU4XBidiInfo {

  /**

   * The number of paragraphs contained here
   */
  paragraph_count(): usize;

  /**

   * Get the nth paragraph, returning `None` if out of bounds
   */
  paragraph_at(n: usize): ICU4XBidiParagraph | undefined;

  /**

   * The number of bytes in this full text
   */
  size(): usize;

  /**

   * Get the BIDI level at a particular byte index in the full text. This integer is conceptually a `unicode_bidi::Level`, and can be further inspected using the static methods on ICU4XBidi.

   * Returns 0 (equivalent to `Level::ltr()`) on error
   */
  level_at(pos: usize): u8;
}