|
| 1 | +let wasm; |
| 2 | +export function __wbg_set_wasm(val) { |
| 3 | + wasm = val; |
| 4 | +} |
| 5 | + |
| 6 | + |
| 7 | +const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; |
| 8 | + |
| 9 | +let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); |
| 10 | + |
| 11 | +cachedTextDecoder.decode(); |
| 12 | + |
| 13 | +let cachedUint8ArrayMemory0 = null; |
| 14 | + |
| 15 | +function getUint8ArrayMemory0() { |
| 16 | + if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { |
| 17 | + cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); |
| 18 | + } |
| 19 | + return cachedUint8ArrayMemory0; |
| 20 | +} |
| 21 | + |
| 22 | +function getStringFromWasm0(ptr, len) { |
| 23 | + ptr = ptr >>> 0; |
| 24 | + return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); |
| 25 | +} |
| 26 | + |
| 27 | +const TestFinalization = (typeof FinalizationRegistry === 'undefined') |
| 28 | + ? { register: () => {}, unregister: () => {} } |
| 29 | + : new FinalizationRegistry(ptr => wasm.__wbg_test_free(ptr >>> 0, 1)); |
| 30 | + |
| 31 | +export class Test { |
| 32 | + |
| 33 | + __destroy_into_raw() { |
| 34 | + const ptr = this.__wbg_ptr; |
| 35 | + this.__wbg_ptr = 0; |
| 36 | + TestFinalization.unregister(this); |
| 37 | + return ptr; |
| 38 | + } |
| 39 | + |
| 40 | + free() { |
| 41 | + const ptr = this.__destroy_into_raw(); |
| 42 | + wasm.__wbg_test_free(ptr, 0); |
| 43 | + } |
| 44 | + constructor() { |
| 45 | + const ret = wasm.test_new(); |
| 46 | + this.__wbg_ptr = ret >>> 0; |
| 47 | + TestFinalization.register(this, this.__wbg_ptr, this); |
| 48 | + return this; |
| 49 | + } |
| 50 | + consume_self() { |
| 51 | + const ptr = this.__destroy_into_raw(); |
| 52 | + wasm.test_consume_self(ptr); |
| 53 | + } |
| 54 | + ref_self() { |
| 55 | + wasm.test_ref_self(this.__wbg_ptr); |
| 56 | + } |
| 57 | + ref_mut_self() { |
| 58 | + wasm.test_ref_mut_self(this.__wbg_ptr); |
| 59 | + } |
| 60 | + self_Self() { |
| 61 | + const ptr = this.__destroy_into_raw(); |
| 62 | + wasm.test_self_Self(ptr); |
| 63 | + } |
| 64 | + self_ref_Self() { |
| 65 | + wasm.test_self_ref_Self(this.__wbg_ptr); |
| 66 | + } |
| 67 | + self_ref_mut_Self() { |
| 68 | + wasm.test_self_ref_mut_Self(this.__wbg_ptr); |
| 69 | + } |
| 70 | +} |
| 71 | + |
| 72 | +export function __wbindgen_throw(arg0, arg1) { |
| 73 | + throw new Error(getStringFromWasm0(arg0, arg1)); |
| 74 | +}; |
| 75 | + |
0 commit comments