@sanox/sangine-core 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assetFetcher.d.ts +3 -0
- package/dist/assetFetcher.d.ts.map +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +115 -109
- package/dist/rendererService.d.ts.map +1 -1
- package/dist/wasm/basis-decode/wasm_basis_decode.6c648416.js +283 -0
- package/dist/wasm/basis-decode/wasm_basis_decode.d.ts +3 -15
- package/dist/wasm/basis-decode/wasm_basis_decode_bg.6c648416.wasm +0 -0
- package/dist/wasm/basis-decode/wasm_basis_decode_bg.wasm.d.ts +1 -7
- package/dist/wasm/decode/{wasm_decode.bf116aa6.js → wasm_decode.b6df9f4e.js} +1 -1
- package/dist/wasm/decode/{wasm_decode_bg.bf116aa6.wasm → wasm_decode_bg.b6df9f4e.wasm} +0 -0
- package/dist/wasm/sangine/{sangine.10c8ee57.js → sangine.48c42a65.js} +1 -1
- package/dist/wasm/sangine/sangine.d.ts +1 -1
- package/dist/wasm/sangine/{sangine_bg.10c8ee57.wasm → sangine_bg.48c42a65.wasm} +0 -0
- package/dist/wasm/sangine/sangine_bg.wasm.d.ts +1 -1
- package/dist/wasm/sbo-decode/{wasm_sbo_decode.5c359661.js → wasm_sbo_decode.db6e2054.js} +39 -6
- package/dist/wasm/sbo-decode/wasm_sbo_decode_bg.db6e2054.wasm +0 -0
- package/dist/wasm-hashes/basis-decode.d.ts +2 -0
- package/dist/wasm-hashes/basis-decode.d.ts.map +1 -0
- package/dist/wasm-hashes/decode.d.ts +1 -1
- package/dist/wasm-hashes/sangine.d.ts +1 -1
- package/dist/wasm-hashes/sbo-decode.d.ts +2 -0
- package/dist/wasm-hashes/sbo-decode.d.ts.map +1 -0
- package/dist/worker/decodeWorkerImpl.d.ts.map +1 -1
- package/dist/worker/pool.d.ts +1 -1
- package/dist/worker/pool.d.ts.map +1 -1
- package/dist/worker/workerTask.d.ts +12 -0
- package/dist/worker/workerTask.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/wasm/basis-decode/snippets/basisu_c_sys-273c0aeb51b100af/wasm/basisu_transcoder.js +0 -2
- package/dist/wasm/basis-decode/snippets/basisu_c_sys-273c0aeb51b100af/wasm/basisu_transcoder.wasm +0 -0
- package/dist/wasm/basis-decode/wasm_basis_decode.a8b7eebd.js +0 -553
- package/dist/wasm/basis-decode/wasm_basis_decode_bg.a8b7eebd.wasm +0 -0
- package/dist/wasm/sbo-decode/wasm_sbo_decode_bg.5c359661.wasm +0 -0
|
@@ -1,553 +0,0 @@
|
|
|
1
|
-
/* @ts-self-types="./wasm_basis_decode.d.ts" */
|
|
2
|
-
import * as import1 from "./snippets/basisu_c_sys-273c0aeb51b100af/wasm/basisu_transcoder.js"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Initialize the embedded basisu transcoder WASM.
|
|
7
|
-
* Must be awaited once after the outer WASM module's `default()` init.
|
|
8
|
-
* @returns {Promise<any>}
|
|
9
|
-
*/
|
|
10
|
-
export function init_basis() {
|
|
11
|
-
const ret = wasm.init_basis();
|
|
12
|
-
return ret;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Transcode a KTX2/basis file to a GPU-compressed (or RGBA32) format.
|
|
17
|
-
*
|
|
18
|
-
* `format`: 0=RGBA32, 1=ETC2_RGBA8, 2=ASTC_4×4, 3=BC7
|
|
19
|
-
*
|
|
20
|
-
* Returns `{ data: Uint8Array, width: u32, height: u32, format: u32 }`.
|
|
21
|
-
* @param {Uint8Array} data
|
|
22
|
-
* @param {number} format
|
|
23
|
-
* @returns {object}
|
|
24
|
-
*/
|
|
25
|
-
export function transcode_basis(data, format) {
|
|
26
|
-
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
27
|
-
const len0 = WASM_VECTOR_LEN;
|
|
28
|
-
const ret = wasm.transcode_basis(ptr0, len0, format);
|
|
29
|
-
if (ret[2]) {
|
|
30
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
31
|
-
}
|
|
32
|
-
return takeFromExternrefTable0(ret[0]);
|
|
33
|
-
}
|
|
34
|
-
function __wbg_get_imports() {
|
|
35
|
-
const import0 = {
|
|
36
|
-
__proto__: null,
|
|
37
|
-
__wbg_HEAPU8_153c54682533edcc: function(arg0) {
|
|
38
|
-
const ret = arg0.HEAPU8;
|
|
39
|
-
return ret;
|
|
40
|
-
},
|
|
41
|
-
__wbg___wbindgen_debug_string_ab4b34d23d6778bd: function(arg0, arg1) {
|
|
42
|
-
const ret = debugString(arg1);
|
|
43
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
44
|
-
const len1 = WASM_VECTOR_LEN;
|
|
45
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
46
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
47
|
-
},
|
|
48
|
-
__wbg___wbindgen_is_function_3baa9db1a987f47d: function(arg0) {
|
|
49
|
-
const ret = typeof(arg0) === 'function';
|
|
50
|
-
return ret;
|
|
51
|
-
},
|
|
52
|
-
__wbg___wbindgen_is_undefined_29a43b4d42920abd: function(arg0) {
|
|
53
|
-
const ret = arg0 === undefined;
|
|
54
|
-
return ret;
|
|
55
|
-
},
|
|
56
|
-
__wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
|
|
57
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
58
|
-
},
|
|
59
|
-
__wbg__bt_alloc_996c13d90dbf94e7: function(arg0, arg1) {
|
|
60
|
-
const ret = arg0._bt_alloc(BigInt.asUintN(64, arg1));
|
|
61
|
-
return ret;
|
|
62
|
-
},
|
|
63
|
-
__wbg__bt_basis_compute_transcoded_image_size_in_bytes_b7f2fe186a6e8349: function(arg0, arg1, arg2, arg3) {
|
|
64
|
-
const ret = arg0._bt_basis_compute_transcoded_image_size_in_bytes(arg1 >>> 0, arg2 >>> 0, arg3 >>> 0);
|
|
65
|
-
return ret;
|
|
66
|
-
},
|
|
67
|
-
__wbg__bt_basis_get_bytes_per_block_or_pixel_55cb380affe87d99: function(arg0, arg1) {
|
|
68
|
-
const ret = arg0._bt_basis_get_bytes_per_block_or_pixel(arg1 >>> 0);
|
|
69
|
-
return ret;
|
|
70
|
-
},
|
|
71
|
-
__wbg__bt_free_4a75f61f6d796adf: function(arg0, arg1) {
|
|
72
|
-
arg0._bt_free(BigInt.asUintN(64, arg1));
|
|
73
|
-
},
|
|
74
|
-
__wbg__bt_init_bf4d6cc29d0f4ba7: function(arg0) {
|
|
75
|
-
arg0._bt_init();
|
|
76
|
-
},
|
|
77
|
-
__wbg__bt_ktx2_close_5f0389f38446b6d9: function(arg0, arg1) {
|
|
78
|
-
arg0._bt_ktx2_close(BigInt.asUintN(64, arg1));
|
|
79
|
-
},
|
|
80
|
-
__wbg__bt_ktx2_get_height_9e89d57dd5609461: function(arg0, arg1) {
|
|
81
|
-
const ret = arg0._bt_ktx2_get_height(BigInt.asUintN(64, arg1));
|
|
82
|
-
return ret;
|
|
83
|
-
},
|
|
84
|
-
__wbg__bt_ktx2_get_width_95780eb40045edd9: function(arg0, arg1) {
|
|
85
|
-
const ret = arg0._bt_ktx2_get_width(BigInt.asUintN(64, arg1));
|
|
86
|
-
return ret;
|
|
87
|
-
},
|
|
88
|
-
__wbg__bt_ktx2_open_4921a842ef17b5bd: function(arg0, arg1, arg2) {
|
|
89
|
-
const ret = arg0._bt_ktx2_open(BigInt.asUintN(64, arg1), arg2 >>> 0);
|
|
90
|
-
return ret;
|
|
91
|
-
},
|
|
92
|
-
__wbg__bt_ktx2_start_transcoding_1299f54a65ef35ca: function(arg0, arg1) {
|
|
93
|
-
const ret = arg0._bt_ktx2_start_transcoding(BigInt.asUintN(64, arg1));
|
|
94
|
-
return ret;
|
|
95
|
-
},
|
|
96
|
-
__wbg__bt_ktx2_transcode_image_level_5b2d35b01da6e6cc: function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13) {
|
|
97
|
-
const ret = arg0._bt_ktx2_transcode_image_level(BigInt.asUintN(64, arg1), arg2 >>> 0, arg3 >>> 0, arg4 >>> 0, BigInt.asUintN(64, arg5), arg6 >>> 0, arg7 >>> 0, arg8 >>> 0, arg9 >>> 0, arg10 >>> 0, arg11, arg12, BigInt.asUintN(64, arg13));
|
|
98
|
-
return ret;
|
|
99
|
-
},
|
|
100
|
-
__wbg__wbg_cb_unref_b46c9b5a9f08ec37: function(arg0) {
|
|
101
|
-
arg0._wbg_cb_unref();
|
|
102
|
-
},
|
|
103
|
-
__wbg_call_a24592a6f349a97e: function() { return handleError(function (arg0, arg1, arg2) {
|
|
104
|
-
const ret = arg0.call(arg1, arg2);
|
|
105
|
-
return ret;
|
|
106
|
-
}, arguments); },
|
|
107
|
-
__wbg_length_9f1775224cf1d815: function(arg0) {
|
|
108
|
-
const ret = arg0.length;
|
|
109
|
-
return ret;
|
|
110
|
-
},
|
|
111
|
-
__wbg_new_aa8d0fa9762c29bd: function() {
|
|
112
|
-
const ret = new Object();
|
|
113
|
-
return ret;
|
|
114
|
-
},
|
|
115
|
-
__wbg_new_from_slice_b5ea43e23f6008c0: function(arg0, arg1) {
|
|
116
|
-
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
117
|
-
return ret;
|
|
118
|
-
},
|
|
119
|
-
__wbg_new_typed_323f37fd55ab048d: function(arg0, arg1) {
|
|
120
|
-
try {
|
|
121
|
-
var state0 = {a: arg0, b: arg1};
|
|
122
|
-
var cb0 = (arg0, arg1) => {
|
|
123
|
-
const a = state0.a;
|
|
124
|
-
state0.a = 0;
|
|
125
|
-
try {
|
|
126
|
-
return wasm_bindgen__convert__closures_____invoke__h16cb8cb7feea2290(a, state0.b, arg0, arg1);
|
|
127
|
-
} finally {
|
|
128
|
-
state0.a = a;
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
const ret = new Promise(cb0);
|
|
132
|
-
return ret;
|
|
133
|
-
} finally {
|
|
134
|
-
state0.a = 0;
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
__wbg_prototypesetcall_a6b02eb00b0f4ce2: function(arg0, arg1, arg2) {
|
|
138
|
-
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
139
|
-
},
|
|
140
|
-
__wbg_queueMicrotask_5d15a957e6aa920e: function(arg0) {
|
|
141
|
-
queueMicrotask(arg0);
|
|
142
|
-
},
|
|
143
|
-
__wbg_queueMicrotask_f8819e5ffc402f36: function(arg0) {
|
|
144
|
-
const ret = arg0.queueMicrotask;
|
|
145
|
-
return ret;
|
|
146
|
-
},
|
|
147
|
-
__wbg_resolve_e6c466bc1052f16c: function(arg0) {
|
|
148
|
-
const ret = Promise.resolve(arg0);
|
|
149
|
-
return ret;
|
|
150
|
-
},
|
|
151
|
-
__wbg_set_022bee52d0b05b19: function() { return handleError(function (arg0, arg1, arg2) {
|
|
152
|
-
const ret = Reflect.set(arg0, arg1, arg2);
|
|
153
|
-
return ret;
|
|
154
|
-
}, arguments); },
|
|
155
|
-
__wbg_set_d8f1efe557b9e7e1: function(arg0, arg1, arg2) {
|
|
156
|
-
arg0.set(arg1, arg2 >>> 0);
|
|
157
|
-
},
|
|
158
|
-
__wbg_static_accessor_GLOBAL_8cfadc87a297ca02: function() {
|
|
159
|
-
const ret = typeof global === 'undefined' ? null : global;
|
|
160
|
-
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
161
|
-
},
|
|
162
|
-
__wbg_static_accessor_GLOBAL_THIS_602256ae5c8f42cf: function() {
|
|
163
|
-
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
164
|
-
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
165
|
-
},
|
|
166
|
-
__wbg_static_accessor_SELF_e445c1c7484aecc3: function() {
|
|
167
|
-
const ret = typeof self === 'undefined' ? null : self;
|
|
168
|
-
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
169
|
-
},
|
|
170
|
-
__wbg_static_accessor_WINDOW_f20e8576ef1e0f17: function() {
|
|
171
|
-
const ret = typeof window === 'undefined' ? null : window;
|
|
172
|
-
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
173
|
-
},
|
|
174
|
-
__wbg_subarray_f8ca46a25b1f5e0d: function(arg0, arg1, arg2) {
|
|
175
|
-
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
176
|
-
return ret;
|
|
177
|
-
},
|
|
178
|
-
__wbg_then_792e0c862b060889: function(arg0, arg1, arg2) {
|
|
179
|
-
const ret = arg0.then(arg1, arg2);
|
|
180
|
-
return ret;
|
|
181
|
-
},
|
|
182
|
-
__wbg_then_8e16ee11f05e4827: function(arg0, arg1) {
|
|
183
|
-
const ret = arg0.then(arg1);
|
|
184
|
-
return ret;
|
|
185
|
-
},
|
|
186
|
-
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
187
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 32, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
188
|
-
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h1a884335adcc7c22);
|
|
189
|
-
return ret;
|
|
190
|
-
},
|
|
191
|
-
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
192
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 42, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
193
|
-
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hfcaf9f68983c0e6f);
|
|
194
|
-
return ret;
|
|
195
|
-
},
|
|
196
|
-
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
197
|
-
// Cast intrinsic for `F64 -> Externref`.
|
|
198
|
-
const ret = arg0;
|
|
199
|
-
return ret;
|
|
200
|
-
},
|
|
201
|
-
__wbindgen_cast_0000000000000004: function(arg0, arg1) {
|
|
202
|
-
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
203
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
204
|
-
return ret;
|
|
205
|
-
},
|
|
206
|
-
__wbindgen_init_externref_table: function() {
|
|
207
|
-
const table = wasm.__wbindgen_externrefs;
|
|
208
|
-
const offset = table.grow(4);
|
|
209
|
-
table.set(0, undefined);
|
|
210
|
-
table.set(offset + 0, undefined);
|
|
211
|
-
table.set(offset + 1, null);
|
|
212
|
-
table.set(offset + 2, true);
|
|
213
|
-
table.set(offset + 3, false);
|
|
214
|
-
},
|
|
215
|
-
};
|
|
216
|
-
return {
|
|
217
|
-
__proto__: null,
|
|
218
|
-
"./wasm_basis_decode_bg.js": import0,
|
|
219
|
-
"./snippets/basisu_c_sys-273c0aeb51b100af/wasm/basisu_transcoder.js": import1,
|
|
220
|
-
};
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function wasm_bindgen__convert__closures_____invoke__h1a884335adcc7c22(arg0, arg1, arg2) {
|
|
224
|
-
const ret = wasm.wasm_bindgen__convert__closures_____invoke__h1a884335adcc7c22(arg0, arg1, arg2);
|
|
225
|
-
if (ret[1]) {
|
|
226
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
function wasm_bindgen__convert__closures_____invoke__hfcaf9f68983c0e6f(arg0, arg1, arg2) {
|
|
231
|
-
const ret = wasm.wasm_bindgen__convert__closures_____invoke__hfcaf9f68983c0e6f(arg0, arg1, arg2);
|
|
232
|
-
if (ret[1]) {
|
|
233
|
-
throw takeFromExternrefTable0(ret[0]);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
function wasm_bindgen__convert__closures_____invoke__h16cb8cb7feea2290(arg0, arg1, arg2, arg3) {
|
|
238
|
-
wasm.wasm_bindgen__convert__closures_____invoke__h16cb8cb7feea2290(arg0, arg1, arg2, arg3);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
function addToExternrefTable0(obj) {
|
|
242
|
-
const idx = wasm.__externref_table_alloc();
|
|
243
|
-
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
244
|
-
return idx;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
248
|
-
? { register: () => {}, unregister: () => {} }
|
|
249
|
-
: new FinalizationRegistry(state => wasm.__wbindgen_destroy_closure(state.a, state.b));
|
|
250
|
-
|
|
251
|
-
function debugString(val) {
|
|
252
|
-
// primitive types
|
|
253
|
-
const type = typeof val;
|
|
254
|
-
if (type == 'number' || type == 'boolean' || val == null) {
|
|
255
|
-
return `${val}`;
|
|
256
|
-
}
|
|
257
|
-
if (type == 'string') {
|
|
258
|
-
return `"${val}"`;
|
|
259
|
-
}
|
|
260
|
-
if (type == 'symbol') {
|
|
261
|
-
const description = val.description;
|
|
262
|
-
if (description == null) {
|
|
263
|
-
return 'Symbol';
|
|
264
|
-
} else {
|
|
265
|
-
return `Symbol(${description})`;
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
if (type == 'function') {
|
|
269
|
-
const name = val.name;
|
|
270
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
271
|
-
return `Function(${name})`;
|
|
272
|
-
} else {
|
|
273
|
-
return 'Function';
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
// objects
|
|
277
|
-
if (Array.isArray(val)) {
|
|
278
|
-
const length = val.length;
|
|
279
|
-
let debug = '[';
|
|
280
|
-
if (length > 0) {
|
|
281
|
-
debug += debugString(val[0]);
|
|
282
|
-
}
|
|
283
|
-
for(let i = 1; i < length; i++) {
|
|
284
|
-
debug += ', ' + debugString(val[i]);
|
|
285
|
-
}
|
|
286
|
-
debug += ']';
|
|
287
|
-
return debug;
|
|
288
|
-
}
|
|
289
|
-
// Test for built-in
|
|
290
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
291
|
-
let className;
|
|
292
|
-
if (builtInMatches && builtInMatches.length > 1) {
|
|
293
|
-
className = builtInMatches[1];
|
|
294
|
-
} else {
|
|
295
|
-
// Failed to match the standard '[object ClassName]'
|
|
296
|
-
return toString.call(val);
|
|
297
|
-
}
|
|
298
|
-
if (className == 'Object') {
|
|
299
|
-
// we're a user defined class or Object
|
|
300
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
301
|
-
// easier than looping through ownProperties of `val`.
|
|
302
|
-
try {
|
|
303
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
304
|
-
} catch (_) {
|
|
305
|
-
return 'Object';
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
// errors
|
|
309
|
-
if (val instanceof Error) {
|
|
310
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
311
|
-
}
|
|
312
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
313
|
-
return className;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
317
|
-
ptr = ptr >>> 0;
|
|
318
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
let cachedDataViewMemory0 = null;
|
|
322
|
-
function getDataViewMemory0() {
|
|
323
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
324
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
325
|
-
}
|
|
326
|
-
return cachedDataViewMemory0;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
function getStringFromWasm0(ptr, len) {
|
|
330
|
-
ptr = ptr >>> 0;
|
|
331
|
-
return decodeText(ptr, len);
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
let cachedUint8ArrayMemory0 = null;
|
|
335
|
-
function getUint8ArrayMemory0() {
|
|
336
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
337
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
338
|
-
}
|
|
339
|
-
return cachedUint8ArrayMemory0;
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
function handleError(f, args) {
|
|
343
|
-
try {
|
|
344
|
-
return f.apply(this, args);
|
|
345
|
-
} catch (e) {
|
|
346
|
-
const idx = addToExternrefTable0(e);
|
|
347
|
-
wasm.__wbindgen_exn_store(idx);
|
|
348
|
-
}
|
|
349
|
-
}
|
|
350
|
-
|
|
351
|
-
function isLikeNone(x) {
|
|
352
|
-
return x === undefined || x === null;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
function makeMutClosure(arg0, arg1, f) {
|
|
356
|
-
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
357
|
-
const real = (...args) => {
|
|
358
|
-
|
|
359
|
-
// First up with a closure we increment the internal reference
|
|
360
|
-
// count. This ensures that the Rust closure environment won't
|
|
361
|
-
// be deallocated while we're invoking it.
|
|
362
|
-
state.cnt++;
|
|
363
|
-
const a = state.a;
|
|
364
|
-
state.a = 0;
|
|
365
|
-
try {
|
|
366
|
-
return f(a, state.b, ...args);
|
|
367
|
-
} finally {
|
|
368
|
-
state.a = a;
|
|
369
|
-
real._wbg_cb_unref();
|
|
370
|
-
}
|
|
371
|
-
};
|
|
372
|
-
real._wbg_cb_unref = () => {
|
|
373
|
-
if (--state.cnt === 0) {
|
|
374
|
-
wasm.__wbindgen_destroy_closure(state.a, state.b);
|
|
375
|
-
state.a = 0;
|
|
376
|
-
CLOSURE_DTORS.unregister(state);
|
|
377
|
-
}
|
|
378
|
-
};
|
|
379
|
-
CLOSURE_DTORS.register(real, state, state);
|
|
380
|
-
return real;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
384
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
385
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
386
|
-
WASM_VECTOR_LEN = arg.length;
|
|
387
|
-
return ptr;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
391
|
-
if (realloc === undefined) {
|
|
392
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
393
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
394
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
395
|
-
WASM_VECTOR_LEN = buf.length;
|
|
396
|
-
return ptr;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
let len = arg.length;
|
|
400
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
401
|
-
|
|
402
|
-
const mem = getUint8ArrayMemory0();
|
|
403
|
-
|
|
404
|
-
let offset = 0;
|
|
405
|
-
|
|
406
|
-
for (; offset < len; offset++) {
|
|
407
|
-
const code = arg.charCodeAt(offset);
|
|
408
|
-
if (code > 0x7F) break;
|
|
409
|
-
mem[ptr + offset] = code;
|
|
410
|
-
}
|
|
411
|
-
if (offset !== len) {
|
|
412
|
-
if (offset !== 0) {
|
|
413
|
-
arg = arg.slice(offset);
|
|
414
|
-
}
|
|
415
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
416
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
417
|
-
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
418
|
-
|
|
419
|
-
offset += ret.written;
|
|
420
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
WASM_VECTOR_LEN = offset;
|
|
424
|
-
return ptr;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
function takeFromExternrefTable0(idx) {
|
|
428
|
-
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
429
|
-
wasm.__externref_table_dealloc(idx);
|
|
430
|
-
return value;
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
434
|
-
cachedTextDecoder.decode();
|
|
435
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
436
|
-
let numBytesDecoded = 0;
|
|
437
|
-
function decodeText(ptr, len) {
|
|
438
|
-
numBytesDecoded += len;
|
|
439
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
440
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
441
|
-
cachedTextDecoder.decode();
|
|
442
|
-
numBytesDecoded = len;
|
|
443
|
-
}
|
|
444
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
const cachedTextEncoder = new TextEncoder();
|
|
448
|
-
|
|
449
|
-
if (!('encodeInto' in cachedTextEncoder)) {
|
|
450
|
-
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
451
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
452
|
-
view.set(buf);
|
|
453
|
-
return {
|
|
454
|
-
read: arg.length,
|
|
455
|
-
written: buf.length
|
|
456
|
-
};
|
|
457
|
-
};
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
let WASM_VECTOR_LEN = 0;
|
|
461
|
-
|
|
462
|
-
let wasmModule, wasm;
|
|
463
|
-
function __wbg_finalize_init(instance, module) {
|
|
464
|
-
wasm = instance.exports;
|
|
465
|
-
wasmModule = module;
|
|
466
|
-
cachedDataViewMemory0 = null;
|
|
467
|
-
cachedUint8ArrayMemory0 = null;
|
|
468
|
-
wasm.__wbindgen_start();
|
|
469
|
-
return wasm;
|
|
470
|
-
}
|
|
471
|
-
|
|
472
|
-
async function __wbg_load(module, imports) {
|
|
473
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
474
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
475
|
-
try {
|
|
476
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
477
|
-
} catch (e) {
|
|
478
|
-
const validResponse = module.ok && expectedResponseType(module.type);
|
|
479
|
-
|
|
480
|
-
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
481
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
482
|
-
|
|
483
|
-
} else { throw e; }
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
const bytes = await module.arrayBuffer();
|
|
488
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
489
|
-
} else {
|
|
490
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
491
|
-
|
|
492
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
493
|
-
return { instance, module };
|
|
494
|
-
} else {
|
|
495
|
-
return instance;
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
function expectedResponseType(type) {
|
|
500
|
-
switch (type) {
|
|
501
|
-
case 'basic': case 'cors': case 'default': return true;
|
|
502
|
-
}
|
|
503
|
-
return false;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
|
|
507
|
-
function initSync(module) {
|
|
508
|
-
if (wasm !== undefined) return wasm;
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
if (module !== undefined) {
|
|
512
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
513
|
-
({module} = module)
|
|
514
|
-
} else {
|
|
515
|
-
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
const imports = __wbg_get_imports();
|
|
520
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
521
|
-
module = new WebAssembly.Module(module);
|
|
522
|
-
}
|
|
523
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
524
|
-
return __wbg_finalize_init(instance, module);
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
async function __wbg_init(module_or_path) {
|
|
528
|
-
if (wasm !== undefined) return wasm;
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
if (module_or_path !== undefined) {
|
|
532
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
533
|
-
({module_or_path} = module_or_path)
|
|
534
|
-
} else {
|
|
535
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
if (module_or_path === undefined) {
|
|
540
|
-
module_or_path = new URL('wasm_basis_decode_bg.a8b7eebd.wasm', import.meta.url);
|
|
541
|
-
}
|
|
542
|
-
const imports = __wbg_get_imports();
|
|
543
|
-
|
|
544
|
-
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
545
|
-
module_or_path = fetch(module_or_path);
|
|
546
|
-
}
|
|
547
|
-
|
|
548
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
549
|
-
|
|
550
|
-
return __wbg_finalize_init(instance, module);
|
|
551
|
-
}
|
|
552
|
-
|
|
553
|
-
export { initSync, __wbg_init as default };
|
|
Binary file
|
|
Binary file
|