@swc/wasm-web 1.2.226 → 1.2.227
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/wasm-web.d.ts +38 -38
- package/wasm-web.js +52 -52
- package/wasm-web_bg.wasm +0 -0
package/package.json
CHANGED
package/wasm-web.d.ts
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
|
+
export function minify(src: string, opts?: JsMinifyOptions): Promise<Output>;
|
|
5
|
+
export function minifySync(code: string, opts?: JsMinifyOptions): Output;
|
|
6
|
+
|
|
7
|
+
export function parse(src: string, options: ParseOptions & {
|
|
8
|
+
isModule: false;
|
|
9
|
+
}): Promise<Script>;
|
|
10
|
+
export function parse(src: string, options?: ParseOptions): Promise<Module>;
|
|
11
|
+
export function parseSync(src: string, options: ParseOptions & {
|
|
12
|
+
isModule: false;
|
|
13
|
+
}): Script;
|
|
14
|
+
export function parseSync(src: string, options?: ParseOptions): Module;
|
|
15
|
+
|
|
16
|
+
export function print(m: Program, options?: Options): Promise<Output>;
|
|
17
|
+
export function printSync(m: Program, options?: Options): Output
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Note: this interface currently does not do _actual_ async work, only provides
|
|
21
|
+
* a corresponding async interfaces to the `@swc/core`'s interface.
|
|
22
|
+
*/
|
|
23
|
+
export function transform(
|
|
24
|
+
code: string | Program,
|
|
25
|
+
options?: Options,
|
|
26
|
+
experimental_plugin_bytes_resolver?: any
|
|
27
|
+
): Promise<Output>;
|
|
28
|
+
/**
|
|
29
|
+
* @param {string} code
|
|
30
|
+
* @param {Options} opts
|
|
31
|
+
* @param {Record<string, ArrayBuffer>} experimental_plugin_bytes_resolver An object contains bytes array for the plugin
|
|
32
|
+
* specified in config. Key of record represents the name of the plugin specified in config. Note this is an experimental
|
|
33
|
+
* interface, likely will change.
|
|
34
|
+
* @returns {Output}
|
|
35
|
+
*/
|
|
36
|
+
export function transformSync(code: string | Program, opts?: Options, experimental_plugin_bytes_resolver?: any): Output;
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
4
40
|
export interface Plugin {
|
|
5
41
|
(module: Program): Program;
|
|
6
42
|
}
|
|
@@ -2790,42 +2826,6 @@ export interface Invalid extends Node, HasSpan {
|
|
|
2790
2826
|
|
|
2791
2827
|
|
|
2792
2828
|
|
|
2793
|
-
export function minify(src: string, opts?: JsMinifyOptions): Promise<Output>;
|
|
2794
|
-
export function minifySync(code: string, opts?: JsMinifyOptions): Output;
|
|
2795
|
-
|
|
2796
|
-
export function parse(src: string, options: ParseOptions & {
|
|
2797
|
-
isModule: false;
|
|
2798
|
-
}): Promise<Script>;
|
|
2799
|
-
export function parse(src: string, options?: ParseOptions): Promise<Module>;
|
|
2800
|
-
export function parseSync(src: string, options: ParseOptions & {
|
|
2801
|
-
isModule: false;
|
|
2802
|
-
}): Script;
|
|
2803
|
-
export function parseSync(src: string, options?: ParseOptions): Module;
|
|
2804
|
-
|
|
2805
|
-
export function print(m: Program, options?: Options): Promise<Output>;
|
|
2806
|
-
export function printSync(m: Program, options?: Options): Output
|
|
2807
|
-
|
|
2808
|
-
/**
|
|
2809
|
-
* Note: this interface currently does not do _actual_ async work, only provides
|
|
2810
|
-
* a corresponding async interfaces to the `@swc/core`'s interface.
|
|
2811
|
-
*/
|
|
2812
|
-
export function transform(
|
|
2813
|
-
code: string | Program,
|
|
2814
|
-
options?: Options,
|
|
2815
|
-
experimental_plugin_bytes_resolver?: any
|
|
2816
|
-
): Promise<Output>;
|
|
2817
|
-
/**
|
|
2818
|
-
* @param {string} code
|
|
2819
|
-
* @param {Options} opts
|
|
2820
|
-
* @param {Record<string, ArrayBuffer>} experimental_plugin_bytes_resolver An object contains bytes array for the plugin
|
|
2821
|
-
* specified in config. Key of record represents the name of the plugin specified in config. Note this is an experimental
|
|
2822
|
-
* interface, likely will change.
|
|
2823
|
-
* @returns {Output}
|
|
2824
|
-
*/
|
|
2825
|
-
export function transformSync(code: string | Program, opts?: Options, experimental_plugin_bytes_resolver?: any): Output;
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
2829
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
2830
2830
|
|
|
2831
2831
|
export interface InitOutput {
|
|
@@ -2841,11 +2841,11 @@ export interface InitOutput {
|
|
|
2841
2841
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
2842
2842
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
2843
2843
|
readonly __wbindgen_export_2: WebAssembly.Table;
|
|
2844
|
-
readonly
|
|
2844
|
+
readonly _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2a066990b442725f: (a: number, b: number, c: number) => void;
|
|
2845
2845
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
2846
2846
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
2847
2847
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
2848
|
-
readonly
|
|
2848
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__h48d92760bcda3ab6: (a: number, b: number, c: number, d: number) => void;
|
|
2849
2849
|
}
|
|
2850
2850
|
|
|
2851
2851
|
/**
|
package/wasm-web.js
CHANGED
|
@@ -21,7 +21,9 @@ function takeObject(idx) {
|
|
|
21
21
|
return ret;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
25
|
+
|
|
26
|
+
cachedTextDecoder.decode();
|
|
25
27
|
|
|
26
28
|
let cachedUint8Memory0 = new Uint8Array();
|
|
27
29
|
|
|
@@ -32,6 +34,21 @@ function getUint8Memory0() {
|
|
|
32
34
|
return cachedUint8Memory0;
|
|
33
35
|
}
|
|
34
36
|
|
|
37
|
+
function getStringFromWasm0(ptr, len) {
|
|
38
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function addHeapObject(obj) {
|
|
42
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
43
|
+
const idx = heap_next;
|
|
44
|
+
heap_next = heap[idx];
|
|
45
|
+
|
|
46
|
+
heap[idx] = obj;
|
|
47
|
+
return idx;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
let WASM_VECTOR_LEN = 0;
|
|
51
|
+
|
|
35
52
|
const cachedTextEncoder = new TextEncoder('utf-8');
|
|
36
53
|
|
|
37
54
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -85,10 +102,6 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
85
102
|
return ptr;
|
|
86
103
|
}
|
|
87
104
|
|
|
88
|
-
function isLikeNone(x) {
|
|
89
|
-
return x === undefined || x === null;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
105
|
let cachedInt32Memory0 = new Int32Array();
|
|
93
106
|
|
|
94
107
|
function getInt32Memory0() {
|
|
@@ -98,21 +111,8 @@ function getInt32Memory0() {
|
|
|
98
111
|
return cachedInt32Memory0;
|
|
99
112
|
}
|
|
100
113
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
cachedTextDecoder.decode();
|
|
104
|
-
|
|
105
|
-
function getStringFromWasm0(ptr, len) {
|
|
106
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function addHeapObject(obj) {
|
|
110
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
111
|
-
const idx = heap_next;
|
|
112
|
-
heap_next = heap[idx];
|
|
113
|
-
|
|
114
|
-
heap[idx] = obj;
|
|
115
|
-
return idx;
|
|
114
|
+
function isLikeNone(x) {
|
|
115
|
+
return x === undefined || x === null;
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
@@ -140,7 +140,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
140
140
|
return real;
|
|
141
141
|
}
|
|
142
142
|
function __wbg_adapter_22(arg0, arg1, arg2) {
|
|
143
|
-
wasm.
|
|
143
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h2a066990b442725f(arg0, arg1, addHeapObject(arg2));
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
/**
|
|
@@ -285,7 +285,7 @@ function handleError(f, args) {
|
|
|
285
285
|
}
|
|
286
286
|
}
|
|
287
287
|
function __wbg_adapter_45(arg0, arg1, arg2, arg3) {
|
|
288
|
-
wasm.
|
|
288
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h48d92760bcda3ab6(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
289
289
|
}
|
|
290
290
|
|
|
291
291
|
async function load(module, imports) {
|
|
@@ -322,21 +322,13 @@ async function load(module, imports) {
|
|
|
322
322
|
function getImports() {
|
|
323
323
|
const imports = {};
|
|
324
324
|
imports.wbg = {};
|
|
325
|
+
imports.wbg.__wbg_call_65af9f665ab6ade5 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
326
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
327
|
+
return addHeapObject(ret);
|
|
328
|
+
}, arguments) };
|
|
325
329
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
326
330
|
takeObject(arg0);
|
|
327
331
|
};
|
|
328
|
-
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
329
|
-
const ret = typeof(getObject(arg0)) === 'string';
|
|
330
|
-
return ret;
|
|
331
|
-
};
|
|
332
|
-
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
333
|
-
const obj = getObject(arg1);
|
|
334
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
335
|
-
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
336
|
-
var len0 = WASM_VECTOR_LEN;
|
|
337
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
338
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
339
|
-
};
|
|
340
332
|
imports.wbg.__wbindgen_is_null = function(arg0) {
|
|
341
333
|
const ret = getObject(arg0) === null;
|
|
342
334
|
return ret;
|
|
@@ -345,22 +337,6 @@ function getImports() {
|
|
|
345
337
|
const ret = getObject(arg0) === undefined;
|
|
346
338
|
return ret;
|
|
347
339
|
};
|
|
348
|
-
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) {
|
|
349
|
-
const obj = getObject(arg1);
|
|
350
|
-
const ret = JSON.stringify(obj === undefined ? null : obj);
|
|
351
|
-
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
352
|
-
const len0 = WASM_VECTOR_LEN;
|
|
353
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
354
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
355
|
-
};
|
|
356
|
-
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) {
|
|
357
|
-
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
358
|
-
return addHeapObject(ret);
|
|
359
|
-
};
|
|
360
|
-
imports.wbg.__wbg_call_65af9f665ab6ade5 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
361
|
-
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
362
|
-
return addHeapObject(ret);
|
|
363
|
-
}, arguments) };
|
|
364
340
|
imports.wbg.__wbg_new_52205195aa880fc2 = function(arg0, arg1) {
|
|
365
341
|
try {
|
|
366
342
|
var state0 = {a: arg0, b: arg1};
|
|
@@ -379,6 +355,30 @@ function getImports() {
|
|
|
379
355
|
state0.a = state0.b = 0;
|
|
380
356
|
}
|
|
381
357
|
};
|
|
358
|
+
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) {
|
|
359
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
360
|
+
return addHeapObject(ret);
|
|
361
|
+
};
|
|
362
|
+
imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) {
|
|
363
|
+
const obj = getObject(arg1);
|
|
364
|
+
const ret = JSON.stringify(obj === undefined ? null : obj);
|
|
365
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
366
|
+
const len0 = WASM_VECTOR_LEN;
|
|
367
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
368
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
369
|
+
};
|
|
370
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
371
|
+
const obj = getObject(arg1);
|
|
372
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
373
|
+
var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
374
|
+
var len0 = WASM_VECTOR_LEN;
|
|
375
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
376
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
377
|
+
};
|
|
378
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
379
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
380
|
+
return ret;
|
|
381
|
+
};
|
|
382
382
|
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
383
383
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
384
384
|
return addHeapObject(ret);
|
|
@@ -431,8 +431,8 @@ imports.wbg.__wbg_then_18da6e5453572fc8 = function(arg0, arg1) {
|
|
|
431
431
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
432
432
|
return addHeapObject(ret);
|
|
433
433
|
};
|
|
434
|
-
imports.wbg.
|
|
435
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
434
|
+
imports.wbg.__wbindgen_closure_wrapper14517 = function(arg0, arg1, arg2) {
|
|
435
|
+
const ret = makeMutClosure(arg0, arg1, 148, __wbg_adapter_22);
|
|
436
436
|
return addHeapObject(ret);
|
|
437
437
|
};
|
|
438
438
|
|
package/wasm-web_bg.wasm
CHANGED
|
Binary file
|