Debian Codegraph @

intl/icu_capi/bindings/js/ICU4XLocaleFallbackerWithConfig.mjs

raw
1 import wasm from "./diplomat-wasm.mjs"
2 import * as diplomatRuntime from "./diplomat-runtime.mjs"
3 import { ICU4XLocaleFallbackIterator } from "./ICU4XLocaleFallbackIterator.mjs"
4
5 const ICU4XLocaleFallbackerWithConfig_box_destroy_registry = new FinalizationRegistry(underlying => {
6 wasm.ICU4XLocaleFallbackerWithConfig_destroy(underlying);
7 });
8
9 export class ICU4XLocaleFallbackerWithConfig {
10 #lifetimeEdges = [];
11 constructor(underlying, owned, edges) {
12 this.underlying = underlying;
13 this.#lifetimeEdges.push(...edges);
14 if (owned) {
15 ICU4XLocaleFallbackerWithConfig_box_destroy_registry.register(this, underlying);
16 }
17 }
18
19 fallback_for_locale(arg_locale) {
20 return new ICU4XLocaleFallbackIterator(wasm.ICU4XLocaleFallbackerWithConfig_fallback_for_locale(this.underlying, arg_locale.underlying), true, [this]);
21 }
22 }