summaryrefslogtreecommitdiffstats
path: root/intl/icu_capi/js/package/lib/ICU4XBidiInfo.d.ts
diff options
context:
space:
mode:
Diffstat (limited to 'intl/icu_capi/js/package/lib/ICU4XBidiInfo.d.ts')
-rw-r--r--intl/icu_capi/js/package/lib/ICU4XBidiInfo.d.ts37
1 files changed, 37 insertions, 0 deletions
diff --git a/intl/icu_capi/js/package/lib/ICU4XBidiInfo.d.ts b/intl/icu_capi/js/package/lib/ICU4XBidiInfo.d.ts
new file mode 100644
index 0000000000..bdbb3f43ef
--- /dev/null
+++ b/intl/icu_capi/js/package/lib/ICU4XBidiInfo.d.ts
@@ -0,0 +1,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;
+}