Debian Codegraph @

intl/icu_capi/bindings/js/ICU4XReorderedIndexMap.mjs

raw
1 import wasm from "./diplomat-wasm.mjs"
2 import * as diplomatRuntime from "./diplomat-runtime.mjs"
3
4 const ICU4XReorderedIndexMap_box_destroy_registry = new FinalizationRegistry(underlying => {
5 wasm.ICU4XReorderedIndexMap_destroy(underlying);
6 });
7
8 export class ICU4XReorderedIndexMap {
9 #lifetimeEdges = [];
10 constructor(underlying, owned, edges) {
11 this.underlying = underlying;
12 this.#lifetimeEdges.push(...edges);
13 if (owned) {
14 ICU4XReorderedIndexMap_box_destroy_registry.register(this, underlying);
15 }
16 }
17
18 as_slice() {
19 return (() => {
20 const diplomat_receive_buffer = wasm.diplomat_alloc(8, 4);
21 wasm.ICU4XReorderedIndexMap_as_slice(diplomat_receive_buffer, this.underlying);
22 const [ptr, size] = new Uint32Array(wasm.memory.buffer, diplomat_receive_buffer, 2);
23 wasm.diplomat_free(diplomat_receive_buffer, 8, 4);
24 return Uint32Array.from(new Uint32Array(wasm.memory.buffer, ptr, size));
25 })();
26 }
27
28 len() {
29 return wasm.ICU4XReorderedIndexMap_len(this.underlying);
30 }
31
32 is_empty() {
33 return wasm.ICU4XReorderedIndexMap_is_empty(this.underlying);
34 }
35
36 get(arg_index) {
37 return wasm.ICU4XReorderedIndexMap_get(this.underlying, arg_index);
38 }
39 }