Debian Codegraph @

intl/icu_capi/bindings/js/ICU4XLocaleFallbackConfig.mjs

raw
1 import wasm from "./diplomat-wasm.mjs"
2 import * as diplomatRuntime from "./diplomat-runtime.mjs"
3 import { ICU4XLocaleFallbackPriority_js_to_rust, ICU4XLocaleFallbackPriority_rust_to_js } from "./ICU4XLocaleFallbackPriority.mjs"
4 import { ICU4XLocaleFallbackSupplement_js_to_rust, ICU4XLocaleFallbackSupplement_rust_to_js } from "./ICU4XLocaleFallbackSupplement.mjs"
5
6 export class ICU4XLocaleFallbackConfig {
7 constructor(underlying, edges_a) {
8 this.priority = ICU4XLocaleFallbackPriority_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying)];
9 this.extension_key = (() => {
10 const [ptr, size] = new Uint32Array(wasm.memory.buffer, underlying + 4, 2);
11 return diplomatRuntime.readString8(wasm, ptr, size);
12 })();
13 this.fallback_supplement = ICU4XLocaleFallbackSupplement_rust_to_js[diplomatRuntime.enumDiscriminant(wasm, underlying + 12)];
14 }
15 }