blob: f4517683d205875c9afb3008debedae14413341f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import wasm from "./diplomat-wasm.mjs"
import * as diplomatRuntime from "./diplomat-runtime.js"
import { ICU4XSegmenterWordType_js_to_rust, ICU4XSegmenterWordType_rust_to_js } from "./ICU4XSegmenterWordType.js"
const ICU4XWordBreakIteratorUtf8_box_destroy_registry = new FinalizationRegistry(underlying => {
wasm.ICU4XWordBreakIteratorUtf8_destroy(underlying);
});
export class ICU4XWordBreakIteratorUtf8 {
#lifetimeEdges = [];
constructor(underlying, owned, edges) {
this.underlying = underlying;
this.#lifetimeEdges.push(...edges);
if (owned) {
ICU4XWordBreakIteratorUtf8_box_destroy_registry.register(this, underlying);
}
}
next() {
return wasm.ICU4XWordBreakIteratorUtf8_next(this.underlying);
}
word_type() {
return ICU4XSegmenterWordType_rust_to_js[wasm.ICU4XWordBreakIteratorUtf8_word_type(this.underlying)];
}
is_word_like() {
return wasm.ICU4XWordBreakIteratorUtf8_is_word_like(this.underlying);
}
}
|