@swc/wasm 1.3.2 → 1.3.4
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.d.ts +36 -36
- package/wasm.js +39 -39
- package/wasm_bg.wasm +0 -0
package/package.json
CHANGED
package/wasm.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
|
}
|
|
@@ -2789,39 +2825,3 @@ export interface Invalid extends Node, HasSpan {
|
|
|
2789
2825
|
}
|
|
2790
2826
|
|
|
2791
2827
|
|
|
2792
|
-
|
|
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
|
-
|
package/wasm.js
CHANGED
|
@@ -87,6 +87,10 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
87
87
|
return ptr;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
+
function isLikeNone(x) {
|
|
91
|
+
return x === undefined || x === null;
|
|
92
|
+
}
|
|
93
|
+
|
|
90
94
|
let cachedInt32Memory0 = new Int32Array();
|
|
91
95
|
|
|
92
96
|
function getInt32Memory0() {
|
|
@@ -96,10 +100,6 @@ function getInt32Memory0() {
|
|
|
96
100
|
return cachedInt32Memory0;
|
|
97
101
|
}
|
|
98
102
|
|
|
99
|
-
function isLikeNone(x) {
|
|
100
|
-
return x === undefined || x === null;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
103
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
104
104
|
|
|
105
105
|
cachedTextDecoder.decode();
|
|
@@ -294,10 +294,24 @@ module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
|
294
294
|
takeObject(arg0);
|
|
295
295
|
};
|
|
296
296
|
|
|
297
|
-
module.exports.
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
297
|
+
module.exports.__wbg_new_9962f939219f1820 = function(arg0, arg1) {
|
|
298
|
+
try {
|
|
299
|
+
var state0 = {a: arg0, b: arg1};
|
|
300
|
+
var cb0 = (arg0, arg1) => {
|
|
301
|
+
const a = state0.a;
|
|
302
|
+
state0.a = 0;
|
|
303
|
+
try {
|
|
304
|
+
return __wbg_adapter_45(a, state0.b, arg0, arg1);
|
|
305
|
+
} finally {
|
|
306
|
+
state0.a = a;
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
const ret = new Promise(cb0);
|
|
310
|
+
return addHeapObject(ret);
|
|
311
|
+
} finally {
|
|
312
|
+
state0.a = state0.b = 0;
|
|
313
|
+
}
|
|
314
|
+
};
|
|
301
315
|
|
|
302
316
|
module.exports.__wbindgen_is_null = function(arg0) {
|
|
303
317
|
const ret = getObject(arg0) === null;
|
|
@@ -309,13 +323,9 @@ module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
|
309
323
|
return ret;
|
|
310
324
|
};
|
|
311
325
|
|
|
312
|
-
module.exports.
|
|
313
|
-
const
|
|
314
|
-
|
|
315
|
-
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
316
|
-
const len0 = WASM_VECTOR_LEN;
|
|
317
|
-
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
318
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
326
|
+
module.exports.__wbindgen_is_string = function(arg0) {
|
|
327
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
328
|
+
return ret;
|
|
319
329
|
};
|
|
320
330
|
|
|
321
331
|
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
@@ -327,33 +337,23 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
327
337
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
328
338
|
};
|
|
329
339
|
|
|
340
|
+
module.exports.__wbg_call_168da88779e35f61 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
341
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
342
|
+
return addHeapObject(ret);
|
|
343
|
+
}, arguments) };
|
|
344
|
+
|
|
330
345
|
module.exports.__wbindgen_json_parse = function(arg0, arg1) {
|
|
331
346
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
332
347
|
return addHeapObject(ret);
|
|
333
348
|
};
|
|
334
349
|
|
|
335
|
-
module.exports.
|
|
336
|
-
const
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
var state0 = {a: arg0, b: arg1};
|
|
343
|
-
var cb0 = (arg0, arg1) => {
|
|
344
|
-
const a = state0.a;
|
|
345
|
-
state0.a = 0;
|
|
346
|
-
try {
|
|
347
|
-
return __wbg_adapter_45(a, state0.b, arg0, arg1);
|
|
348
|
-
} finally {
|
|
349
|
-
state0.a = a;
|
|
350
|
-
}
|
|
351
|
-
};
|
|
352
|
-
const ret = new Promise(cb0);
|
|
353
|
-
return addHeapObject(ret);
|
|
354
|
-
} finally {
|
|
355
|
-
state0.a = state0.b = 0;
|
|
356
|
-
}
|
|
350
|
+
module.exports.__wbindgen_json_serialize = function(arg0, arg1) {
|
|
351
|
+
const obj = getObject(arg1);
|
|
352
|
+
const ret = JSON.stringify(obj === undefined ? null : obj);
|
|
353
|
+
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
354
|
+
const len0 = WASM_VECTOR_LEN;
|
|
355
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
356
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
357
357
|
};
|
|
358
358
|
|
|
359
359
|
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
@@ -419,8 +419,8 @@ module.exports.__wbg_then_11f7a54d67b4bfad = function(arg0, arg1) {
|
|
|
419
419
|
return addHeapObject(ret);
|
|
420
420
|
};
|
|
421
421
|
|
|
422
|
-
module.exports.
|
|
423
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
422
|
+
module.exports.__wbindgen_closure_wrapper19221 = function(arg0, arg1, arg2) {
|
|
423
|
+
const ret = makeMutClosure(arg0, arg1, 219, __wbg_adapter_22);
|
|
424
424
|
return addHeapObject(ret);
|
|
425
425
|
};
|
|
426
426
|
|
package/wasm_bg.wasm
CHANGED
|
Binary file
|