@sanox/sangine-core 0.4.5 → 0.5.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/dist/gen-types.d.ts +146 -24
- package/dist/gen-types.d.ts.map +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +106 -90
- package/dist/rendererService.d.ts +11 -7
- package/dist/rendererService.d.ts.map +1 -1
- 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.ecedf539.js → sangine.3dd43ad4.js} +91 -44
- package/dist/wasm/sangine/sangine.d.ts +20 -8
- package/dist/wasm/sangine/{sangine_bg.ecedf539.wasm → sangine_bg.3dd43ad4.wasm} +0 -0
- package/dist/wasm/sangine/sangine_bg.wasm.d.ts +7 -3
- package/dist/wasm-hashes/decode.d.ts +1 -1
- package/dist/wasm-hashes/sangine.d.ts +1 -1
- 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.d.ts +0 -58
- package/dist/wasm/basis-decode/wasm_basis_decode_bg.a8b7eebd.wasm +0 -0
- package/dist/wasm/basis-decode/wasm_basis_decode_bg.wasm.d.ts +0 -16
- package/dist/wasm/sbo-decode/wasm_sbo_decode.5c359661.js +0 -184
- package/dist/wasm/sbo-decode/wasm_sbo_decode.d.ts +0 -37
- package/dist/wasm/sbo-decode/wasm_sbo_decode_bg.5c359661.wasm +0 -0
- package/dist/wasm/sbo-decode/wasm_sbo_decode_bg.wasm.d.ts +0 -8
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
/* @ts-self-types="./wasm_sbo_decode.d.ts" */
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @param {Uint8Array} data
|
|
5
|
-
* @returns {Uint8Array}
|
|
6
|
-
*/
|
|
7
|
-
export function decode_sbo(data) {
|
|
8
|
-
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
9
|
-
const len0 = WASM_VECTOR_LEN;
|
|
10
|
-
const ret = wasm.decode_sbo(ptr0, len0);
|
|
11
|
-
if (ret[2]) {
|
|
12
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
13
|
-
}
|
|
14
|
-
return takeFromExternrefTable0(ret[0]);
|
|
15
|
-
}
|
|
16
|
-
function __wbg_get_imports() {
|
|
17
|
-
const import0 = {
|
|
18
|
-
__proto__: null,
|
|
19
|
-
__wbg___wbindgen_throw_6b64449b9b9ed33c: function(arg0, arg1) {
|
|
20
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
21
|
-
},
|
|
22
|
-
__wbg_new_from_slice_b5ea43e23f6008c0: function(arg0, arg1) {
|
|
23
|
-
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
24
|
-
return ret;
|
|
25
|
-
},
|
|
26
|
-
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
27
|
-
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
28
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
29
|
-
return ret;
|
|
30
|
-
},
|
|
31
|
-
__wbindgen_init_externref_table: function() {
|
|
32
|
-
const table = wasm.__wbindgen_externrefs;
|
|
33
|
-
const offset = table.grow(4);
|
|
34
|
-
table.set(0, undefined);
|
|
35
|
-
table.set(offset + 0, undefined);
|
|
36
|
-
table.set(offset + 1, null);
|
|
37
|
-
table.set(offset + 2, true);
|
|
38
|
-
table.set(offset + 3, false);
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
return {
|
|
42
|
-
__proto__: null,
|
|
43
|
-
"./wasm_sbo_decode_bg.js": import0,
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
function getArrayU8FromWasm0(ptr, len) {
|
|
48
|
-
ptr = ptr >>> 0;
|
|
49
|
-
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function getStringFromWasm0(ptr, len) {
|
|
53
|
-
ptr = ptr >>> 0;
|
|
54
|
-
return decodeText(ptr, len);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
let cachedUint8ArrayMemory0 = null;
|
|
58
|
-
function getUint8ArrayMemory0() {
|
|
59
|
-
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
60
|
-
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
61
|
-
}
|
|
62
|
-
return cachedUint8ArrayMemory0;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
66
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
67
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
68
|
-
WASM_VECTOR_LEN = arg.length;
|
|
69
|
-
return ptr;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function takeFromExternrefTable0(idx) {
|
|
73
|
-
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
74
|
-
wasm.__externref_table_dealloc(idx);
|
|
75
|
-
return value;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
79
|
-
cachedTextDecoder.decode();
|
|
80
|
-
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
81
|
-
let numBytesDecoded = 0;
|
|
82
|
-
function decodeText(ptr, len) {
|
|
83
|
-
numBytesDecoded += len;
|
|
84
|
-
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
85
|
-
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
86
|
-
cachedTextDecoder.decode();
|
|
87
|
-
numBytesDecoded = len;
|
|
88
|
-
}
|
|
89
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
let WASM_VECTOR_LEN = 0;
|
|
93
|
-
|
|
94
|
-
let wasmModule, wasm;
|
|
95
|
-
function __wbg_finalize_init(instance, module) {
|
|
96
|
-
wasm = instance.exports;
|
|
97
|
-
wasmModule = module;
|
|
98
|
-
cachedUint8ArrayMemory0 = null;
|
|
99
|
-
wasm.__wbindgen_start();
|
|
100
|
-
return wasm;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
async function __wbg_load(module, imports) {
|
|
104
|
-
if (typeof Response === 'function' && module instanceof Response) {
|
|
105
|
-
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
106
|
-
try {
|
|
107
|
-
return await WebAssembly.instantiateStreaming(module, imports);
|
|
108
|
-
} catch (e) {
|
|
109
|
-
const validResponse = module.ok && expectedResponseType(module.type);
|
|
110
|
-
|
|
111
|
-
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
112
|
-
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);
|
|
113
|
-
|
|
114
|
-
} else { throw e; }
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
const bytes = await module.arrayBuffer();
|
|
119
|
-
return await WebAssembly.instantiate(bytes, imports);
|
|
120
|
-
} else {
|
|
121
|
-
const instance = await WebAssembly.instantiate(module, imports);
|
|
122
|
-
|
|
123
|
-
if (instance instanceof WebAssembly.Instance) {
|
|
124
|
-
return { instance, module };
|
|
125
|
-
} else {
|
|
126
|
-
return instance;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
function expectedResponseType(type) {
|
|
131
|
-
switch (type) {
|
|
132
|
-
case 'basic': case 'cors': case 'default': return true;
|
|
133
|
-
}
|
|
134
|
-
return false;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function initSync(module) {
|
|
139
|
-
if (wasm !== undefined) return wasm;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (module !== undefined) {
|
|
143
|
-
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
144
|
-
({module} = module)
|
|
145
|
-
} else {
|
|
146
|
-
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const imports = __wbg_get_imports();
|
|
151
|
-
if (!(module instanceof WebAssembly.Module)) {
|
|
152
|
-
module = new WebAssembly.Module(module);
|
|
153
|
-
}
|
|
154
|
-
const instance = new WebAssembly.Instance(module, imports);
|
|
155
|
-
return __wbg_finalize_init(instance, module);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
async function __wbg_init(module_or_path) {
|
|
159
|
-
if (wasm !== undefined) return wasm;
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
if (module_or_path !== undefined) {
|
|
163
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
164
|
-
({module_or_path} = module_or_path)
|
|
165
|
-
} else {
|
|
166
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
if (module_or_path === undefined) {
|
|
171
|
-
module_or_path = new URL('wasm_sbo_decode_bg.5c359661.wasm', import.meta.url);
|
|
172
|
-
}
|
|
173
|
-
const imports = __wbg_get_imports();
|
|
174
|
-
|
|
175
|
-
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
176
|
-
module_or_path = fetch(module_or_path);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
180
|
-
|
|
181
|
-
return __wbg_finalize_init(instance, module);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
export { initSync, __wbg_init as default };
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
|
|
4
|
-
export function decode_sbo(data: Uint8Array): Uint8Array;
|
|
5
|
-
|
|
6
|
-
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
7
|
-
|
|
8
|
-
export interface InitOutput {
|
|
9
|
-
readonly memory: WebAssembly.Memory;
|
|
10
|
-
readonly decode_sbo: (a: number, b: number) => [number, number, number];
|
|
11
|
-
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
12
|
-
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
13
|
-
readonly __externref_table_dealloc: (a: number) => void;
|
|
14
|
-
readonly __wbindgen_start: () => void;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
21
|
-
* a precompiled `WebAssembly.Module`.
|
|
22
|
-
*
|
|
23
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
24
|
-
*
|
|
25
|
-
* @returns {InitOutput}
|
|
26
|
-
*/
|
|
27
|
-
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
31
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
32
|
-
*
|
|
33
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
34
|
-
*
|
|
35
|
-
* @returns {Promise<InitOutput>}
|
|
36
|
-
*/
|
|
37
|
-
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
Binary file
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/* tslint:disable */
|
|
2
|
-
/* eslint-disable */
|
|
3
|
-
export const memory: WebAssembly.Memory;
|
|
4
|
-
export const decode_sbo: (a: number, b: number) => [number, number, number];
|
|
5
|
-
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
6
|
-
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
7
|
-
export const __externref_table_dealloc: (a: number) => void;
|
|
8
|
-
export const __wbindgen_start: () => void;
|