@takumi-rs/wasm 0.31.4 → 0.32.0
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/package.json +1 -1
- package/pkg/takumi_wasm.d.ts +16 -4
- package/pkg/takumi_wasm.js +206 -137
- package/pkg/takumi_wasm_bg.wasm +0 -0
- package/pkg/takumi_wasm_bg.wasm.d.ts +6 -3
package/package.json
CHANGED
package/pkg/takumi_wasm.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
+
type AnimationOutputFormat = "webp" | "apng";
|
|
3
4
|
/**
|
|
4
5
|
* Proxy type for the ImageOutputFormat enum.
|
|
5
6
|
* This is needed because wasm-bindgen doesn't support cfg macro in enum variants.
|
|
@@ -13,19 +14,27 @@ export interface AnyNode {
|
|
|
13
14
|
}
|
|
14
15
|
|
|
15
16
|
|
|
17
|
+
export class AnimationFrameSource {
|
|
18
|
+
free(): void;
|
|
19
|
+
[Symbol.dispose](): void;
|
|
20
|
+
constructor(node: AnyNode, durationMs: number);
|
|
21
|
+
}
|
|
16
22
|
export class FontInfo {
|
|
17
23
|
private constructor();
|
|
18
24
|
free(): void;
|
|
25
|
+
[Symbol.dispose](): void;
|
|
19
26
|
}
|
|
20
27
|
export class Renderer {
|
|
21
28
|
free(): void;
|
|
29
|
+
[Symbol.dispose](): void;
|
|
22
30
|
constructor(debug?: boolean | null);
|
|
23
|
-
loadFontWithInfo(
|
|
31
|
+
loadFontWithInfo(fontData: FontInfo): void;
|
|
24
32
|
loadFont(buffer: Uint8Array): void;
|
|
25
33
|
putPersistentImage(src: string, data: Uint8Array): void;
|
|
26
34
|
clearImageStore(): void;
|
|
27
35
|
render(node: AnyNode, width: number, height: number, format?: ImageOutputFormat | null, quality?: number | null): Uint8Array;
|
|
28
36
|
renderAsDataUrl(node: AnyNode, width: number, height: number, format?: ImageOutputFormat | null, quality?: number | null): string;
|
|
37
|
+
renderAnimation(frames: AnimationFrameSource[], width: number, height: number, format?: AnimationOutputFormat | null): Uint8Array;
|
|
29
38
|
}
|
|
30
39
|
|
|
31
40
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
@@ -33,6 +42,8 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
33
42
|
export interface InitOutput {
|
|
34
43
|
readonly memory: WebAssembly.Memory;
|
|
35
44
|
readonly __wbg_fontinfo_free: (a: number, b: number) => void;
|
|
45
|
+
readonly __wbg_animationframesource_free: (a: number, b: number) => void;
|
|
46
|
+
readonly animationframesource_new: (a: any, b: number) => number;
|
|
36
47
|
readonly __wbg_renderer_free: (a: number, b: number) => void;
|
|
37
48
|
readonly renderer_new: (a: number) => number;
|
|
38
49
|
readonly renderer_loadFontWithInfo: (a: number, b: number) => void;
|
|
@@ -41,11 +52,12 @@ export interface InitOutput {
|
|
|
41
52
|
readonly renderer_clearImageStore: (a: number) => void;
|
|
42
53
|
readonly renderer_render: (a: number, b: any, c: number, d: number, e: number, f: number) => [number, number];
|
|
43
54
|
readonly renderer_renderAsDataUrl: (a: number, b: any, c: number, d: number, e: number, f: number) => [number, number];
|
|
44
|
-
readonly
|
|
45
|
-
readonly __externref_table_alloc: () => number;
|
|
46
|
-
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
55
|
+
readonly renderer_renderAnimation: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
47
56
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
48
57
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
58
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
59
|
+
readonly __externref_table_alloc: () => number;
|
|
60
|
+
readonly __wbindgen_export_4: WebAssembly.Table;
|
|
49
61
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
50
62
|
readonly __wbindgen_start: () => void;
|
|
51
63
|
}
|
package/pkg/takumi_wasm.js
CHANGED
|
@@ -9,16 +9,16 @@ function getUint8ArrayMemory0() {
|
|
|
9
9
|
return cachedUint8ArrayMemory0;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
let cachedTextDecoder =
|
|
12
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
cachedTextDecoder.decode();
|
|
15
15
|
|
|
16
16
|
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
17
17
|
let numBytesDecoded = 0;
|
|
18
18
|
function decodeText(ptr, len) {
|
|
19
19
|
numBytesDecoded += len;
|
|
20
20
|
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
21
|
-
cachedTextDecoder =
|
|
21
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
22
22
|
cachedTextDecoder.decode();
|
|
23
23
|
numBytesDecoded = len;
|
|
24
24
|
}
|
|
@@ -30,9 +30,72 @@ function getStringFromWasm0(ptr, len) {
|
|
|
30
30
|
return decodeText(ptr, len);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
let WASM_VECTOR_LEN = 0;
|
|
34
|
+
|
|
35
|
+
const cachedTextEncoder = new TextEncoder();
|
|
36
|
+
|
|
37
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
38
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
39
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
40
|
+
view.set(buf);
|
|
41
|
+
return {
|
|
42
|
+
read: arg.length,
|
|
43
|
+
written: buf.length
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
49
|
+
|
|
50
|
+
if (realloc === undefined) {
|
|
51
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
52
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
53
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
54
|
+
WASM_VECTOR_LEN = buf.length;
|
|
55
|
+
return ptr;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
let len = arg.length;
|
|
59
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
60
|
+
|
|
61
|
+
const mem = getUint8ArrayMemory0();
|
|
62
|
+
|
|
63
|
+
let offset = 0;
|
|
64
|
+
|
|
65
|
+
for (; offset < len; offset++) {
|
|
66
|
+
const code = arg.charCodeAt(offset);
|
|
67
|
+
if (code > 0x7F) break;
|
|
68
|
+
mem[ptr + offset] = code;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (offset !== len) {
|
|
72
|
+
if (offset !== 0) {
|
|
73
|
+
arg = arg.slice(offset);
|
|
74
|
+
}
|
|
75
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
76
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
77
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
78
|
+
|
|
79
|
+
offset += ret.written;
|
|
80
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
WASM_VECTOR_LEN = offset;
|
|
84
|
+
return ptr;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
let cachedDataViewMemory0 = null;
|
|
88
|
+
|
|
89
|
+
function getDataViewMemory0() {
|
|
90
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
91
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
92
|
+
}
|
|
93
|
+
return cachedDataViewMemory0;
|
|
94
|
+
}
|
|
95
|
+
|
|
33
96
|
function addToExternrefTable0(obj) {
|
|
34
97
|
const idx = wasm.__externref_table_alloc();
|
|
35
|
-
wasm.
|
|
98
|
+
wasm.__wbindgen_export_4.set(idx, obj);
|
|
36
99
|
return idx;
|
|
37
100
|
}
|
|
38
101
|
|
|
@@ -45,17 +108,13 @@ function handleError(f, args) {
|
|
|
45
108
|
}
|
|
46
109
|
}
|
|
47
110
|
|
|
48
|
-
function
|
|
49
|
-
|
|
111
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
112
|
+
ptr = ptr >>> 0;
|
|
113
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
50
114
|
}
|
|
51
115
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
function getDataViewMemory0() {
|
|
55
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
56
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
57
|
-
}
|
|
58
|
-
return cachedDataViewMemory0;
|
|
116
|
+
function isLikeNone(x) {
|
|
117
|
+
return x === undefined || x === null;
|
|
59
118
|
}
|
|
60
119
|
|
|
61
120
|
function debugString(val) {
|
|
@@ -123,62 +182,6 @@ function debugString(val) {
|
|
|
123
182
|
return className;
|
|
124
183
|
}
|
|
125
184
|
|
|
126
|
-
let WASM_VECTOR_LEN = 0;
|
|
127
|
-
|
|
128
|
-
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
129
|
-
|
|
130
|
-
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
131
|
-
? function (arg, view) {
|
|
132
|
-
return cachedTextEncoder.encodeInto(arg, view);
|
|
133
|
-
}
|
|
134
|
-
: function (arg, view) {
|
|
135
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
136
|
-
view.set(buf);
|
|
137
|
-
return {
|
|
138
|
-
read: arg.length,
|
|
139
|
-
written: buf.length
|
|
140
|
-
};
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
function passStringToWasm0(arg, malloc, realloc) {
|
|
144
|
-
|
|
145
|
-
if (realloc === undefined) {
|
|
146
|
-
const buf = cachedTextEncoder.encode(arg);
|
|
147
|
-
const ptr = malloc(buf.length, 1) >>> 0;
|
|
148
|
-
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
149
|
-
WASM_VECTOR_LEN = buf.length;
|
|
150
|
-
return ptr;
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
let len = arg.length;
|
|
154
|
-
let ptr = malloc(len, 1) >>> 0;
|
|
155
|
-
|
|
156
|
-
const mem = getUint8ArrayMemory0();
|
|
157
|
-
|
|
158
|
-
let offset = 0;
|
|
159
|
-
|
|
160
|
-
for (; offset < len; offset++) {
|
|
161
|
-
const code = arg.charCodeAt(offset);
|
|
162
|
-
if (code > 0x7F) break;
|
|
163
|
-
mem[ptr + offset] = code;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
if (offset !== len) {
|
|
167
|
-
if (offset !== 0) {
|
|
168
|
-
arg = arg.slice(offset);
|
|
169
|
-
}
|
|
170
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
171
|
-
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
172
|
-
const ret = encodeString(arg, view);
|
|
173
|
-
|
|
174
|
-
offset += ret.written;
|
|
175
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
WASM_VECTOR_LEN = offset;
|
|
179
|
-
return ptr;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
185
|
function _assertClass(instance, klass) {
|
|
183
186
|
if (!(instance instanceof klass)) {
|
|
184
187
|
throw new Error(`expected instance of ${klass.name}`);
|
|
@@ -192,13 +195,57 @@ function passArray8ToWasm0(arg, malloc) {
|
|
|
192
195
|
return ptr;
|
|
193
196
|
}
|
|
194
197
|
|
|
195
|
-
function
|
|
196
|
-
ptr =
|
|
197
|
-
|
|
198
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
199
|
+
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
200
|
+
for (let i = 0; i < array.length; i++) {
|
|
201
|
+
const add = addToExternrefTable0(array[i]);
|
|
202
|
+
getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
|
|
203
|
+
}
|
|
204
|
+
WASM_VECTOR_LEN = array.length;
|
|
205
|
+
return ptr;
|
|
198
206
|
}
|
|
199
207
|
|
|
208
|
+
const __wbindgen_enum_AnimationOutputFormat = ["webp", "apng"];
|
|
209
|
+
|
|
200
210
|
const __wbindgen_enum_ImageOutputFormat = ["webp", "png", "jpeg"];
|
|
201
211
|
|
|
212
|
+
const AnimationFrameSourceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
213
|
+
? { register: () => {}, unregister: () => {} }
|
|
214
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_animationframesource_free(ptr >>> 0, 1));
|
|
215
|
+
|
|
216
|
+
export class AnimationFrameSource {
|
|
217
|
+
|
|
218
|
+
static __unwrap(jsValue) {
|
|
219
|
+
if (!(jsValue instanceof AnimationFrameSource)) {
|
|
220
|
+
return 0;
|
|
221
|
+
}
|
|
222
|
+
return jsValue.__destroy_into_raw();
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
__destroy_into_raw() {
|
|
226
|
+
const ptr = this.__wbg_ptr;
|
|
227
|
+
this.__wbg_ptr = 0;
|
|
228
|
+
AnimationFrameSourceFinalization.unregister(this);
|
|
229
|
+
return ptr;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
free() {
|
|
233
|
+
const ptr = this.__destroy_into_raw();
|
|
234
|
+
wasm.__wbg_animationframesource_free(ptr, 0);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* @param {AnyNode} node
|
|
238
|
+
* @param {number} durationMs
|
|
239
|
+
*/
|
|
240
|
+
constructor(node, durationMs) {
|
|
241
|
+
const ret = wasm.animationframesource_new(node, durationMs);
|
|
242
|
+
this.__wbg_ptr = ret >>> 0;
|
|
243
|
+
AnimationFrameSourceFinalization.register(this, this.__wbg_ptr, this);
|
|
244
|
+
return this;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (Symbol.dispose) AnimationFrameSource.prototype[Symbol.dispose] = AnimationFrameSource.prototype.free;
|
|
248
|
+
|
|
202
249
|
const FontInfoFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
203
250
|
? { register: () => {}, unregister: () => {} }
|
|
204
251
|
: new FinalizationRegistry(ptr => wasm.__wbg_fontinfo_free(ptr >>> 0, 1));
|
|
@@ -217,6 +264,7 @@ export class FontInfo {
|
|
|
217
264
|
wasm.__wbg_fontinfo_free(ptr, 0);
|
|
218
265
|
}
|
|
219
266
|
}
|
|
267
|
+
if (Symbol.dispose) FontInfo.prototype[Symbol.dispose] = FontInfo.prototype.free;
|
|
220
268
|
|
|
221
269
|
const RendererFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
222
270
|
? { register: () => {}, unregister: () => {} }
|
|
@@ -245,11 +293,11 @@ export class Renderer {
|
|
|
245
293
|
return this;
|
|
246
294
|
}
|
|
247
295
|
/**
|
|
248
|
-
* @param {FontInfo}
|
|
296
|
+
* @param {FontInfo} fontData
|
|
249
297
|
*/
|
|
250
|
-
loadFontWithInfo(
|
|
251
|
-
_assertClass(
|
|
252
|
-
var ptr0 =
|
|
298
|
+
loadFontWithInfo(fontData) {
|
|
299
|
+
_assertClass(fontData, FontInfo);
|
|
300
|
+
var ptr0 = fontData.__destroy_into_raw();
|
|
253
301
|
wasm.renderer_loadFontWithInfo(this.__wbg_ptr, ptr0);
|
|
254
302
|
}
|
|
255
303
|
/**
|
|
@@ -308,7 +356,23 @@ export class Renderer {
|
|
|
308
356
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
309
357
|
}
|
|
310
358
|
}
|
|
359
|
+
/**
|
|
360
|
+
* @param {AnimationFrameSource[]} frames
|
|
361
|
+
* @param {number} width
|
|
362
|
+
* @param {number} height
|
|
363
|
+
* @param {AnimationOutputFormat | null} [format]
|
|
364
|
+
* @returns {Uint8Array}
|
|
365
|
+
*/
|
|
366
|
+
renderAnimation(frames, width, height, format) {
|
|
367
|
+
const ptr0 = passArrayJsValueToWasm0(frames, wasm.__wbindgen_malloc);
|
|
368
|
+
const len0 = WASM_VECTOR_LEN;
|
|
369
|
+
const ret = wasm.renderer_renderAnimation(this.__wbg_ptr, ptr0, len0, width, height, isLikeNone(format) ? 3 : ((__wbindgen_enum_AnimationOutputFormat.indexOf(format) + 1 || 3) - 1));
|
|
370
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
371
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
372
|
+
return v2;
|
|
373
|
+
}
|
|
311
374
|
}
|
|
375
|
+
if (Symbol.dispose) Renderer.prototype[Symbol.dispose] = Renderer.prototype.free;
|
|
312
376
|
|
|
313
377
|
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
314
378
|
|
|
@@ -348,35 +412,42 @@ async function __wbg_load(module, imports) {
|
|
|
348
412
|
function __wbg_get_imports() {
|
|
349
413
|
const imports = {};
|
|
350
414
|
imports.wbg = {};
|
|
351
|
-
imports.wbg.
|
|
415
|
+
imports.wbg.__wbg_Error_e17e777aac105295 = function(arg0, arg1) {
|
|
352
416
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
353
417
|
return ret;
|
|
354
418
|
};
|
|
355
|
-
imports.wbg.
|
|
356
|
-
const ret =
|
|
419
|
+
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
420
|
+
const ret = String(arg1);
|
|
421
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
422
|
+
const len1 = WASM_VECTOR_LEN;
|
|
423
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
424
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
425
|
+
};
|
|
426
|
+
imports.wbg.__wbg_animationframesource_unwrap = function(arg0) {
|
|
427
|
+
const ret = AnimationFrameSource.__unwrap(arg0);
|
|
357
428
|
return ret;
|
|
358
429
|
};
|
|
359
|
-
imports.wbg.
|
|
430
|
+
imports.wbg.__wbg_call_13410aac570ffff7 = function() { return handleError(function (arg0, arg1) {
|
|
360
431
|
const ret = arg0.call(arg1);
|
|
361
432
|
return ret;
|
|
362
433
|
}, arguments) };
|
|
363
|
-
imports.wbg.
|
|
434
|
+
imports.wbg.__wbg_done_75ed0ee6dd243d9d = function(arg0) {
|
|
364
435
|
const ret = arg0.done;
|
|
365
436
|
return ret;
|
|
366
437
|
};
|
|
367
|
-
imports.wbg.
|
|
438
|
+
imports.wbg.__wbg_entries_2be2f15bd5554996 = function(arg0) {
|
|
368
439
|
const ret = Object.entries(arg0);
|
|
369
440
|
return ret;
|
|
370
441
|
};
|
|
371
|
-
imports.wbg.
|
|
372
|
-
const ret = Reflect.get(arg0, arg1);
|
|
373
|
-
return ret;
|
|
374
|
-
}, arguments) };
|
|
375
|
-
imports.wbg.__wbg_get_a131a44bd1eb6979 = function(arg0, arg1) {
|
|
442
|
+
imports.wbg.__wbg_get_0da715ceaecea5c8 = function(arg0, arg1) {
|
|
376
443
|
const ret = arg0[arg1 >>> 0];
|
|
377
444
|
return ret;
|
|
378
445
|
};
|
|
379
|
-
imports.wbg.
|
|
446
|
+
imports.wbg.__wbg_get_458e874b43b18b25 = function() { return handleError(function (arg0, arg1) {
|
|
447
|
+
const ret = Reflect.get(arg0, arg1);
|
|
448
|
+
return ret;
|
|
449
|
+
}, arguments) };
|
|
450
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_67f3012529f6a2dd = function(arg0) {
|
|
380
451
|
let result;
|
|
381
452
|
try {
|
|
382
453
|
result = arg0 instanceof ArrayBuffer;
|
|
@@ -386,7 +457,7 @@ function __wbg_get_imports() {
|
|
|
386
457
|
const ret = result;
|
|
387
458
|
return ret;
|
|
388
459
|
};
|
|
389
|
-
imports.wbg.
|
|
460
|
+
imports.wbg.__wbg_instanceof_Map_ebb01a5b6b5ffd0b = function(arg0) {
|
|
390
461
|
let result;
|
|
391
462
|
try {
|
|
392
463
|
result = arg0 instanceof Map;
|
|
@@ -396,7 +467,7 @@ function __wbg_get_imports() {
|
|
|
396
467
|
const ret = result;
|
|
397
468
|
return ret;
|
|
398
469
|
};
|
|
399
|
-
imports.wbg.
|
|
470
|
+
imports.wbg.__wbg_instanceof_Uint8Array_9a8378d955933db7 = function(arg0) {
|
|
400
471
|
let result;
|
|
401
472
|
try {
|
|
402
473
|
result = arg0 instanceof Uint8Array;
|
|
@@ -406,117 +477,95 @@ function __wbg_get_imports() {
|
|
|
406
477
|
const ret = result;
|
|
407
478
|
return ret;
|
|
408
479
|
};
|
|
409
|
-
imports.wbg.
|
|
480
|
+
imports.wbg.__wbg_isArray_030cce220591fb41 = function(arg0) {
|
|
410
481
|
const ret = Array.isArray(arg0);
|
|
411
482
|
return ret;
|
|
412
483
|
};
|
|
413
|
-
imports.wbg.
|
|
484
|
+
imports.wbg.__wbg_isSafeInteger_1c0d1af5542e102a = function(arg0) {
|
|
414
485
|
const ret = Number.isSafeInteger(arg0);
|
|
415
486
|
return ret;
|
|
416
487
|
};
|
|
417
|
-
imports.wbg.
|
|
488
|
+
imports.wbg.__wbg_iterator_f370b34483c71a1c = function() {
|
|
418
489
|
const ret = Symbol.iterator;
|
|
419
490
|
return ret;
|
|
420
491
|
};
|
|
421
|
-
imports.wbg.
|
|
492
|
+
imports.wbg.__wbg_length_186546c51cd61acd = function(arg0) {
|
|
422
493
|
const ret = arg0.length;
|
|
423
494
|
return ret;
|
|
424
495
|
};
|
|
425
|
-
imports.wbg.
|
|
496
|
+
imports.wbg.__wbg_length_6bb7e81f9d7713e4 = function(arg0) {
|
|
426
497
|
const ret = arg0.length;
|
|
427
498
|
return ret;
|
|
428
499
|
};
|
|
429
|
-
imports.wbg.
|
|
500
|
+
imports.wbg.__wbg_new_638ebfaedbf32a5e = function(arg0) {
|
|
430
501
|
const ret = new Uint8Array(arg0);
|
|
431
502
|
return ret;
|
|
432
503
|
};
|
|
433
|
-
imports.wbg.
|
|
504
|
+
imports.wbg.__wbg_next_5b3530e612fde77d = function(arg0) {
|
|
434
505
|
const ret = arg0.next;
|
|
435
506
|
return ret;
|
|
436
507
|
};
|
|
437
|
-
imports.wbg.
|
|
508
|
+
imports.wbg.__wbg_next_692e82279131b03c = function() { return handleError(function (arg0) {
|
|
438
509
|
const ret = arg0.next();
|
|
439
510
|
return ret;
|
|
440
511
|
}, arguments) };
|
|
441
|
-
imports.wbg.
|
|
442
|
-
|
|
512
|
+
imports.wbg.__wbg_prototypesetcall_3d4a26c1ed734349 = function(arg0, arg1, arg2) {
|
|
513
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
443
514
|
};
|
|
444
|
-
imports.wbg.
|
|
515
|
+
imports.wbg.__wbg_value_dd9372230531eade = function(arg0) {
|
|
445
516
|
const ret = arg0.value;
|
|
446
517
|
return ret;
|
|
447
518
|
};
|
|
448
|
-
imports.wbg.
|
|
449
|
-
const ret = arg0;
|
|
450
|
-
return ret;
|
|
451
|
-
};
|
|
452
|
-
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
453
|
-
const ret = BigInt.asUintN(64, arg0);
|
|
454
|
-
return ret;
|
|
455
|
-
};
|
|
456
|
-
imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
|
519
|
+
imports.wbg.__wbg_wbindgenbigintgetasi64_ac743ece6ab9bba1 = function(arg0, arg1) {
|
|
457
520
|
const v = arg1;
|
|
458
521
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
459
522
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
460
523
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
461
524
|
};
|
|
462
|
-
imports.wbg.
|
|
525
|
+
imports.wbg.__wbg_wbindgenbooleanget_3fe6f642c7d97746 = function(arg0) {
|
|
463
526
|
const v = arg0;
|
|
464
|
-
const ret = typeof(v) === 'boolean' ?
|
|
465
|
-
return ret;
|
|
527
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
528
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
466
529
|
};
|
|
467
|
-
imports.wbg.
|
|
530
|
+
imports.wbg.__wbg_wbindgendebugstring_99ef257a3ddda34d = function(arg0, arg1) {
|
|
468
531
|
const ret = debugString(arg1);
|
|
469
532
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
470
533
|
const len1 = WASM_VECTOR_LEN;
|
|
471
534
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
472
535
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
473
536
|
};
|
|
474
|
-
imports.wbg.
|
|
537
|
+
imports.wbg.__wbg_wbindgenin_d7a1ee10933d2d55 = function(arg0, arg1) {
|
|
475
538
|
const ret = arg0 in arg1;
|
|
476
539
|
return ret;
|
|
477
540
|
};
|
|
478
|
-
imports.wbg.
|
|
479
|
-
const table = wasm.__wbindgen_export_2;
|
|
480
|
-
const offset = table.grow(4);
|
|
481
|
-
table.set(0, undefined);
|
|
482
|
-
table.set(offset + 0, undefined);
|
|
483
|
-
table.set(offset + 1, null);
|
|
484
|
-
table.set(offset + 2, true);
|
|
485
|
-
table.set(offset + 3, false);
|
|
486
|
-
;
|
|
487
|
-
};
|
|
488
|
-
imports.wbg.__wbindgen_is_bigint = function(arg0) {
|
|
541
|
+
imports.wbg.__wbg_wbindgenisbigint_ecb90cc08a5a9154 = function(arg0) {
|
|
489
542
|
const ret = typeof(arg0) === 'bigint';
|
|
490
543
|
return ret;
|
|
491
544
|
};
|
|
492
|
-
imports.wbg.
|
|
545
|
+
imports.wbg.__wbg_wbindgenisfunction_8cee7dce3725ae74 = function(arg0) {
|
|
493
546
|
const ret = typeof(arg0) === 'function';
|
|
494
547
|
return ret;
|
|
495
548
|
};
|
|
496
|
-
imports.wbg.
|
|
549
|
+
imports.wbg.__wbg_wbindgenisobject_307a53c6bd97fbf8 = function(arg0) {
|
|
497
550
|
const val = arg0;
|
|
498
551
|
const ret = typeof(val) === 'object' && val !== null;
|
|
499
552
|
return ret;
|
|
500
553
|
};
|
|
501
|
-
imports.wbg.
|
|
554
|
+
imports.wbg.__wbg_wbindgenjsvaleq_e6f2ad59ccae1b58 = function(arg0, arg1) {
|
|
502
555
|
const ret = arg0 === arg1;
|
|
503
556
|
return ret;
|
|
504
557
|
};
|
|
505
|
-
imports.wbg.
|
|
558
|
+
imports.wbg.__wbg_wbindgenjsvallooseeq_9bec8c9be826bed1 = function(arg0, arg1) {
|
|
506
559
|
const ret = arg0 == arg1;
|
|
507
560
|
return ret;
|
|
508
561
|
};
|
|
509
|
-
imports.wbg.
|
|
510
|
-
const ret = wasm.memory;
|
|
511
|
-
return ret;
|
|
512
|
-
};
|
|
513
|
-
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
562
|
+
imports.wbg.__wbg_wbindgennumberget_f74b4c7525ac05cb = function(arg0, arg1) {
|
|
514
563
|
const obj = arg1;
|
|
515
564
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
516
565
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
517
566
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
518
567
|
};
|
|
519
|
-
imports.wbg.
|
|
568
|
+
imports.wbg.__wbg_wbindgenstringget_0f16a6ddddef376f = function(arg0, arg1) {
|
|
520
569
|
const obj = arg1;
|
|
521
570
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
522
571
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -524,9 +573,29 @@ function __wbg_get_imports() {
|
|
|
524
573
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
525
574
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
526
575
|
};
|
|
527
|
-
imports.wbg.
|
|
576
|
+
imports.wbg.__wbg_wbindgenthrow_451ec1a8469d7eb6 = function(arg0, arg1) {
|
|
528
577
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
529
578
|
};
|
|
579
|
+
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
580
|
+
// Cast intrinsic for `U64 -> Externref`.
|
|
581
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
582
|
+
return ret;
|
|
583
|
+
};
|
|
584
|
+
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
585
|
+
// Cast intrinsic for `I64 -> Externref`.
|
|
586
|
+
const ret = arg0;
|
|
587
|
+
return ret;
|
|
588
|
+
};
|
|
589
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
590
|
+
const table = wasm.__wbindgen_export_4;
|
|
591
|
+
const offset = table.grow(4);
|
|
592
|
+
table.set(0, undefined);
|
|
593
|
+
table.set(offset + 0, undefined);
|
|
594
|
+
table.set(offset + 1, null);
|
|
595
|
+
table.set(offset + 2, true);
|
|
596
|
+
table.set(offset + 3, false);
|
|
597
|
+
;
|
|
598
|
+
};
|
|
530
599
|
|
|
531
600
|
return imports;
|
|
532
601
|
}
|
package/pkg/takumi_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_fontinfo_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_animationframesource_free: (a: number, b: number) => void;
|
|
6
|
+
export const animationframesource_new: (a: any, b: number) => number;
|
|
5
7
|
export const __wbg_renderer_free: (a: number, b: number) => void;
|
|
6
8
|
export const renderer_new: (a: number) => number;
|
|
7
9
|
export const renderer_loadFontWithInfo: (a: number, b: number) => void;
|
|
@@ -10,10 +12,11 @@ export const renderer_putPersistentImage: (a: number, b: number, c: number, d: n
|
|
|
10
12
|
export const renderer_clearImageStore: (a: number) => void;
|
|
11
13
|
export const renderer_render: (a: number, b: any, c: number, d: number, e: number, f: number) => [number, number];
|
|
12
14
|
export const renderer_renderAsDataUrl: (a: number, b: any, c: number, d: number, e: number, f: number) => [number, number];
|
|
13
|
-
export const
|
|
14
|
-
export const __externref_table_alloc: () => number;
|
|
15
|
-
export const __wbindgen_export_2: WebAssembly.Table;
|
|
15
|
+
export const renderer_renderAnimation: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
16
16
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
17
17
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
18
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
19
|
+
export const __externref_table_alloc: () => number;
|
|
20
|
+
export const __wbindgen_export_4: WebAssembly.Table;
|
|
18
21
|
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
19
22
|
export const __wbindgen_start: () => void;
|