@next/swc-wasm-web 16.1.0-canary.1 → 16.1.0-canary.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@next/swc-wasm-web",
3
3
  "type": "module",
4
- "version": "16.1.0-canary.1",
4
+ "version": "16.1.0-canary.3",
5
5
  "files": [
6
6
  "wasm_bg.wasm",
7
7
  "wasm.js",
package/wasm.d.ts CHANGED
@@ -1,22 +1,22 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
- export function expandNextJsTemplate(content: Uint8Array, template_path: string, next_package_dir_path: string, replacements: any, injections: any, imports: any): string;
4
- export function transform(s: any, opts: any): Promise<any>;
3
+ export function mdxCompileSync(value: string, opts: any): any;
4
+ export function mdxCompile(value: string, opts: any): Promise<any>;
5
+ export function minify(s: string, opts: any): Promise<any>;
5
6
  export function transformSync(s: any, opts: any): any;
7
+ export function parse(s: string, opts: any): Promise<any>;
6
8
  export function parseSync(s: string, opts: any): any;
7
- export function minify(s: string, opts: any): Promise<any>;
9
+ export function transform(s: any, opts: any): Promise<any>;
10
+ export function expandNextJsTemplate(content: Uint8Array, template_path: string, next_package_dir_path: string, replacements: any, injections: any, imports: any): string;
8
11
  export function minifySync(s: string, opts: any): any;
9
- export function parse(s: string, opts: any): Promise<any>;
10
- export function mdxCompileSync(value: string, opts: any): any;
11
- export function mdxCompile(value: string, opts: any): Promise<any>;
12
12
 
13
13
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
14
14
 
15
15
  export interface InitOutput {
16
16
  readonly memory: WebAssembly.Memory;
17
- readonly expandNextJsTemplate: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: any, i: any) => [number, number, number, number];
18
17
  readonly mdxCompile: (a: any, b: any) => any;
19
18
  readonly mdxCompileSync: (a: any, b: any) => [number, number, number];
19
+ readonly expandNextJsTemplate: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: any, i: any) => [number, number, number, number];
20
20
  readonly minify: (a: any, b: any) => any;
21
21
  readonly minifySync: (a: any, b: any) => [number, number, number];
22
22
  readonly parse: (a: any, b: any) => any;
package/wasm.js CHANGED
@@ -213,73 +213,51 @@ function debugString(val) {
213
213
  return className;
214
214
  }
215
215
 
216
- function passArray8ToWasm0(arg, malloc) {
217
- const ptr = malloc(arg.length * 1, 1) >>> 0;
218
- getUint8ArrayMemory0().set(arg, ptr / 1);
219
- WASM_VECTOR_LEN = arg.length;
220
- return ptr;
221
- }
222
-
223
216
  function takeFromExternrefTable0(idx) {
224
217
  const value = wasm.__wbindgen_export_4.get(idx);
225
218
  wasm.__externref_table_dealloc(idx);
226
219
  return value;
227
220
  }
228
221
  /**
229
- * @param {Uint8Array} content
230
- * @param {string} template_path
231
- * @param {string} next_package_dir_path
232
- * @param {any} replacements
233
- * @param {any} injections
234
- * @param {any} imports
235
- * @returns {string}
222
+ * @param {string} value
223
+ * @param {any} opts
224
+ * @returns {any}
236
225
  */
