21 lines
689 B
JavaScript
21 lines
689 B
JavaScript
import wasm from "./diplomat-wasm.mjs"
|
|
import * as diplomatRuntime from "./diplomat-runtime.mjs"
|
|
|
|
const ICU4XGraphemeClusterBreakIteratorUtf16_box_destroy_registry = new FinalizationRegistry(underlying => {
|
|
wasm.ICU4XGraphemeClusterBreakIteratorUtf16_destroy(underlying);
|
|
});
|
|
|
|
export class ICU4XGraphemeClusterBreakIteratorUtf16 {
|
|
#lifetimeEdges = [];
|
|
constructor(underlying, owned, edges) {
|
|
this.underlying = underlying;
|
|
this.#lifetimeEdges.push(...edges);
|
|
if (owned) {
|
|
ICU4XGraphemeClusterBreakIteratorUtf16_box_destroy_registry.register(this, underlying);
|
|
}
|
|
}
|
|
|
|
next() {
|
|
return wasm.ICU4XGraphemeClusterBreakIteratorUtf16_next(this.underlying);
|
|
}
|
|
}
|