@kerebron/odt-wasm 0.5.3 → 0.5.5
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/lib/rs_lib.d.ts +12 -6
- package/lib/rs_lib.internal.js +141 -144
- package/lib/rs_lib.js +1 -1
- package/lib/rs_lib.wasm +0 -0
- package/lib-debug/rs_lib.d.ts +12 -6
- package/lib-debug/rs_lib.internal.js +141 -145
- package/lib-debug/rs_lib.js +1 -1
- package/lib-debug/rs_lib.wasm +0 -0
- package/lib-debug.js +13 -0
- package/lib.js +13 -0
- package/package.json +7 -5
package/lib/rs_lib.d.ts
CHANGED
|
@@ -2,15 +2,21 @@
|
|
|
2
2
|
// deno-lint-ignore-file
|
|
3
3
|
// deno-fmt-ignore-file
|
|
4
4
|
|
|
5
|
-
export function add(a: number, b: number): number;
|
|
6
|
-
export function unzip(zip_data: Uint8Array): any;
|
|
7
|
-
export function echo(zip_data: Uint8Array): Uint8Array;
|
|
8
|
-
export function parse_styles(xml_bytes: Uint8Array): any;
|
|
9
|
-
export function parse_content(xml_bytes: Uint8Array): any;
|
|
10
|
-
export function init_debug(): void;
|
|
11
5
|
export class Greeter {
|
|
12
6
|
free(): void;
|
|
13
7
|
[Symbol.dispose](): void;
|
|
14
8
|
constructor(name: string);
|
|
15
9
|
greet(): string;
|
|
16
10
|
}
|
|
11
|
+
|
|
12
|
+
export function add(a: number, b: number): number;
|
|
13
|
+
|
|
14
|
+
export function echo(zip_data: Uint8Array): Uint8Array;
|
|
15
|
+
|
|
16
|
+
export function init_debug(): void;
|
|
17
|
+
|
|
18
|
+
export function parse_content(xml_bytes: Uint8Array): any;
|
|
19
|
+
|
|
20
|
+
export function parse_styles(xml_bytes: Uint8Array): any;
|
|
21
|
+
|
|
22
|
+
export function unzip(zip_data: Uint8Array): any;
|
package/lib/rs_lib.internal.js
CHANGED
|
@@ -8,46 +8,6 @@ export function __wbg_set_wasm(val) {
|
|
|
8
8
|
wasm = val;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
let cachedUint8ArrayMemory0 = null;
|
|
12
|
-
|
|
13
|
-
function getUint8ArrayMemory0() {
|
|
14
|
-
if (
|
|
15
|
-
cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0
|
|
16
|
-
) {
|
|
17
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
18
|
-
}
|
|
19
|
-
return cachedUint8ArrayMemory0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let cachedTextDecoder = new TextDecoder('utf-8', {
|
|
23
|
-
ignoreBOM: true,
|
|
24
|
-
fatal: true,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
cachedTextDecoder.decode();
|
|
28
|
-
|
|
29
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
30
|
-
let numBytesDecoded = 0;
|
|
31
|
-
function decodeText(ptr, len) {
|
|
32
|
-
numBytesDecoded += len;
|
|
33
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
34
|
-
cachedTextDecoder = new TextDecoder('utf-8', {
|
|
35
|
-
ignoreBOM: true,
|
|
36
|
-
fatal: true,
|
|
37
|
-
});
|
|
38
|
-
cachedTextDecoder.decode();
|
|
39
|
-
numBytesDecoded = len;
|
|
40
|
-
}
|
|
41
|
-
return cachedTextDecoder.decode(
|
|
42
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + len),
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function getStringFromWasm0(ptr, len) {
|
|
47
|
-
ptr = ptr >>> 0;
|
|
48
|
-
return decodeText(ptr, len);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
11
|
function debugString(val) {
|
|
52
12
|
// primitive types
|
|
53
13
|
const type = typeof val;
|
|
@@ -113,19 +73,44 @@ function debugString(val) {
|
|
|
113
73
|
return className;
|
|
114
74
|
}
|
|
115
75
|
|
|
116
|
-
|
|
76
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
77
|
+
ptr = ptr >>> 0;
|
|
78
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
79
|
+
}
|
|
117
80
|
|
|
118
|
-
|
|
81
|
+
let cachedDataViewMemory0 = null;
|
|
82
|
+
function getDataViewMemory0() {
|
|
83
|
+
if (
|
|
84
|
+
cachedDataViewMemory0 === null ||
|
|
85
|
+
cachedDataViewMemory0.buffer.detached === true ||
|
|
86
|
+
(cachedDataViewMemory0.buffer.detached === undefined &&
|
|
87
|
+
cachedDataViewMemory0.buffer !== wasm.memory.buffer)
|
|
88
|
+
) {
|
|
89
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
90
|
+
}
|
|
91
|
+
return cachedDataViewMemory0;
|
|
92
|
+
}
|
|
119
93
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
94
|
+
function getStringFromWasm0(ptr, len) {
|
|
95
|
+
ptr = ptr >>> 0;
|
|
96
|
+
return decodeText(ptr, len);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let cachedUint8ArrayMemory0 = null;
|
|
100
|
+
function getUint8ArrayMemory0() {
|
|
101
|
+
if (
|
|
102
|
+
cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0
|
|
103
|
+
) {
|
|
104
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
105
|
+
}
|
|
106
|
+
return cachedUint8ArrayMemory0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
110
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
111
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
112
|
+
WASM_VECTOR_LEN = arg.length;
|
|
113
|
+
return ptr;
|
|
129
114
|
}
|
|
130
115
|
|
|
131
116
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
@@ -149,7 +134,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
149
134
|
if (code > 0x7F) break;
|
|
150
135
|
mem[ptr + offset] = code;
|
|
151
136
|
}
|
|
152
|
-
|
|
153
137
|
if (offset !== len) {
|
|
154
138
|
if (offset !== 0) {
|
|
155
139
|
arg = arg.slice(offset);
|
|
@@ -166,88 +150,42 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
166
150
|
return ptr;
|
|
167
151
|
}
|
|
168
152
|
|
|
169
|
-
let
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
153
|
+
let cachedTextDecoder = new TextDecoder('utf-8', {
|
|
154
|
+
ignoreBOM: true,
|
|
155
|
+
fatal: true,
|
|
156
|
+
});
|
|
157
|
+
cachedTextDecoder.decode();
|
|
158
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
159
|
+
let numBytesDecoded = 0;
|
|
160
|
+
function decodeText(ptr, len) {
|
|
161
|
+
numBytesDecoded += len;
|
|
162
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
163
|
+
cachedTextDecoder = new TextDecoder('utf-8', {
|
|
164
|
+
ignoreBOM: true,
|
|
165
|
+
fatal: true,
|
|
166
|
+
});
|
|
167
|
+
cachedTextDecoder.decode();
|
|
168
|
+
numBytesDecoded = len;
|
|
179
169
|
}
|
|
180
|
-
return
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
* @param {number} a
|
|
184
|
-
* @param {number} b
|
|
185
|
-
* @returns {number}
|
|
186
|
-
*/
|
|
187
|
-
export function add(a, b) {
|
|
188
|
-
const ret = wasm.add(a, b);
|
|
189
|
-
return ret;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
193
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
194
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
195
|
-
WASM_VECTOR_LEN = arg.length;
|
|
196
|
-
return ptr;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* @param {Uint8Array} zip_data
|
|
200
|
-
* @returns {any}
|
|
201
|
-
*/
|
|
202
|
-
export function unzip(zip_data) {
|
|
203
|
-
const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
|
|
204
|
-
const len0 = WASM_VECTOR_LEN;
|
|
205
|
-
const ret = wasm.unzip(ptr0, len0);
|
|
206
|
-
return ret;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
210
|
-
ptr = ptr >>> 0;
|
|
211
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* @param {Uint8Array} zip_data
|
|
215
|
-
* @returns {Uint8Array}
|
|
216
|
-
*/
|
|
217
|
-
export function echo(zip_data) {
|
|
218
|
-
const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
|
|
219
|
-
const len0 = WASM_VECTOR_LEN;
|
|
220
|
-
const ret = wasm.echo(ptr0, len0);
|
|
221
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
222
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
223
|
-
return v2;
|
|
170
|
+
return cachedTextDecoder.decode(
|
|
171
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + len),
|
|
172
|
+
);
|
|
224
173
|
}
|
|
225
174
|
|
|
226
|
-
|
|
227
|
-
* @param {Uint8Array} xml_bytes
|
|
228
|
-
* @returns {any}
|
|
229
|
-
*/
|
|
230
|
-
export function parse_styles(xml_bytes) {
|
|
231
|
-
const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
|
|
232
|
-
const len0 = WASM_VECTOR_LEN;
|
|
233
|
-
const ret = wasm.parse_styles(ptr0, len0);
|
|
234
|
-
return ret;
|
|
235
|
-
}
|
|
175
|
+
const cachedTextEncoder = new TextEncoder();
|
|
236
176
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
177
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
178
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
179
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
180
|
+
view.set(buf);
|
|
181
|
+
return {
|
|
182
|
+
read: arg.length,
|
|
183
|
+
written: buf.length,
|
|
184
|
+
};
|
|
185
|
+
};
|
|
246
186
|
}
|
|
247
187
|
|
|
248
|
-
|
|
249
|
-
wasm.init_debug();
|
|
250
|
-
}
|
|
188
|
+
let WASM_VECTOR_LEN = 0;
|
|
251
189
|
|
|
252
190
|
const GreeterFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
253
191
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -260,7 +198,6 @@ export class Greeter {
|
|
|
260
198
|
GreeterFinalization.unregister(this);
|
|
261
199
|
return ptr;
|
|
262
200
|
}
|
|
263
|
-
|
|
264
201
|
free() {
|
|
265
202
|
const ptr = this.__destroy_into_raw();
|
|
266
203
|
wasm.__wbg_greeter_free(ptr, 0);
|
|
@@ -298,17 +235,77 @@ export class Greeter {
|
|
|
298
235
|
}
|
|
299
236
|
if (Symbol.dispose) Greeter.prototype[Symbol.dispose] = Greeter.prototype.free;
|
|
300
237
|
|
|
301
|
-
|
|
238
|
+
/**
|
|
239
|
+
* @param {number} a
|
|
240
|
+
* @param {number} b
|
|
241
|
+
* @returns {number}
|
|
242
|
+
*/
|
|
243
|
+
export function add(a, b) {
|
|
244
|
+
const ret = wasm.add(a, b);
|
|
245
|
+
return ret;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @param {Uint8Array} zip_data
|
|
250
|
+
* @returns {Uint8Array}
|
|
251
|
+
*/
|
|
252
|
+
export function echo(zip_data) {
|
|
253
|
+
const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
|
|
254
|
+
const len0 = WASM_VECTOR_LEN;
|
|
255
|
+
const ret = wasm.echo(ptr0, len0);
|
|
256
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
257
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
258
|
+
return v2;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function init_debug() {
|
|
262
|
+
wasm.init_debug();
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* @param {Uint8Array} xml_bytes
|
|
267
|
+
* @returns {any}
|
|
268
|
+
*/
|
|
269
|
+
export function parse_content(xml_bytes) {
|
|
270
|
+
const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
|
|
271
|
+
const len0 = WASM_VECTOR_LEN;
|
|
272
|
+
const ret = wasm.parse_content(ptr0, len0);
|
|
273
|
+
return ret;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* @param {Uint8Array} xml_bytes
|
|
278
|
+
* @returns {any}
|
|
279
|
+
*/
|
|
280
|
+
export function parse_styles(xml_bytes) {
|
|
281
|
+
const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
|
|
282
|
+
const len0 = WASM_VECTOR_LEN;
|
|
283
|
+
const ret = wasm.parse_styles(ptr0, len0);
|
|
284
|
+
return ret;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* @param {Uint8Array} zip_data
|
|
289
|
+
* @returns {any}
|
|
290
|
+
*/
|
|
291
|
+
export function unzip(zip_data) {
|
|
292
|
+
const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
|
|
293
|
+
const len0 = WASM_VECTOR_LEN;
|
|
294
|
+
const ret = wasm.unzip(ptr0, len0);
|
|
295
|
+
return ret;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) {
|
|
302
299
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
303
300
|
return ret;
|
|
304
301
|
}
|
|
305
302
|
|
|
306
|
-
export function
|
|
303
|
+
export function __wbg_Number_2d1dcfcf4ec51736(arg0) {
|
|
307
304
|
const ret = Number(arg0);
|
|
308
305
|
return ret;
|
|
309
306
|
}
|
|
310
307
|
|
|
311
|
-
export function
|
|
308
|
+
export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
|
|
312
309
|
const ret = debugString(arg1);
|
|
313
310
|
const ptr1 = passStringToWasm0(
|
|
314
311
|
ret,
|
|
@@ -320,12 +317,12 @@ export function __wbg___wbindgen_debug_string_df47ffb5e35e6763(arg0, arg1) {
|
|
|
320
317
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
321
318
|
}
|
|
322
319
|
|
|
323
|
-
export function
|
|
320
|
+
export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) {
|
|
324
321
|
const ret = typeof arg0 === 'string';
|
|
325
322
|
return ret;
|
|
326
323
|
}
|
|
327
324
|
|
|
328
|
-
export function
|
|
325
|
+
export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
|
|
329
326
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
330
327
|
}
|
|
331
328
|
|
|
@@ -341,13 +338,13 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
|
341
338
|
}
|
|
342
339
|
}
|
|
343
340
|
|
|
344
|
-
export function
|
|
341
|
+
export function __wbg_new_1ba21ce319a06297() {
|
|
345
342
|
const ret = new Object();
|
|
346
343
|
return ret;
|
|
347
344
|
}
|
|
348
345
|
|
|
349
|
-
export function
|
|
350
|
-
const ret = new
|
|
346
|
+
export function __wbg_new_25f239778d6112b9() {
|
|
347
|
+
const ret = new Array();
|
|
351
348
|
return ret;
|
|
352
349
|
}
|
|
353
350
|
|
|
@@ -356,8 +353,8 @@ export function __wbg_new_8a6f238a6ece86ea() {
|
|
|
356
353
|
return ret;
|
|
357
354
|
}
|
|
358
355
|
|
|
359
|
-
export function
|
|
360
|
-
const ret = new
|
|
356
|
+
export function __wbg_new_b546ae120718850e() {
|
|
357
|
+
const ret = new Map();
|
|
361
358
|
return ret;
|
|
362
359
|
}
|
|
363
360
|
|
|
@@ -365,13 +362,13 @@ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
|
|
365
362
|
arg0[arg1] = arg2;
|
|
366
363
|
}
|
|
367
364
|
|
|
368
|
-
export function
|
|
369
|
-
|
|
370
|
-
return ret;
|
|
365
|
+
export function __wbg_set_7df433eea03a5c14(arg0, arg1, arg2) {
|
|
366
|
+
arg0[arg1 >>> 0] = arg2;
|
|
371
367
|
}
|
|
372
368
|
|
|
373
|
-
export function
|
|
374
|
-
|
|
369
|
+
export function __wbg_set_efaaf145b9377369(arg0, arg1, arg2) {
|
|
370
|
+
const ret = arg0.set(arg1, arg2);
|
|
371
|
+
return ret;
|
|
375
372
|
}
|
|
376
373
|
|
|
377
374
|
export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
|
package/lib/rs_lib.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// deno-fmt-ignore-file
|
|
5
5
|
// @ts-self-types="./rs_lib.d.ts"
|
|
6
6
|
|
|
7
|
-
// source-hash:
|
|
7
|
+
// source-hash: aaf646bb4ea0c77254ac0a46be962265644a4d52
|
|
8
8
|
import * as wasm from "./rs_lib.wasm";
|
|
9
9
|
export * from "./rs_lib.internal.js";
|
|
10
10
|
import { __wbg_set_wasm } from "./rs_lib.internal.js";
|
package/lib/rs_lib.wasm
CHANGED
|
Binary file
|
package/lib-debug/rs_lib.d.ts
CHANGED
|
@@ -2,15 +2,21 @@
|
|
|
2
2
|
// deno-lint-ignore-file
|
|
3
3
|
// deno-fmt-ignore-file
|
|
4
4
|
|
|
5
|
-
export function unzip(zip_data: Uint8Array): any;
|
|
6
|
-
export function echo(zip_data: Uint8Array): Uint8Array;
|
|
7
|
-
export function add(a: number, b: number): number;
|
|
8
|
-
export function init_debug(): void;
|
|
9
|
-
export function parse_content(xml_bytes: Uint8Array): any;
|
|
10
|
-
export function parse_styles(xml_bytes: Uint8Array): any;
|
|
11
5
|
export class Greeter {
|
|
12
6
|
free(): void;
|
|
13
7
|
[Symbol.dispose](): void;
|
|
14
8
|
constructor(name: string);
|
|
15
9
|
greet(): string;
|
|
16
10
|
}
|
|
11
|
+
|
|
12
|
+
export function add(a: number, b: number): number;
|
|
13
|
+
|
|
14
|
+
export function echo(zip_data: Uint8Array): Uint8Array;
|
|
15
|
+
|
|
16
|
+
export function init_debug(): void;
|
|
17
|
+
|
|
18
|
+
export function parse_content(xml_bytes: Uint8Array): any;
|
|
19
|
+
|
|
20
|
+
export function parse_styles(xml_bytes: Uint8Array): any;
|
|
21
|
+
|
|
22
|
+
export function unzip(zip_data: Uint8Array): any;
|
|
@@ -8,46 +8,6 @@ export function __wbg_set_wasm(val) {
|
|
|
8
8
|
wasm = val;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
let cachedUint8ArrayMemory0 = null;
|
|
12
|
-
|
|
13
|
-
function getUint8ArrayMemory0() {
|
|
14
|
-
if (
|
|
15
|
-
cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0
|
|
16
|
-
) {
|
|
17
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
18
|
-
}
|
|
19
|
-
return cachedUint8ArrayMemory0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
let cachedTextDecoder = new TextDecoder('utf-8', {
|
|
23
|
-
ignoreBOM: true,
|
|
24
|
-
fatal: true,
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
cachedTextDecoder.decode();
|
|
28
|
-
|
|
29
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
30
|
-
let numBytesDecoded = 0;
|
|
31
|
-
function decodeText(ptr, len) {
|
|
32
|
-
numBytesDecoded += len;
|
|
33
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
34
|
-
cachedTextDecoder = new TextDecoder('utf-8', {
|
|
35
|
-
ignoreBOM: true,
|
|
36
|
-
fatal: true,
|
|
37
|
-
});
|
|
38
|
-
cachedTextDecoder.decode();
|
|
39
|
-
numBytesDecoded = len;
|
|
40
|
-
}
|
|
41
|
-
return cachedTextDecoder.decode(
|
|
42
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + len),
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
function getStringFromWasm0(ptr, len) {
|
|
47
|
-
ptr = ptr >>> 0;
|
|
48
|
-
return decodeText(ptr, len);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
11
|
function debugString(val) {
|
|
52
12
|
// primitive types
|
|
53
13
|
const type = typeof val;
|
|
@@ -113,19 +73,44 @@ function debugString(val) {
|
|
|
113
73
|
return className;
|
|
114
74
|
}
|
|
115
75
|
|
|
116
|
-
|
|
76
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
77
|
+
ptr = ptr >>> 0;
|
|
78
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
79
|
+
}
|
|
117
80
|
|
|
118
|
-
|
|
81
|
+
let cachedDataViewMemory0 = null;
|
|
82
|
+
function getDataViewMemory0() {
|
|
83
|
+
if (
|
|
84
|
+
cachedDataViewMemory0 === null ||
|
|
85
|
+
cachedDataViewMemory0.buffer.detached === true ||
|
|
86
|
+
(cachedDataViewMemory0.buffer.detached === undefined &&
|
|
87
|
+
cachedDataViewMemory0.buffer !== wasm.memory.buffer)
|
|
88
|
+
) {
|
|
89
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
90
|
+
}
|
|
91
|
+
return cachedDataViewMemory0;
|
|
92
|
+
}
|
|
119
93
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
94
|
+
function getStringFromWasm0(ptr, len) {
|
|
95
|
+
ptr = ptr >>> 0;
|
|
96
|
+
return decodeText(ptr, len);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
let cachedUint8ArrayMemory0 = null;
|
|
100
|
+
function getUint8ArrayMemory0() {
|
|
101
|
+
if (
|
|
102
|
+
cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0
|
|
103
|
+
) {
|
|
104
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
105
|
+
}
|
|
106
|
+
return cachedUint8ArrayMemory0;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
110
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
111
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
112
|
+
WASM_VECTOR_LEN = arg.length;
|
|
113
|
+
return ptr;
|
|
129
114
|
}
|
|
130
115
|
|
|
131
116
|
function passStringToWasm0(arg, malloc, realloc) {
|
|
@@ -149,7 +134,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
149
134
|
if (code > 0x7F) break;
|
|
150
135
|
mem[ptr + offset] = code;
|
|
151
136
|
}
|
|
152
|
-
|
|
153
137
|
if (offset !== len) {
|
|
154
138
|
if (offset !== 0) {
|
|
155
139
|
arg = arg.slice(offset);
|
|
@@ -166,89 +150,42 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
166
150
|
return ptr;
|
|
167
151
|
}
|
|
168
152
|
|
|
169
|
-
let
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
153
|
+
let cachedTextDecoder = new TextDecoder('utf-8', {
|
|
154
|
+
ignoreBOM: true,
|
|
155
|
+
fatal: true,
|
|
156
|
+
});
|
|
157
|
+
cachedTextDecoder.decode();
|
|
158
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
159
|
+
let numBytesDecoded = 0;
|
|
160
|
+
function decodeText(ptr, len) {
|
|
161
|
+
numBytesDecoded += len;
|
|
162
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
163
|
+
cachedTextDecoder = new TextDecoder('utf-8', {
|
|
164
|
+
ignoreBOM: true,
|
|
165
|
+
fatal: true,
|
|
166
|
+
});
|
|
167
|
+
cachedTextDecoder.decode();
|
|
168
|
+
numBytesDecoded = len;
|
|
179
169
|
}
|
|
180
|
-
return
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
184
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
185
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
186
|
-
WASM_VECTOR_LEN = arg.length;
|
|
187
|
-
return ptr;
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* @param {Uint8Array} zip_data
|
|
191
|
-
* @returns {any}
|
|
192
|
-
*/
|
|
193
|
-
export function unzip(zip_data) {
|
|
194
|
-
const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
|
|
195
|
-
const len0 = WASM_VECTOR_LEN;
|
|
196
|
-
const ret = wasm.unzip(ptr0, len0);
|
|
197
|
-
return ret;
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
201
|
-
ptr = ptr >>> 0;
|
|
202
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
203
|
-
}
|
|
204
|
-
/**
|
|
205
|
-
* @param {Uint8Array} zip_data
|
|
206
|
-
* @returns {Uint8Array}
|
|
207
|
-
*/
|
|
208
|
-
export function echo(zip_data) {
|
|
209
|
-
const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
|
|
210
|
-
const len0 = WASM_VECTOR_LEN;
|
|
211
|
-
const ret = wasm.echo(ptr0, len0);
|
|
212
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
213
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
214
|
-
return v2;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* @param {number} a
|
|
219
|
-
* @param {number} b
|
|
220
|
-
* @returns {number}
|
|
221
|
-
*/
|
|
222
|
-
export function add(a, b) {
|
|
223
|
-
const ret = wasm.add(a, b);
|
|
224
|
-
return ret;
|
|
170
|
+
return cachedTextDecoder.decode(
|
|
171
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + len),
|
|
172
|
+
);
|
|
225
173
|
}
|
|
226
174
|
|
|
227
|
-
|
|
228
|
-
wasm.init_debug();
|
|
229
|
-
}
|
|
175
|
+
const cachedTextEncoder = new TextEncoder();
|
|
230
176
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
177
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
178
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
179
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
180
|
+
view.set(buf);
|
|
181
|
+
return {
|
|
182
|
+
read: arg.length,
|
|
183
|
+
written: buf.length,
|
|
184
|
+
};
|
|
185
|
+
};
|
|
240
186
|
}
|
|
241
187
|
|
|
242
|
-
|
|
243
|
-
* @param {Uint8Array} xml_bytes
|
|
244
|
-
* @returns {any}
|
|
245
|
-
*/
|
|
246
|
-
export function parse_styles(xml_bytes) {
|
|
247
|
-
const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
|
|
248
|
-
const len0 = WASM_VECTOR_LEN;
|
|
249
|
-
const ret = wasm.parse_styles(ptr0, len0);
|
|
250
|
-
return ret;
|
|
251
|
-
}
|
|
188
|
+
let WASM_VECTOR_LEN = 0;
|
|
252
189
|
|
|
253
190
|
const GreeterFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
254
191
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -261,7 +198,6 @@ export class Greeter {
|
|
|
261
198
|
GreeterFinalization.unregister(this);
|
|
262
199
|
return ptr;
|
|
263
200
|
}
|
|
264
|
-
|
|
265
201
|
free() {
|
|
266
202
|
const ptr = this.__destroy_into_raw();
|
|
267
203
|
wasm.__wbg_greeter_free(ptr, 0);
|
|
@@ -299,17 +235,77 @@ export class Greeter {
|
|
|
299
235
|
}
|
|
300
236
|
if (Symbol.dispose) Greeter.prototype[Symbol.dispose] = Greeter.prototype.free;
|
|
301
237
|
|
|
302
|
-
|
|
238
|
+
/**
|
|
239
|
+
* @param {number} a
|
|
240
|
+
* @param {number} b
|
|
241
|
+
* @returns {number}
|
|
242
|
+
*/
|
|
243
|
+
export function add(a, b) {
|
|
244
|
+
const ret = wasm.add(a, b);
|
|
245
|
+
return ret;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @param {Uint8Array} zip_data
|
|
250
|
+
* @returns {Uint8Array}
|
|
251
|
+
*/
|
|
252
|
+
export function echo(zip_data) {
|
|
253
|
+
const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
|
|
254
|
+
const len0 = WASM_VECTOR_LEN;
|
|
255
|
+
const ret = wasm.echo(ptr0, len0);
|
|
256
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
257
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
258
|
+
return v2;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
export function init_debug() {
|
|
262
|
+
wasm.init_debug();
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/**
|
|
266
|
+
* @param {Uint8Array} xml_bytes
|
|
267
|
+
* @returns {any}
|
|
268
|
+
*/
|
|
269
|
+
export function parse_content(xml_bytes) {
|
|
270
|
+
const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
|
|
271
|
+
const len0 = WASM_VECTOR_LEN;
|
|
272
|
+
const ret = wasm.parse_content(ptr0, len0);
|
|
273
|
+
return ret;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* @param {Uint8Array} xml_bytes
|
|
278
|
+
* @returns {any}
|
|
279
|
+
*/
|
|
280
|
+
export function parse_styles(xml_bytes) {
|
|
281
|
+
const ptr0 = passArray8ToWasm0(xml_bytes, wasm.__wbindgen_malloc);
|
|
282
|
+
const len0 = WASM_VECTOR_LEN;
|
|
283
|
+
const ret = wasm.parse_styles(ptr0, len0);
|
|
284
|
+
return ret;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* @param {Uint8Array} zip_data
|
|
289
|
+
* @returns {any}
|
|
290
|
+
*/
|
|
291
|
+
export function unzip(zip_data) {
|
|
292
|
+
const ptr0 = passArray8ToWasm0(zip_data, wasm.__wbindgen_malloc);
|
|
293
|
+
const len0 = WASM_VECTOR_LEN;
|
|
294
|
+
const ret = wasm.unzip(ptr0, len0);
|
|
295
|
+
return ret;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
export function __wbg_Error_52673b7de5a0ca89(arg0, arg1) {
|
|
303
299
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
304
300
|
return ret;
|
|
305
301
|
}
|
|
306
302
|
|
|
307
|
-
export function
|
|
303
|
+
export function __wbg_Number_2d1dcfcf4ec51736(arg0) {
|
|
308
304
|
const ret = Number(arg0);
|
|
309
305
|
return ret;
|
|
310
306
|
}
|
|
311
307
|
|
|
312
|
-
export function
|
|
308
|
+
export function __wbg___wbindgen_debug_string_adfb662ae34724b6(arg0, arg1) {
|
|
313
309
|
const ret = debugString(arg1);
|
|
314
310
|
const ptr1 = passStringToWasm0(
|
|
315
311
|
ret,
|
|
@@ -321,12 +317,12 @@ export function __wbg___wbindgen_debug_string_df47ffb5e35e6763(arg0, arg1) {
|
|
|
321
317
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
322
318
|
}
|
|
323
319
|
|
|
324
|
-
export function
|
|
320
|
+
export function __wbg___wbindgen_is_string_704ef9c8fc131030(arg0) {
|
|
325
321
|
const ret = typeof arg0 === 'string';
|
|
326
322
|
return ret;
|
|
327
323
|
}
|
|
328
324
|
|
|
329
|
-
export function
|
|
325
|
+
export function __wbg___wbindgen_throw_dd24417ed36fc46e(arg0, arg1) {
|
|
330
326
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
331
327
|
}
|
|
332
328
|
|
|
@@ -342,13 +338,13 @@ export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
|
342
338
|
}
|
|
343
339
|
}
|
|
344
340
|
|
|
345
|
-
export function
|
|
341
|
+
export function __wbg_new_1ba21ce319a06297() {
|
|
346
342
|
const ret = new Object();
|
|
347
343
|
return ret;
|
|
348
344
|
}
|
|
349
345
|
|
|
350
|
-
export function
|
|
351
|
-
const ret = new
|
|
346
|
+
export function __wbg_new_25f239778d6112b9() {
|
|
347
|
+
const ret = new Array();
|
|
352
348
|
return ret;
|
|
353
349
|
}
|
|
354
350
|
|
|
@@ -357,8 +353,8 @@ export function __wbg_new_8a6f238a6ece86ea() {
|
|
|
357
353
|
return ret;
|
|
358
354
|
}
|
|
359
355
|
|
|
360
|
-
export function
|
|
361
|
-
const ret = new
|
|
356
|
+
export function __wbg_new_b546ae120718850e() {
|
|
357
|
+
const ret = new Map();
|
|
362
358
|
return ret;
|
|
363
359
|
}
|
|
364
360
|
|
|
@@ -366,13 +362,13 @@ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
|
|
|
366
362
|
arg0[arg1] = arg2;
|
|
367
363
|
}
|
|
368
364
|
|
|
369
|
-
export function
|
|
370
|
-
|
|
371
|
-
return ret;
|
|
365
|
+
export function __wbg_set_7df433eea03a5c14(arg0, arg1, arg2) {
|
|
366
|
+
arg0[arg1 >>> 0] = arg2;
|
|
372
367
|
}
|
|
373
368
|
|
|
374
|
-
export function
|
|
375
|
-
|
|
369
|
+
export function __wbg_set_efaaf145b9377369(arg0, arg1, arg2) {
|
|
370
|
+
const ret = arg0.set(arg1, arg2);
|
|
371
|
+
return ret;
|
|
376
372
|
}
|
|
377
373
|
|
|
378
374
|
export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
|
package/lib-debug/rs_lib.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// deno-fmt-ignore-file
|
|
5
5
|
// @ts-self-types="./rs_lib.d.ts"
|
|
6
6
|
|
|
7
|
-
// source-hash:
|
|
7
|
+
// source-hash: aaf646bb4ea0c77254ac0a46be962265644a4d52
|
|
8
8
|
import * as wasm from "./rs_lib.wasm";
|
|
9
9
|
export * from "./rs_lib.internal.js";
|
|
10
10
|
import { __wbg_set_wasm } from "./rs_lib.internal.js";
|
package/lib-debug/rs_lib.wasm
CHANGED
|
Binary file
|
package/lib-debug.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
let wasmInstance;
|
|
2
|
+
|
|
3
|
+
export async function init() {
|
|
4
|
+
const wasm = await import('./lib-debug/rs_lib.wasm');
|
|
5
|
+
const internal = await import('./lib-debug/rs_lib.internal.js');
|
|
6
|
+
|
|
7
|
+
internal.__wbg_set_wasm(wasm);
|
|
8
|
+
wasm.__wbindgen_start();
|
|
9
|
+
internal.init_debug();
|
|
10
|
+
|
|
11
|
+
wasmInstance = wasm;
|
|
12
|
+
return internal;
|
|
13
|
+
}
|
package/lib.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
let wasmInstance;
|
|
2
|
+
|
|
3
|
+
export async function init() {
|
|
4
|
+
const wasm = await import('./lib/rs_lib.wasm');
|
|
5
|
+
const internal = await import('./lib/rs_lib.internal.js');
|
|
6
|
+
|
|
7
|
+
internal.__wbg_set_wasm(wasm);
|
|
8
|
+
wasm.__wbindgen_start();
|
|
9
|
+
internal.init_debug();
|
|
10
|
+
|
|
11
|
+
wasmInstance = wasm;
|
|
12
|
+
return internal;
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kerebron/odt-wasm",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"main": "./lib
|
|
4
|
+
"main": "./lib.js",
|
|
5
5
|
"files": [
|
|
6
6
|
"lib/",
|
|
7
|
-
"lib-debug/"
|
|
7
|
+
"lib-debug/",
|
|
8
|
+
"lib.js",
|
|
9
|
+
"lib-debug.js"
|
|
8
10
|
],
|
|
9
11
|
"exports": {
|
|
10
12
|
".": {
|
|
11
|
-
"import": "./lib
|
|
13
|
+
"import": "./lib.js"
|
|
12
14
|
},
|
|
13
15
|
"./debug": {
|
|
14
|
-
"import": "./lib-debug
|
|
16
|
+
"import": "./lib-debug.js"
|
|
15
17
|
}
|
|
16
18
|
},
|
|
17
|
-
"version": "0.5.
|
|
19
|
+
"version": "0.5.5",
|
|
18
20
|
"license": "MIT"
|
|
19
21
|
}
|