237
- export function expandNextJsTemplate(content, template_path, next_package_dir_path, replacements, injections, imports) {
238
- const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
239
- const len0 = WASM_VECTOR_LEN;
240
- const ptr1 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
241
- const len1 = WASM_VECTOR_LEN;
242
- const ptr2 = passStringToWasm0(next_package_dir_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
243
- const len2 = WASM_VECTOR_LEN;
244
- const ret = wasm.expandNextJsTemplate(ptr0, len0, ptr1, len1, ptr2, len2, replacements, injections, imports);
245
- if (ret[3]) {
246
- throw takeFromExternrefTable0(ret[2]);
226
+ export function mdxCompileSync(value, opts) {
227
+ const ret = wasm.mdxCompileSync(value, opts);
228
+ if (ret[2]) {
229
+ throw takeFromExternrefTable0(ret[1]);
247
230
  }
248
- var v4 = getCachedStringFromWasm0(ret[0], ret[1]);
249
- if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
250
- return v4;
231
+ return takeFromExternrefTable0(ret[0]);
251
232
  }
252
233
 
253
234
  /**
254
- * @param {any} s
235
+ * @param {string} value
255
236
  * @param {any} opts
256
237
  * @returns {Promise<any>}
257
238
  */
258
- export function transform(s, opts) {
259
- const ret = wasm.transform(s, opts);
239
+ export function mdxCompile(value, opts) {
240
+ const ret = wasm.mdxCompile(value, opts);
260
241
  return ret;
261
242
  }
262
243
 
263
244
  /**
264
- * @param {any} s
245
+ * @param {string} s
265
246
  * @param {any} opts
266
- * @returns {any}
247
+ * @returns {Promise<any>}
267
248
  */
268
- export function transformSync(s, opts) {
269
- const ret = wasm.transformSync(s, opts);
270
- if (ret[2]) {
271
- throw takeFromExternrefTable0(ret[1]);
272
- }
273
- return takeFromExternrefTable0(ret[0]);
249
+ export function minify(s, opts) {
250
+ const ret = wasm.minify(s, opts);
251
+ return ret;
274
252
  }
275
253
 
276
254
  /**
277
- * @param {string} s
255
+ * @param {any} s
278
256
  * @param {any} opts
279
257
  * @returns {any}
280
258
  */
281
- export function parseSync(s, opts) {
282
- const ret = wasm.parseSync(s, opts);
259
+ export function transformSync(s, opts) {
260
+ const ret = wasm.transformSync(s, opts);
283
261
  if (ret[2]) {
284
262
  throw takeFromExternrefTable0(ret[1]);
285
263
  }
@@ -291,8 +269,8 @@ export function parseSync(s, opts) {
291
269
  * @param {any} opts
292
270
  * @returns {Promise<any>}
293
271
  */
294
- export function minify(s, opts) {
295
- const ret = wasm.minify(s, opts);
272
+ export function parse(s, opts) {
273
+ const ret = wasm.parse(s, opts);
296
274
  return ret;
297
275
  }
298
276
 
@@ -301,8 +279,8 @@ export function minify(s, opts) {
301
279
  * @param {any} opts
302
280
  * @returns {any}
303
281
  */
304
- export function minifySync(s, opts) {
305
- const ret = wasm.minifySync(s, opts);
282
+ export function parseSync(s, opts) {
283
+ const ret = wasm.parseSync(s, opts);
306
284
  if (ret[2]) {
307
285
  throw takeFromExternrefTable0(ret[1]);
308
286
  }
@@ -310,36 +288,57 @@ export function minifySync(s, opts) {
310
288
  }
311
289
 
312
290
  /**
313
- * @param {string} s
291
+ * @param {any} s
314
292
  * @param {any} opts
315
293
  * @returns {Promise<any>}
316
294
  */
317
- export function parse(s, opts) {
318
- const ret = wasm.parse(s, opts);
295
+ export function transform(s, opts) {
296
+ const ret = wasm.transform(s, opts);
319
297
  return ret;
320
298
  }
321
299
 
300
+ function passArray8ToWasm0(arg, malloc) {
301
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
302
+ getUint8ArrayMemory0().set(arg, ptr / 1);
303
+ WASM_VECTOR_LEN = arg.length;
304
+ return ptr;
305
+ }
322
306
  /**
323
- * @param {string} value
324
- * @param {any} opts
325
- * @returns {any}
307
+ * @param {Uint8Array} content
308
+ * @param {string} template_path
309
+ * @param {string} next_package_dir_path
310
+ * @param {any} replacements
311
+ * @param {any} injections
312
+ * @param {any} imports
313
+ * @returns {string}
326
314
  */
327
- export function mdxCompileSync(value, opts) {
328
- const ret = wasm.mdxCompileSync(value, opts);
329
- if (ret[2]) {
330
- throw takeFromExternrefTable0(ret[1]);
315
+ export function expandNextJsTemplate(content, template_path, next_package_dir_path, replacements, injections, imports) {
316
+ const ptr0 = passArray8ToWasm0(content, wasm.__wbindgen_malloc);
317
+ const len0 = WASM_VECTOR_LEN;
318
+ const ptr1 = passStringToWasm0(template_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
319
+ const len1 = WASM_VECTOR_LEN;
320
+ const ptr2 = passStringToWasm0(next_package_dir_path, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
321
+ const len2 = WASM_VECTOR_LEN;
322
+ const ret = wasm.expandNextJsTemplate(ptr0, len0, ptr1, len1, ptr2, len2, replacements, injections, imports);
323
+ if (ret[3]) {
324
+ throw takeFromExternrefTable0(ret[2]);
331
325
  }
332
- return takeFromExternrefTable0(ret[0]);
326
+ var v4 = getCachedStringFromWasm0(ret[0], ret[1]);
327
+ if (ret[0] !== 0) { wasm.__wbindgen_free(ret[0], ret[1], 1); }
328
+ return v4;
333
329
  }
334
330
 
335
331
  /**
336
- * @param {string} value
332
+ * @param {string} s
337
333
  * @param {any} opts
338
- * @returns {Promise<any>}
334
+ * @returns {any}
339
335
  */
340
- export function mdxCompile(value, opts) {
341
- const ret = wasm.mdxCompile(value, opts);
342
- return ret;
336
+ export function minifySync(s, opts) {
337
+ const ret = wasm.minifySync(s, opts);
338
+ if (ret[2]) {
339
+ throw takeFromExternrefTable0(ret[1]);
340
+ }
341
+ return takeFromExternrefTable0(ret[0]);
343
342
  }
344
343
 
345
344
  function __wbg_adapter_50(arg0, arg1, arg2) {
@@ -613,7 +612,7 @@ function __wbg_get_imports() {
613
612
  const ret = false;
614
613
  return ret;
615
614
  };
616
- imports.wbg.__wbindgen_closure_wrapper23640 = function(arg0, arg1, arg2) {
615
+ imports.wbg.__wbindgen_closure_wrapper23621 = function(arg0, arg1, arg2) {
617
616
  const ret = makeMutClosure(arg0, arg1, 1166, __wbg_adapter_50);
618
617
  return ret;
619
618
  };
package/wasm_bg.wasm CHANGED
Binary file