Debian Codegraph @

intl/icu_capi/bindings/js/ICU4XBidiInfo.mjs

raw
1 import wasm from "./diplomat-wasm.mjs"
2 import * as diplomatRuntime from "./diplomat-runtime.mjs"
3 import { ICU4XBidiParagraph } from "./ICU4XBidiParagraph.mjs"
4
5 const ICU4XBidiInfo_box_destroy_registry = new FinalizationRegistry(underlying => {
6 wasm.ICU4XBidiInfo_destroy(underlying);
7 });
8
9 export class ICU4XBidiInfo {
10 #lifetimeEdges = [];
11 constructor(underlying, owned, edges) {
12 this.underlying = underlying;
13 this.#lifetimeEdges.push(...edges);
14 if (owned) {
15 ICU4XBidiInfo_box_destroy_registry.register(this, underlying);
16 }
17 }
18
19 paragraph_count() {
20 return wasm.ICU4XBidiInfo_paragraph_count(this.underlying);
21 }
22
23 paragraph_at(arg_n) {
24 return (() => {
25 const option_ptr = wasm.ICU4XBidiInfo_paragraph_at(this.underlying, arg_n);
26 return (option_ptr == 0) ? undefined : new ICU4XBidiParagraph(option_ptr, true, [this]);
27 })();
28 }
29
30 size() {
31 return wasm.ICU4XBidiInfo_size(this.underlying);
32 }
33
34 level_at(arg_pos) {
35 return wasm.ICU4XBidiInfo_level_at(this.underlying, arg_pos);
36 }
37 }