| 1 |
import wasm from "./diplomat-wasm.mjs" |
| 2 |
import * as diplomatRuntime from "./diplomat-runtime.mjs" |
| 3 |
import { ICU4XCodePointSetData } from "./ICU4XCodePointSetData.mjs" |
| 4 |
|
| 5 |
const ICU4XCodePointSetBuilder_box_destroy_registry = new FinalizationRegistry(underlying => { |
| 6 |
wasm.ICU4XCodePointSetBuilder_destroy(underlying); |
| 7 |
}); |
| 8 |
|
| 9 |
export class ICU4XCodePointSetBuilder { |
| 10 |
#lifetimeEdges = []; |
| 11 |
constructor(underlying, owned, edges) { |
| 12 |
this.underlying = underlying; |
| 13 |
this.#lifetimeEdges.push(...edges); |
| 14 |
if (owned) { |
| 15 |
ICU4XCodePointSetBuilder_box_destroy_registry.register(this, underlying); |
| 16 |
} |
| 17 |
} |
| 18 |
|
| 19 |
static create() { |
| 20 |
return new ICU4XCodePointSetBuilder(wasm.ICU4XCodePointSetBuilder_create(), true, []); |
| 21 |
} |
| 22 |
|
| 23 |
build() { |
| 24 |
return new ICU4XCodePointSetData(wasm.ICU4XCodePointSetBuilder_build(this.underlying), true, []); |
| 25 |
} |
| 26 |
|
| 27 |
complement() { |
| 28 |
wasm.ICU4XCodePointSetBuilder_complement(this.underlying); |
| 29 |
} |
| 30 |
|
| 31 |
is_empty() { |
| 32 |
return wasm.ICU4XCodePointSetBuilder_is_empty(this.underlying); |
| 33 |
} |
| 34 |
|
| 35 |
add_char(arg_ch) { |
| 36 |
wasm.ICU4XCodePointSetBuilder_add_char(this.underlying, diplomatRuntime.extractCodePoint(arg_ch, 'arg_ch')); |
| 37 |
} |
| 38 |
|
| 39 |
add_u32(arg_ch) { |
| 40 |
wasm.ICU4XCodePointSetBuilder_add_u32(this.underlying, arg_ch); |
| 41 |
} |
| 42 |
|
| 43 |
add_inclusive_range(arg_start, arg_end) { |
| 44 |
wasm.ICU4XCodePointSetBuilder_add_inclusive_range(this.underlying, diplomatRuntime.extractCodePoint(arg_start, 'arg_start'), diplomatRuntime.extractCodePoint(arg_end, 'arg_end')); |
| 45 |
} |
| 46 |
|
| 47 |
add_inclusive_range_u32(arg_start, arg_end) { |
| 48 |
wasm.ICU4XCodePointSetBuilder_add_inclusive_range_u32(this.underlying, arg_start, arg_end); |
| 49 |
} |
| 50 |
|
| 51 |
add_set(arg_data) { |
| 52 |
wasm.ICU4XCodePointSetBuilder_add_set(this.underlying, arg_data.underlying); |
| 53 |
} |
| 54 |
|
| 55 |
remove_char(arg_ch) { |
| 56 |
wasm.ICU4XCodePointSetBuilder_remove_char(this.underlying, diplomatRuntime.extractCodePoint(arg_ch, 'arg_ch')); |
| 57 |
} |
| 58 |
|
| 59 |
remove_inclusive_range(arg_start, arg_end) { |
| 60 |
wasm.ICU4XCodePointSetBuilder_remove_inclusive_range(this.underlying, diplomatRuntime.extractCodePoint(arg_start, 'arg_start'), diplomatRuntime.extractCodePoint(arg_end, 'arg_end')); |
| 61 |
} |
| 62 |
|
| 63 |
remove_set(arg_data) { |
| 64 |
wasm.ICU4XCodePointSetBuilder_remove_set(this.underlying, arg_data.underlying); |
| 65 |
} |
| 66 |
|
| 67 |
retain_char(arg_ch) { |
| 68 |
wasm.ICU4XCodePointSetBuilder_retain_char(this.underlying, diplomatRuntime.extractCodePoint(arg_ch, 'arg_ch')); |
| 69 |
} |
| 70 |
|
| 71 |
retain_inclusive_range(arg_start, arg_end) { |
| 72 |
wasm.ICU4XCodePointSetBuilder_retain_inclusive_range(this.underlying, diplomatRuntime.extractCodePoint(arg_start, 'arg_start'), diplomatRuntime.extractCodePoint(arg_end, 'arg_end')); |
| 73 |
} |
| 74 |
|
| 75 |
retain_set(arg_data) { |
| 76 |
wasm.ICU4XCodePointSetBuilder_retain_set(this.underlying, arg_data.underlying); |
| 77 |
} |
| 78 |
|
| 79 |
complement_char(arg_ch) { |
| 80 |
wasm.ICU4XCodePointSetBuilder_complement_char(this.underlying, diplomatRuntime.extractCodePoint(arg_ch, 'arg_ch')); |
| 81 |
} |
| 82 |
|
| 83 |
complement_inclusive_range(arg_start, arg_end) { |
| 84 |
wasm.ICU4XCodePointSetBuilder_complement_inclusive_range(this.underlying, diplomatRuntime.extractCodePoint(arg_start, 'arg_start'), diplomatRuntime.extractCodePoint(arg_end, 'arg_end')); |
| 85 |
} |
| 86 |
|
| 87 |
complement_set(arg_data) { |
| 88 |
wasm.ICU4XCodePointSetBuilder_complement_set(this.underlying, arg_data.underlying); |
| 89 |
} |
| 90 |
} |