@codonsplice/wasm 0.1.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/codonsplice_wasm.d.ts +112 -0
- package/codonsplice_wasm.js +568 -0
- package/codonsplice_wasm_bg.wasm +0 -0
- package/package.json +17 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The CodonSplice engine handle exposed to JavaScript.
|
|
6
|
+
*/
|
|
7
|
+
export class CodonSplice {
|
|
8
|
+
free(): void;
|
|
9
|
+
[Symbol.dispose](): void;
|
|
10
|
+
/**
|
|
11
|
+
* Parse + type-check only. Returns `null` on success, the error string on
|
|
12
|
+
* failure.
|
|
13
|
+
*/
|
|
14
|
+
check(source: string): string | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Compile a SpliceQL query and return its disassembled bytecode.
|
|
17
|
+
*/
|
|
18
|
+
compile(source: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Execute a query against the JS file map, binding `$variables` from the
|
|
21
|
+
* `vars` object (`{ name: value }`). Returns the result as a JSON value
|
|
22
|
+
* (an array of records/rows, or `{ "text": ... }` for header/`INTO`).
|
|
23
|
+
*/
|
|
24
|
+
execute(source: string, files: any, vars: any): any;
|
|
25
|
+
/**
|
|
26
|
+
* Execute pre-compiled `.spq.bc` bytecode (a `Uint8Array`) against the file
|
|
27
|
+
* map + variables. Mirrors `execute` but skips parsing/compilation.
|
|
28
|
+
*/
|
|
29
|
+
execute_bytecode(bc_bytes: Uint8Array, files: any, vars: any): any;
|
|
30
|
+
/**
|
|
31
|
+
* Initialize the engine. Installs the panic hook so Rust panics surface in
|
|
32
|
+
* the JS console. Call once before anything else.
|
|
33
|
+
*/
|
|
34
|
+
constructor();
|
|
35
|
+
/**
|
|
36
|
+
* The SpliceQL language crate version.
|
|
37
|
+
*/
|
|
38
|
+
static spliceql_version(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Execute and stream: `on_record` is called per record, `on_done` when the
|
|
41
|
+
* stream completes, `on_error` on failure.
|
|
42
|
+
*/
|
|
43
|
+
stream(source: string, files: any, vars: any, on_record: Function, on_done: Function, on_error: Function): void;
|
|
44
|
+
/**
|
|
45
|
+
* The codonsplice-core engine version.
|
|
46
|
+
*/
|
|
47
|
+
static version(): string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Coverage + CNV analysis. `opts_json` is the snake_case `CoverageOptions`
|
|
52
|
+
* JSON; returns the result object as a JSON string.
|
|
53
|
+
*/
|
|
54
|
+
export function analyze_coverage(bam: Uint8Array, bai: Uint8Array, opts_json: string): string;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* SNV variant calling. `opts_json` is the snake_case `VariantOptions` JSON.
|
|
58
|
+
*/
|
|
59
|
+
export function call_variants(bam: Uint8Array, bai: Uint8Array, opts_json: string): string;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* One-time panic-hook install so Rust panics surface in the JS console.
|
|
63
|
+
*/
|
|
64
|
+
export function init(): void;
|
|
65
|
+
|
|
66
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
67
|
+
|
|
68
|
+
export interface InitOutput {
|
|
69
|
+
readonly memory: WebAssembly.Memory;
|
|
70
|
+
readonly __wbg_codonsplice_free: (a: number, b: number) => void;
|
|
71
|
+
readonly codonsplice_check: (a: number, b: number, c: number) => [number, number];
|
|
72
|
+
readonly codonsplice_compile: (a: number, b: number, c: number) => [number, number, number, number];
|
|
73
|
+
readonly codonsplice_execute: (a: number, b: number, c: number, d: any, e: any) => [number, number, number];
|
|
74
|
+
readonly codonsplice_execute_bytecode: (a: number, b: number, c: number, d: any, e: any) => [number, number, number];
|
|
75
|
+
readonly codonsplice_new: () => number;
|
|
76
|
+
readonly codonsplice_spliceql_version: () => [number, number];
|
|
77
|
+
readonly codonsplice_stream: (a: number, b: number, c: number, d: any, e: any, f: any, g: any, h: any) => [number, number];
|
|
78
|
+
readonly analyze_coverage: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
79
|
+
readonly call_variants: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
80
|
+
readonly init: () => void;
|
|
81
|
+
readonly codonsplice_version: () => [number, number];
|
|
82
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
83
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
84
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
85
|
+
readonly __externref_table_alloc: () => number;
|
|
86
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
87
|
+
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
88
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
89
|
+
readonly __wbindgen_start: () => void;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
96
|
+
* a precompiled `WebAssembly.Module`.
|
|
97
|
+
*
|
|
98
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
99
|
+
*
|
|
100
|
+
* @returns {InitOutput}
|
|
101
|
+
*/
|
|
102
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
106
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
107
|
+
*
|
|
108
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
109
|
+
*
|
|
110
|
+
* @returns {Promise<InitOutput>}
|
|
111
|
+
*/
|
|
112
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -0,0 +1,568 @@
|
|
|
1
|
+
/* @ts-self-types="./codonsplice_wasm.d.ts" */
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The CodonSplice engine handle exposed to JavaScript.
|
|
5
|
+
*/
|
|
6
|
+
export class CodonSplice {
|
|
7
|
+
__destroy_into_raw() {
|
|
8
|
+
const ptr = this.__wbg_ptr;
|
|
9
|
+
this.__wbg_ptr = 0;
|
|
10
|
+
CodonSpliceFinalization.unregister(this);
|
|
11
|
+
return ptr;
|
|
12
|
+
}
|
|
13
|
+
free() {
|
|
14
|
+
const ptr = this.__destroy_into_raw();
|
|
15
|
+
wasm.__wbg_codonsplice_free(ptr, 0);
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parse + type-check only. Returns `null` on success, the error string on
|
|
19
|
+
* failure.
|
|
20
|
+
* @param {string} source
|
|
21
|
+
* @returns {string | undefined}
|
|
22
|
+
*/
|
|
23
|
+
check(source) {
|
|
24
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
25
|
+
const len0 = WASM_VECTOR_LEN;
|
|
26
|
+
const ret = wasm.codonsplice_check(this.__wbg_ptr, ptr0, len0);
|
|
27
|
+
let v2;
|
|
28
|
+
if (ret[0] !== 0) {
|
|
29
|
+
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
30
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
31
|
+
}
|
|
32
|
+
return v2;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Compile a SpliceQL query and return its disassembled bytecode.
|
|
36
|
+
* @param {string} source
|
|
37
|
+
* @returns {string}
|
|
38
|
+
*/
|
|
39
|
+
compile(source) {
|
|
40
|
+
let deferred3_0;
|
|
41
|
+
let deferred3_1;
|
|
42
|
+
try {
|
|
43
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
44
|
+
const len0 = WASM_VECTOR_LEN;
|
|
45
|
+
const ret = wasm.codonsplice_compile(this.__wbg_ptr, ptr0, len0);
|
|
46
|
+
var ptr2 = ret[0];
|
|
47
|
+
var len2 = ret[1];
|
|
48
|
+
if (ret[3]) {
|
|
49
|
+
ptr2 = 0; len2 = 0;
|
|
50
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
51
|
+
}
|
|
52
|
+
deferred3_0 = ptr2;
|
|
53
|
+
deferred3_1 = len2;
|
|
54
|
+
return getStringFromWasm0(ptr2, len2);
|
|
55
|
+
} finally {
|
|
56
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Execute a query against the JS file map, binding `$variables` from the
|
|
61
|
+
* `vars` object (`{ name: value }`). Returns the result as a JSON value
|
|
62
|
+
* (an array of records/rows, or `{ "text": ... }` for header/`INTO`).
|
|
63
|
+
* @param {string} source
|
|
64
|
+
* @param {any} files
|
|
65
|
+
* @param {any} vars
|
|
66
|
+
* @returns {any}
|
|
67
|
+
*/
|
|
68
|
+
execute(source, files, vars) {
|
|
69
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
70
|
+
const len0 = WASM_VECTOR_LEN;
|
|
71
|
+
const ret = wasm.codonsplice_execute(this.__wbg_ptr, ptr0, len0, files, vars);
|
|
72
|
+
if (ret[2]) {
|
|
73
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
74
|
+
}
|
|
75
|
+
return takeFromExternrefTable0(ret[0]);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Execute pre-compiled `.spq.bc` bytecode (a `Uint8Array`) against the file
|
|
79
|
+
* map + variables. Mirrors `execute` but skips parsing/compilation.
|
|
80
|
+
* @param {Uint8Array} bc_bytes
|
|
81
|
+
* @param {any} files
|
|
82
|
+
* @param {any} vars
|
|
83
|
+
* @returns {any}
|
|
84
|
+
*/
|
|
85
|
+
execute_bytecode(bc_bytes, files, vars) {
|
|
86
|
+
const ptr0 = passArray8ToWasm0(bc_bytes, wasm.__wbindgen_malloc);
|
|
87
|
+
const len0 = WASM_VECTOR_LEN;
|
|
88
|
+
const ret = wasm.codonsplice_execute_bytecode(this.__wbg_ptr, ptr0, len0, files, vars);
|
|
89
|
+
if (ret[2]) {
|
|
90
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
91
|
+
}
|
|
92
|
+
return takeFromExternrefTable0(ret[0]);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Initialize the engine. Installs the panic hook so Rust panics surface in
|
|
96
|
+
* the JS console. Call once before anything else.
|
|
97
|
+
*/
|
|
98
|
+
constructor() {
|
|
99
|
+
const ret = wasm.codonsplice_new();
|
|
100
|
+
this.__wbg_ptr = ret;
|
|
101
|
+
CodonSpliceFinalization.register(this, this.__wbg_ptr, this);
|
|
102
|
+
return this;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* The SpliceQL language crate version.
|
|
106
|
+
* @returns {string}
|
|
107
|
+
*/
|
|
108
|
+
static spliceql_version() {
|
|
109
|
+
let deferred1_0;
|
|
110
|
+
let deferred1_1;
|
|
111
|
+
try {
|
|
112
|
+
const ret = wasm.codonsplice_spliceql_version();
|
|
113
|
+
deferred1_0 = ret[0];
|
|
114
|
+
deferred1_1 = ret[1];
|
|
115
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
116
|
+
} finally {
|
|
117
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Execute and stream: `on_record` is called per record, `on_done` when the
|
|
122
|
+
* stream completes, `on_error` on failure.
|
|
123
|
+
* @param {string} source
|
|
124
|
+
* @param {any} files
|
|
125
|
+
* @param {any} vars
|
|
126
|
+
* @param {Function} on_record
|
|
127
|
+
* @param {Function} on_done
|
|
128
|
+
* @param {Function} on_error
|
|
129
|
+
*/
|
|
130
|
+
stream(source, files, vars, on_record, on_done, on_error) {
|
|
131
|
+
const ptr0 = passStringToWasm0(source, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
132
|
+
const len0 = WASM_VECTOR_LEN;
|
|
133
|
+
const ret = wasm.codonsplice_stream(this.__wbg_ptr, ptr0, len0, files, vars, on_record, on_done, on_error);
|
|
134
|
+
if (ret[1]) {
|
|
135
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* The codonsplice-core engine version.
|
|
140
|
+
* @returns {string}
|
|
141
|
+
*/
|
|
142
|
+
static version() {
|
|
143
|
+
let deferred1_0;
|
|
144
|
+
let deferred1_1;
|
|
145
|
+
try {
|
|
146
|
+
const ret = wasm.codonsplice_version();
|
|
147
|
+
deferred1_0 = ret[0];
|
|
148
|
+
deferred1_1 = ret[1];
|
|
149
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
150
|
+
} finally {
|
|
151
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (Symbol.dispose) CodonSplice.prototype[Symbol.dispose] = CodonSplice.prototype.free;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Coverage + CNV analysis. `opts_json` is the snake_case `CoverageOptions`
|
|
159
|
+
* JSON; returns the result object as a JSON string.
|
|
160
|
+
* @param {Uint8Array} bam
|
|
161
|
+
* @param {Uint8Array} bai
|
|
162
|
+
* @param {string} opts_json
|
|
163
|
+
* @returns {string}
|
|
164
|
+
*/
|
|
165
|
+
export function analyze_coverage(bam, bai, opts_json) {
|
|
166
|
+
let deferred4_0;
|
|
167
|
+
let deferred4_1;
|
|
168
|
+
try {
|
|
169
|
+
const ptr0 = passArray8ToWasm0(bam, wasm.__wbindgen_malloc);
|
|
170
|
+
const len0 = WASM_VECTOR_LEN;
|
|
171
|
+
const ptr1 = passArray8ToWasm0(bai, wasm.__wbindgen_malloc);
|
|
172
|
+
const len1 = WASM_VECTOR_LEN;
|
|
173
|
+
const ptr2 = passStringToWasm0(opts_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
174
|
+
const len2 = WASM_VECTOR_LEN;
|
|
175
|
+
const ret = wasm.analyze_coverage(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
176
|
+
deferred4_0 = ret[0];
|
|
177
|
+
deferred4_1 = ret[1];
|
|
178
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
179
|
+
} finally {
|
|
180
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* SNV variant calling. `opts_json` is the snake_case `VariantOptions` JSON.
|
|
186
|
+
* @param {Uint8Array} bam
|
|
187
|
+
* @param {Uint8Array} bai
|
|
188
|
+
* @param {string} opts_json
|
|
189
|
+
* @returns {string}
|
|
190
|
+
*/
|
|
191
|
+
export function call_variants(bam, bai, opts_json) {
|
|
192
|
+
let deferred4_0;
|
|
193
|
+
let deferred4_1;
|
|
194
|
+
try {
|
|
195
|
+
const ptr0 = passArray8ToWasm0(bam, wasm.__wbindgen_malloc);
|
|
196
|
+
const len0 = WASM_VECTOR_LEN;
|
|
197
|
+
const ptr1 = passArray8ToWasm0(bai, wasm.__wbindgen_malloc);
|
|
198
|
+
const len1 = WASM_VECTOR_LEN;
|
|
199
|
+
const ptr2 = passStringToWasm0(opts_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
200
|
+
const len2 = WASM_VECTOR_LEN;
|
|
201
|
+
const ret = wasm.call_variants(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
202
|
+
deferred4_0 = ret[0];
|
|
203
|
+
deferred4_1 = ret[1];
|
|
204
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
205
|
+
} finally {
|
|
206
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* One-time panic-hook install so Rust panics surface in the JS console.
|
|
212
|
+
*/
|
|
213
|
+
export function init() {
|
|
214
|
+
wasm.init();
|
|
215
|
+
}
|
|
216
|
+
function __wbg_get_imports() {
|
|
217
|
+
const import0 = {
|
|
218
|
+
__proto__: null,
|
|
219
|
+
__wbg___wbindgen_boolean_get_fa956cfa2d1bd751: function(arg0) {
|
|
220
|
+
const v = arg0;
|
|
221
|
+
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
222
|
+
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
223
|
+
},
|
|
224
|
+
__wbg___wbindgen_is_null_ea9085d691f535d3: function(arg0) {
|
|
225
|
+
const ret = arg0 === null;
|
|
226
|
+
return ret;
|
|
227
|
+
},
|
|
228
|
+
__wbg___wbindgen_is_undefined_c05833b95a3cf397: function(arg0) {
|
|
229
|
+
const ret = arg0 === undefined;
|
|
230
|
+
return ret;
|
|
231
|
+
},
|
|
232
|
+
__wbg___wbindgen_number_get_394265ed1e1b84ee: function(arg0, arg1) {
|
|
233
|
+
const obj = arg1;
|
|
234
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
235
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
236
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
237
|
+
},
|
|
238
|
+
__wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
|
|
239
|
+
const obj = arg1;
|
|
240
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
241
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
242
|
+
var len1 = WASM_VECTOR_LEN;
|
|
243
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
244
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
245
|
+
},
|
|
246
|
+
__wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
|
|
247
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
248
|
+
},
|
|
249
|
+
__wbg_call_8a2dd23819f8a60a: function() { return handleError(function (arg0, arg1) {
|
|
250
|
+
const ret = arg0.call(arg1);
|
|
251
|
+
return ret;
|
|
252
|
+
}, arguments); },
|
|
253
|
+
__wbg_call_a6e5c5dce5018821: function() { return handleError(function (arg0, arg1, arg2) {
|
|
254
|
+
const ret = arg0.call(arg1, arg2);
|
|
255
|
+
return ret;
|
|
256
|
+
}, arguments); },
|
|
257
|
+
__wbg_entries_015dc610cd81ede0: function(arg0) {
|
|
258
|
+
const ret = Object.entries(arg0);
|
|
259
|
+
return ret;
|
|
260
|
+
},
|
|
261
|
+
__wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
|
|
262
|
+
let deferred0_0;
|
|
263
|
+
let deferred0_1;
|
|
264
|
+
try {
|
|
265
|
+
deferred0_0 = arg0;
|
|
266
|
+
deferred0_1 = arg1;
|
|
267
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
268
|
+
} finally {
|
|
269
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
__wbg_from_13e323c65fc8f464: function(arg0) {
|
|
273
|
+
const ret = Array.from(arg0);
|
|
274
|
+
return ret;
|
|
275
|
+
},
|
|
276
|
+
__wbg_get_507a50627bffa49b: function(arg0, arg1) {
|
|
277
|
+
const ret = arg0[arg1 >>> 0];
|
|
278
|
+
return ret;
|
|
279
|
+
},
|
|
280
|
+
__wbg_get_unchecked_6e0ad6d2a41b06f6: function(arg0, arg1) {
|
|
281
|
+
const ret = arg0[arg1 >>> 0];
|
|
282
|
+
return ret;
|
|
283
|
+
},
|
|
284
|
+
__wbg_instanceof_Object_33f20e6f12439f3e: function(arg0) {
|
|
285
|
+
let result;
|
|
286
|
+
try {
|
|
287
|
+
result = arg0 instanceof Object;
|
|
288
|
+
} catch (_) {
|
|
289
|
+
result = false;
|
|
290
|
+
}
|
|
291
|
+
const ret = result;
|
|
292
|
+
return ret;
|
|
293
|
+
},
|
|
294
|
+
__wbg_isArray_0677c962b281d01a: function(arg0) {
|
|
295
|
+
const ret = Array.isArray(arg0);
|
|
296
|
+
return ret;
|
|
297
|
+
},
|
|
298
|
+
__wbg_length_1f0964f4a5e2c6d8: function(arg0) {
|
|
299
|
+
const ret = arg0.length;
|
|
300
|
+
return ret;
|
|
301
|
+
},
|
|
302
|
+
__wbg_length_370319915dc99107: function(arg0) {
|
|
303
|
+
const ret = arg0.length;
|
|
304
|
+
return ret;
|
|
305
|
+
},
|
|
306
|
+
__wbg_new_227d7c05414eb861: function() {
|
|
307
|
+
const ret = new Error();
|
|
308
|
+
return ret;
|
|
309
|
+
},
|
|
310
|
+
__wbg_new_cd45aabdf6073e84: function(arg0) {
|
|
311
|
+
const ret = new Uint8Array(arg0);
|
|
312
|
+
return ret;
|
|
313
|
+
},
|
|
314
|
+
__wbg_parse_1c0d8a8656d7e016: function() { return handleError(function (arg0, arg1) {
|
|
315
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
316
|
+
return ret;
|
|
317
|
+
}, arguments); },
|
|
318
|
+
__wbg_prototypesetcall_4770620bbe4688a0: function(arg0, arg1, arg2) {
|
|
319
|
+
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
320
|
+
},
|
|
321
|
+
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
322
|
+
const ret = arg1.stack;
|
|
323
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
324
|
+
const len1 = WASM_VECTOR_LEN;
|
|
325
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
326
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
327
|
+
},
|
|
328
|
+
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
329
|
+
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
330
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
331
|
+
return ret;
|
|
332
|
+
},
|
|
333
|
+
__wbindgen_init_externref_table: function() {
|
|
334
|
+
const table = wasm.__wbindgen_externrefs;
|
|
335
|
+
const offset = table.grow(4);
|
|
336
|
+
table.set(0, undefined);
|
|
337
|
+
table.set(offset + 0, undefined);
|
|
338
|
+
table.set(offset + 1, null);
|
|
339
|
+
table.set(offset + 2, true);
|
|
340
|
+
table.set(offset + 3, false);
|
|
341
|
+
},
|
|
342
|
+
};
|
|
343
|
+
return {
|
|
344
|
+
__proto__: null,
|
|
345
|
+
"./codonsplice_wasm_bg.js": import0,
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
const CodonSpliceFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
350
|
+
? { register: () => {}, unregister: () => {} }
|
|
351
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_codonsplice_free(ptr, 1));
|
|
352
|
+
|
|
353
|
+
function addToExternrefTable0(obj) {
|
|
354
|
+
const idx = wasm.__externref_table_alloc();
|
|
355
|
+
wasm.__wbindgen_externrefs.set(idx, obj);
|
|
356
|
+
return idx;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
360
|
+
ptr = ptr >>> 0;
|
|
361
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
let cachedDataViewMemory0 = null;
|
|
365
|
+
function getDataViewMemory0() {
|
|
366
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
367
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
368
|
+
}
|
|
369
|
+
return cachedDataViewMemory0;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
function getStringFromWasm0(ptr, len) {
|
|
373
|
+
return decodeText(ptr >>> 0, len);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
let cachedUint8ArrayMemory0 = null;
|
|
377
|
+
function getUint8ArrayMemory0() {
|
|
378
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
379
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
380
|
+
}
|
|
381
|
+
return cachedUint8ArrayMemory0;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
function handleError(f, args) {
|
|
385
|
+
try {
|
|
386
|
+
return f.apply(this, args);
|
|
387
|
+
} catch (e) {
|
|
388
|
+
const idx = addToExternrefTable0(e);
|
|
389
|
+
wasm.__wbindgen_exn_store(idx);
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
function isLikeNone(x) {
|
|
394
|
+
return x === undefined || x === null;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
398
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
399
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
400
|
+
WASM_VECTOR_LEN = arg.length;
|
|
401
|
+
return ptr;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
405
|
+
if (realloc === undefined) {
|
|
406
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
407
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
408
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
409
|
+
WASM_VECTOR_LEN = buf.length;
|
|
410
|
+
return ptr;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
let len = arg.length;
|
|
414
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
415
|
+
|
|
416
|
+
const mem = getUint8ArrayMemory0();
|
|
417
|
+
|
|
418
|
+
let offset = 0;
|
|
419
|
+
|
|
420
|
+
for (; offset < len; offset++) {
|
|
421
|
+
const code = arg.charCodeAt(offset);
|
|
422
|
+
if (code > 0x7F) break;
|
|
423
|
+
mem[ptr + offset] = code;
|
|
424
|
+
}
|
|
425
|
+
if (offset !== len) {
|
|
426
|
+
if (offset !== 0) {
|
|
427
|
+
arg = arg.slice(offset);
|
|
428
|
+
}
|
|
429
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
430
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
431
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
432
|
+
|
|
433
|
+
offset += ret.written;
|
|
434
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
WASM_VECTOR_LEN = offset;
|
|
438
|
+
return ptr;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
function takeFromExternrefTable0(idx) {
|
|
442
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
443
|
+
wasm.__externref_table_dealloc(idx);
|
|
444
|
+
return value;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
448
|
+
cachedTextDecoder.decode();
|
|
449
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
450
|
+
let numBytesDecoded = 0;
|
|
451
|
+
function decodeText(ptr, len) {
|
|
452
|
+
numBytesDecoded += len;
|
|
453
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
454
|
+
cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
455
|
+
cachedTextDecoder.decode();
|
|
456
|
+
numBytesDecoded = len;
|
|
457
|
+
}
|
|
458
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
const cachedTextEncoder = new TextEncoder();
|
|
462
|
+
|
|
463
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
464
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
465
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
466
|
+
view.set(buf);
|
|
467
|
+
return {
|
|
468
|
+
read: arg.length,
|
|
469
|
+
written: buf.length
|
|
470
|
+
};
|
|
471
|
+
};
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
let WASM_VECTOR_LEN = 0;
|
|
475
|
+
|
|
476
|
+
let wasmModule, wasmInstance, wasm;
|
|
477
|
+
function __wbg_finalize_init(instance, module) {
|
|
478
|
+
wasmInstance = instance;
|
|
479
|
+
wasm = instance.exports;
|
|
480
|
+
wasmModule = module;
|
|
481
|
+
cachedDataViewMemory0 = null;
|
|
482
|
+
cachedUint8ArrayMemory0 = null;
|
|
483
|
+
wasm.__wbindgen_start();
|
|
484
|
+
return wasm;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
async function __wbg_load(module, imports) {
|
|
488
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
489
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
490
|
+
try {
|
|
491
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
492
|
+
} catch (e) {
|
|
493
|
+
const validResponse = module.ok && expectedResponseType(module.type);
|
|
494
|
+
|
|
495
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
496
|
+
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);
|
|
497
|
+
|
|
498
|
+
} else { throw e; }
|
|
499
|
+
}
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
const bytes = await module.arrayBuffer();
|
|
503
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
504
|
+
} else {
|
|
505
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
506
|
+
|
|
507
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
508
|
+
return { instance, module };
|
|
509
|
+
} else {
|
|
510
|
+
return instance;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
function expectedResponseType(type) {
|
|
515
|
+
switch (type) {
|
|
516
|
+
case 'basic': case 'cors': case 'default': return true;
|
|
517
|
+
}
|
|
518
|
+
return false;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
function initSync(module) {
|
|
523
|
+
if (wasm !== undefined) return wasm;
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
if (module !== undefined) {
|
|
527
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
528
|
+
({module} = module)
|
|
529
|
+
} else {
|
|
530
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
const imports = __wbg_get_imports();
|
|
535
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
536
|
+
module = new WebAssembly.Module(module);
|
|
537
|
+
}
|
|
538
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
539
|
+
return __wbg_finalize_init(instance, module);
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
async function __wbg_init(module_or_path) {
|
|
543
|
+
if (wasm !== undefined) return wasm;
|
|
544
|
+
|
|
545
|
+
|
|
546
|
+
if (module_or_path !== undefined) {
|
|
547
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
548
|
+
({module_or_path} = module_or_path)
|
|
549
|
+
} else {
|
|
550
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
if (module_or_path === undefined) {
|
|
555
|
+
module_or_path = new URL('codonsplice_wasm_bg.wasm', import.meta.url);
|
|
556
|
+
}
|
|
557
|
+
const imports = __wbg_get_imports();
|
|
558
|
+
|
|
559
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
560
|
+
module_or_path = fetch(module_or_path);
|
|
561
|
+
}
|
|
562
|
+
|
|
563
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
564
|
+
|
|
565
|
+
return __wbg_finalize_init(instance, module);
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
export { initSync, __wbg_init as default };
|
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@codonsplice/wasm",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"description": "CodonSplice WASM bindings — the @codonsplice/wasm npm package",
|
|
5
|
+
"version": "0.1.0",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"files": [
|
|
8
|
+
"codonsplice_wasm_bg.wasm",
|
|
9
|
+
"codonsplice_wasm.js",
|
|
10
|
+
"codonsplice_wasm.d.ts"
|
|
11
|
+
],
|
|
12
|
+
"main": "codonsplice_wasm.js",
|
|
13
|
+
"types": "codonsplice_wasm.d.ts",
|
|
14
|
+
"sideEffects": [
|
|
15
|
+
"./snippets/*"
|
|
16
|
+
]
|
|
17
|
+
}
|