summaryrefslogtreecommitdiffstats
path: root/intl/icu_capi/js/package/lib/ICU4XLocaleFallbackerWithConfig.js
diff options
context:
space:
mode:
Diffstat (limited to 'intl/icu_capi/js/package/lib/ICU4XLocaleFallbackerWithConfig.js')
-rw-r--r--intl/icu_capi/js/package/lib/ICU4XLocaleFallbackerWithConfig.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/intl/icu_capi/js/package/lib/ICU4XLocaleFallbackerWithConfig.js b/intl/icu_capi/js/package/lib/ICU4XLocaleFallbackerWithConfig.js
new file mode 100644
index 0000000000..632654df03
--- /dev/null
+++ b/intl/icu_capi/js/package/lib/ICU4XLocaleFallbackerWithConfig.js
@@ -0,0 +1,22 @@
+import wasm from "./diplomat-wasm.mjs"
+import * as diplomatRuntime from "./diplomat-runtime.js"
+import { ICU4XLocaleFallbackIterator } from "./ICU4XLocaleFallbackIterator.js"
+
+const ICU4XLocaleFallbackerWithConfig_box_destroy_registry = new FinalizationRegistry(underlying => {
+ wasm.ICU4XLocaleFallbackerWithConfig_destroy(underlying);
+});
+
+export class ICU4XLocaleFallbackerWithConfig {
+ #lifetimeEdges = [];
+ constructor(underlying, owned, edges) {
+ this.underlying = underlying;
+ this.#lifetimeEdges.push(...edges);
+ if (owned) {
+ ICU4XLocaleFallbackerWithConfig_box_destroy_registry.register(this, underlying);
+ }
+ }
+
+ fallback_for_locale(arg_locale) {
+ return new ICU4XLocaleFallbackIterator(wasm.ICU4XLocaleFallbackerWithConfig_fallback_for_locale(this.underlying, arg_locale.underlying), true, [this]);
+ }
+}