@draco-rust/decoder 0.0.0-stage → 0.1.1
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/LICENSE +252 -0
- package/README.md +68 -2
- package/index.d.ts +59 -0
- package/index.js +350 -0
- package/index_bg.wasm +0 -0
- package/index_bg.wasm.d.ts +12 -0
- package/legacy/index.d.ts +59 -0
- package/legacy/index.js +350 -0
- package/legacy/index_bg.wasm +0 -0
- package/legacy/index_bg.wasm.d.ts +12 -0
- package/mesh/index.d.ts +59 -0
- package/mesh/index.js +350 -0
- package/mesh/index_bg.wasm +0 -0
- package/mesh/index_bg.wasm.d.ts +12 -0
- package/package.json +60 -4
- package/point-cloud/index.d.ts +59 -0
- package/point-cloud/index.js +350 -0
- package/point-cloud/index_bg.wasm +0 -0
- package/point-cloud/index_bg.wasm.d.ts +12 -0
package/mesh/index.js
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/* @ts-self-types="./index.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Install the panic hook, so a panic reads as a message rather than a trap.
|
|
5
|
+
*/
|
|
6
|
+
export function init() {
|
|
7
|
+
wasm.init();
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Decode a standalone Draco payload.
|
|
12
|
+
* @param {Uint8Array} data
|
|
13
|
+
* @returns {any}
|
|
14
|
+
*/
|
|
15
|
+
export function parse_drc_bytes(data) {
|
|
16
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_export2);
|
|
17
|
+
const len0 = WASM_VECTOR_LEN;
|
|
18
|
+
const ret = wasm.parse_drc_bytes(ptr0, len0);
|
|
19
|
+
return takeObject(ret);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* File extensions this module reads and writes.
|
|
24
|
+
* @returns {string[]}
|
|
25
|
+
*/
|
|
26
|
+
export function supported_extensions() {
|
|
27
|
+
try {
|
|
28
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
29
|
+
wasm.supported_extensions(retptr);
|
|
30
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
31
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
32
|
+
var v1 = getArrayJsValueFromWasm0(r0, r1);
|
|
33
|
+
wasm.__wbindgen_export3(r0, r1 * 4, 4);
|
|
34
|
+
return v1;
|
|
35
|
+
} finally {
|
|
36
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The version of this WASM module.
|
|
42
|
+
* @returns {string}
|
|
43
|
+
*/
|
|
44
|
+
export function version() {
|
|
45
|
+
let deferred1_0;
|
|
46
|
+
let deferred1_1;
|
|
47
|
+
try {
|
|
48
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
49
|
+
wasm.version(retptr);
|
|
50
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
51
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
52
|
+
deferred1_0 = r0;
|
|
53
|
+
deferred1_1 = r1;
|
|
54
|
+
return getStringFromWasm0(r0, r1);
|
|
55
|
+
} finally {
|
|
56
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
57
|
+
wasm.__wbindgen_export3(deferred1_0, deferred1_1, 1);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function __wbg_get_imports() {
|
|
61
|
+
const import0 = {
|
|
62
|
+
__proto__: null,
|
|
63
|
+
__wbg___wbindgen_throw_41e9ee4f547fc59a: function(arg0, arg1) {
|
|
64
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
65
|
+
},
|
|
66
|
+
__wbg_new_617a8cdb8bb1130e: function() {
|
|
67
|
+
const ret = new Object();
|
|
68
|
+
return addHeapObject(ret);
|
|
69
|
+
},
|
|
70
|
+
__wbg_new_ee2291f50781bf1d: function() {
|
|
71
|
+
const ret = new Array();
|
|
72
|
+
return addHeapObject(ret);
|
|
73
|
+
},
|
|
74
|
+
__wbg_new_from_slice_37a3c3a194266cb8: function(arg0, arg1) {
|
|
75
|
+
const ret = new Uint32Array(getArrayU32FromWasm0(arg0, arg1));
|
|
76
|
+
return addHeapObject(ret);
|
|
77
|
+
},
|
|
78
|
+
__wbg_new_from_slice_9a868026ffa4208a: function(arg0, arg1) {
|
|
79
|
+
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
80
|
+
return addHeapObject(ret);
|
|
81
|
+
},
|
|
82
|
+
__wbg_new_from_slice_ca6ad97db1f4779a: function(arg0, arg1) {
|
|
83
|
+
const ret = new Float32Array(getArrayF32FromWasm0(arg0, arg1));
|
|
84
|
+
return addHeapObject(ret);
|
|
85
|
+
},
|
|
86
|
+
__wbg_new_from_slice_f545fd22ddc142b8: function(arg0, arg1) {
|
|
87
|
+
const ret = new Float64Array(getArrayF64FromWasm0(arg0, arg1));
|
|
88
|
+
return addHeapObject(ret);
|
|
89
|
+
},
|
|
90
|
+
__wbg_push_2baf45db356cf468: function(arg0, arg1) {
|
|
91
|
+
const ret = getObject(arg0).push(getObject(arg1));
|
|
92
|
+
return ret;
|
|
93
|
+
},
|
|
94
|
+
__wbg_set_145a351398b48c65: function() { return handleError(function (arg0, arg1, arg2) {
|
|
95
|
+
const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2));
|
|
96
|
+
return ret;
|
|
97
|
+
}, arguments); },
|
|
98
|
+
__wbindgen_generic_0000000000000001: function(arg0) {
|
|
99
|
+
// Cast intrinsic for `F64 -> Externref`.
|
|
100
|
+
const ret = arg0;
|
|
101
|
+
return addHeapObject(ret);
|
|
102
|
+
},
|
|
103
|
+
__wbindgen_generic_0000000000000002: function(arg0, arg1) {
|
|
104
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
105
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
106
|
+
return addHeapObject(ret);
|
|
107
|
+
},
|
|
108
|
+
__wbindgen_object_drop_ref: function(arg0) {
|
|
109
|
+
takeObject(arg0);
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
return {
|
|
113
|
+
__proto__: null,
|
|
114
|
+
"./index_bg.js": import0,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function addHeapObject(obj) {
|
|
119
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
120
|
+
const idx = heap_next;
|
|
121
|
+
heap_next = heap[idx];
|
|
122
|
+
|
|
123
|
+
heap[idx] = obj;
|
|
124
|
+
return idx;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function dropObject(idx) {
|
|
128
|
+
if (idx < 1028) return;
|
|
129
|
+
heap[idx] = heap_next;
|
|
130
|
+
heap_next = idx;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function getArrayF32FromWasm0(ptr, len) {
|
|
134
|
+
ptr = ptr >>> 0;
|
|
135
|
+
return getFloat32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
function getArrayF64FromWasm0(ptr, len) {
|
|
139
|
+
ptr = ptr >>> 0;
|
|
140
|
+
return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function getArrayJsValueFromWasm0(ptr, len) {
|
|
144
|
+
ptr = ptr >>> 0;
|
|
145
|
+
const mem = getDataViewMemory0();
|
|
146
|
+
const result = [];
|
|
147
|
+
for (let i = ptr; i < ptr + 4 * len; i += 4) {
|
|
148
|
+
result.push(takeObject(mem.getUint32(i, true)));
|
|
149
|
+
}
|
|
150
|
+
return result;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
154
|
+
ptr = ptr >>> 0;
|
|
155
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
159
|
+
ptr = ptr >>> 0;
|
|
160
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
let cachedDataViewMemory0 = null;
|
|
164
|
+
function getDataViewMemory0() {
|
|
165
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
166
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
167
|
+
}
|
|
168
|
+
return cachedDataViewMemory0;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
let cachedFloat32ArrayMemory0 = null;
|
|
172
|
+
function getFloat32ArrayMemory0() {
|
|
173
|
+
if (cachedFloat32ArrayMemory0 === null || cachedFloat32ArrayMemory0.byteLength === 0) {
|
|
174
|
+
cachedFloat32ArrayMemory0 = new Float32Array(wasm.memory.buffer);
|
|
175
|
+
}
|
|
176
|
+
return cachedFloat32ArrayMemory0;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
let cachedFloat64ArrayMemory0 = null;
|
|
180
|
+
function getFloat64ArrayMemory0() {
|
|
181
|
+
if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
|
|
182
|
+
cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
|
|
183
|
+
}
|
|
184
|
+
return cachedFloat64ArrayMemory0;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
function getStringFromWasm0(ptr, len) {
|
|
188
|
+
return decodeText(ptr >>> 0, len);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
let cachedUint32ArrayMemory0 = null;
|
|
192
|
+
function getUint32ArrayMemory0() {
|
|
193
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
194
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
195
|
+
}
|
|
196
|
+
return cachedUint32ArrayMemory0;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
let cachedUint8ArrayMemory0 = null;
|
|
200
|
+
function getUint8ArrayMemory0() {
|
|
201
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
202
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
203
|
+
}
|
|
204
|
+
return cachedUint8ArrayMemory0;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
function getObject(idx) { return heap[idx]; }
|
|
208
|
+
|
|
209
|
+
function handleError(f, args) {
|
|
210
|
+
try {
|
|
211
|
+
return f.apply(this, args);
|
|
212
|
+
} catch (e) {
|
|
213
|
+
wasm.__wbindgen_export(addHeapObject(e));
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
let heap = new Array(1024).fill(undefined);
|
|
218
|
+
heap.push(undefined, null, true, false);
|
|
219
|
+
|
|
220
|
+
let heap_next = heap.length;
|
|
221
|
+
|
|
222
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
223
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
224
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
225
|
+
WASM_VECTOR_LEN = arg.length;
|
|
226
|
+
return ptr;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
function takeObject(idx) {
|
|
230
|
+
const ret = getObject(idx);
|
|
231
|
+
dropObject(idx);
|
|
232
|
+
return ret;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
236
|
+
cachedTextDecoder.decode();
|
|
237
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
238
|
+
let numBytesDecoded = 0;
|
|
239
|
+
function decodeText(ptr, len) {
|
|
240
|
+
numBytesDecoded += len;
|
|
241
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
242
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
243
|
+
cachedTextDecoder.decode();
|
|
244
|
+
numBytesDecoded = len;
|
|
245
|
+
}
|
|
246
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
let WASM_VECTOR_LEN = 0;
|
|
250
|
+
|
|
251
|
+
let wasmModule, wasmInstance, wasm;
|
|
252
|
+
function __wbg_finalize_init(instance, module) {
|
|
253
|
+
wasmInstance = instance;
|
|
254
|
+
wasm = instance.exports;
|
|
255
|
+
wasmModule = module;
|
|
256
|
+
cachedDataViewMemory0 = null;
|
|
257
|
+
cachedFloat32ArrayMemory0 = null;
|
|
258
|
+
cachedFloat64ArrayMemory0 = null;
|
|
259
|
+
cachedUint32ArrayMemory0 = null;
|
|
260
|
+
cachedUint8ArrayMemory0 = null;
|
|
261
|
+
wasm.__wbindgen_start();
|
|
262
|
+
return wasm;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
async function __wbg_load(module, imports) {
|
|
266
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
267
|
+
if (!module.ok) {
|
|
268
|
+
throw new Error(`failed to fetch Wasm: ${module.status} ${module.statusText} fetching '${module.url}'`);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
272
|
+
try {
|
|
273
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
274
|
+
} catch (e) {
|
|
275
|
+
const validResponse = expectedResponseType(module.type);
|
|
276
|
+
|
|
277
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
278
|
+
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);
|
|
279
|
+
|
|
280
|
+
} else { throw e; }
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
const bytes = await module.arrayBuffer();
|
|
285
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
286
|
+
} else {
|
|
287
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
288
|
+
|
|
289
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
290
|
+
return { instance, module };
|
|
291
|
+
} else {
|
|
292
|
+
return instance;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
function expectedResponseType(type) {
|
|
297
|
+
switch (type) {
|
|
298
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
299
|
+
}
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function initSync(module) {
|
|
305
|
+
if (wasm !== undefined) return wasm;
|
|
306
|
+
|
|
307
|
+
|
|
308
|
+
if (module !== undefined) {
|
|
309
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
310
|
+
({module} = module)
|
|
311
|
+
} else {
|
|
312
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const imports = __wbg_get_imports();
|
|
317
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
318
|
+
module = new WebAssembly.Module(module);
|
|
319
|
+
}
|
|
320
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
321
|
+
return __wbg_finalize_init(instance, module);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
async function __wbg_init(module_or_path) {
|
|
325
|
+
if (wasm !== undefined) return wasm;
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
if (module_or_path !== undefined) {
|
|
329
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
330
|
+
({module_or_path} = module_or_path)
|
|
331
|
+
} else {
|
|
332
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
if (module_or_path === undefined) {
|
|
337
|
+
module_or_path = new URL('index_bg.wasm', import.meta.url);
|
|
338
|
+
}
|
|
339
|
+
const imports = __wbg_get_imports();
|
|
340
|
+
|
|
341
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
342
|
+
module_or_path = fetch(module_or_path);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
346
|
+
|
|
347
|
+
return __wbg_finalize_init(instance, module);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
export { initSync, __wbg_init as default };
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const init: () => void;
|
|
5
|
+
export const parse_drc_bytes: (a: number, b: number) => number;
|
|
6
|
+
export const supported_extensions: (a: number) => void;
|
|
7
|
+
export const version: (a: number) => void;
|
|
8
|
+
export const __wbindgen_export: (a: number) => void;
|
|
9
|
+
export const __wbindgen_export2: (a: number, b: number) => number;
|
|
10
|
+
export const __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
11
|
+
export const __wbindgen_export3: (a: number, b: number, c: number) => void;
|
|
12
|
+
export const __wbindgen_start: () => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,62 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@draco-rust/decoder",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Draco geometry decoder in WebAssembly, a safe Rust port of Google Draco: meshes, point clouds and older bitstreams, each as its own small entry.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"draco",
|
|
7
|
+
"decoder",
|
|
8
|
+
"mesh",
|
|
9
|
+
"point-cloud",
|
|
10
|
+
"compression",
|
|
11
|
+
"wasm",
|
|
12
|
+
"webassembly",
|
|
13
|
+
"3d"
|
|
14
|
+
],
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"author": "Filyus",
|
|
17
|
+
"homepage": "https://filyus.github.io/draco-rust/",
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/Filyus/draco-rust/issues"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/Filyus/draco-rust.git",
|
|
24
|
+
"directory": "web/npm/decoder"
|
|
25
|
+
},
|
|
26
|
+
"draco-rust": {
|
|
27
|
+
"commit": "f33cf80a",
|
|
28
|
+
"draco-core": "2.3.0",
|
|
29
|
+
"draco-io": "0.5.2",
|
|
30
|
+
"draco-gltf": "0.6.0"
|
|
31
|
+
},
|
|
32
|
+
"type": "module",
|
|
33
|
+
"sideEffects": false,
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./index.d.ts",
|
|
37
|
+
"default": "./index.js"
|
|
38
|
+
},
|
|
39
|
+
"./mesh": {
|
|
40
|
+
"types": "./mesh/index.d.ts",
|
|
41
|
+
"default": "./mesh/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./point-cloud": {
|
|
44
|
+
"types": "./point-cloud/index.d.ts",
|
|
45
|
+
"default": "./point-cloud/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./legacy": {
|
|
48
|
+
"types": "./legacy/index.d.ts",
|
|
49
|
+
"default": "./legacy/index.js"
|
|
50
|
+
},
|
|
51
|
+
"./*.wasm": "./*.wasm",
|
|
52
|
+
"./package.json": "./package.json"
|
|
53
|
+
},
|
|
54
|
+
"files": [
|
|
55
|
+
"**/*.js",
|
|
56
|
+
"**/*.d.ts",
|
|
57
|
+
"**/*.wasm"
|
|
58
|
+
],
|
|
59
|
+
"publishConfig": {
|
|
60
|
+
"access": "public"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Install the panic hook, so a panic reads as a message rather than a trap.
|
|
6
|
+
*/
|
|
7
|
+
export function init(): void;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Decode a standalone Draco payload.
|
|
11
|
+
*/
|
|
12
|
+
export function parse_drc_bytes(data: Uint8Array): any;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* File extensions this module reads and writes.
|
|
16
|
+
*/
|
|
17
|
+
export function supported_extensions(): string[];
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* The version of this WASM module.
|
|
21
|
+
*/
|
|
22
|
+
export function version(): string;
|
|
23
|
+
|
|
24
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
25
|
+
|
|
26
|
+
export interface InitOutput {
|
|
27
|
+
readonly memory: WebAssembly.Memory;
|
|
28
|
+
readonly init: () => void;
|
|
29
|
+
readonly parse_drc_bytes: (a: number, b: number) => number;
|
|
30
|
+
readonly supported_extensions: (a: number) => void;
|
|
31
|
+
readonly version: (a: number) => void;
|
|
32
|
+
readonly __wbindgen_export: (a: number) => void;
|
|
33
|
+
readonly __wbindgen_export2: (a: number, b: number) => number;
|
|
34
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
35
|
+
readonly __wbindgen_export3: (a: number, b: number, c: number) => void;
|
|
36
|
+
readonly __wbindgen_start: () => void;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
43
|
+
* a precompiled `WebAssembly.Module`.
|
|
44
|
+
*
|
|
45
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
46
|
+
*
|
|
47
|
+
* @returns {InitOutput}
|
|
48
|
+
*/
|
|
49
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
53
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
54
|
+
*
|
|
55
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
56
|
+
*
|
|
57
|
+
* @returns {Promise<InitOutput>}
|
|
58
|
+
*/
|
|
59
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|