@vizejs/wasm 0.108.0 → 0.110.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizejs/wasm",
3
- "version": "0.108.0",
3
+ "version": "0.110.0",
4
4
  "description": "Vize WASM bindings for browser environments",
5
5
  "homepage": "https://github.com/ubugeeei/vize",
6
6
  "bugs": {
package/vize_vitrine.d.ts CHANGED
@@ -28,10 +28,18 @@ export class Compiler {
28
28
  * Parse template to AST
29
29
  */
30
30
  parse(template: string, _options: any): any;
31
+ /**
32
+ * Parse CSS into a serialized LightningCSS AST.
33
+ */
34
+ parseCssAst(css: string, options: any): any;
31
35
  /**
32
36
  * Parse SFC (.vue file)
33
37
  */
34
38
  parseSfc(source: string, options: any): any;
39
+ /**
40
+ * Print CSS from a serialized LightningCSS AST.
41
+ */
42
+ printCssAst(ast: any, options: any): any;
35
43
  }
36
44
 
37
45
  /**
@@ -129,6 +137,11 @@ export function lintTemplate(source: string, options: any): any;
129
137
  */
130
138
  export function parseArt(source: string, options: any): any;
131
139
 
140
+ /**
141
+ * Parse CSS to AST (free function)
142
+ */
143
+ export function parseCssAst(css: string, options: any): any;
144
+
132
145
  /**
133
146
  * Parse SFC (free function)
134
147
  */
@@ -139,6 +152,11 @@ export function parseSfc(source: string, options: any): any;
139
152
  */
140
153
  export function parseTemplate(template: string, options: any): any;
141
154
 
155
+ /**
156
+ * Print CSS from AST (free function)
157
+ */
158
+ export function printCssAst(ast: any, options: any): any;
159
+
142
160
  /**
143
161
  * Perform type checking on a Vue SFC
144
162
  *
@@ -164,7 +182,9 @@ export interface InitOutput {
164
182
  readonly compiler_compileSfc: (a: number, b: number, c: number, d: any) => [number, number, number];
165
183
  readonly compiler_compileVapor: (a: number, b: number, c: number, d: any) => [number, number, number];
166
184
  readonly compiler_parse: (a: number, b: number, c: number, d: any) => [number, number, number];
185
+ readonly compiler_parseCssAst: (a: number, b: number, c: number, d: any) => [number, number, number];
167
186
  readonly compiler_parseSfc: (a: number, b: number, c: number, d: any) => [number, number, number];
187
+ readonly compiler_printCssAst: (a: number, b: any, c: any) => [number, number, number];
168
188
  readonly formatScript: (a: number, b: number, c: any) => [number, number, number];
169
189
  readonly formatSfc: (a: number, b: number, c: any) => [number, number, number];
170
190
  readonly formatTemplate: (a: number, b: number, c: any) => [number, number, number];
@@ -177,8 +197,10 @@ export interface InitOutput {
177
197
  readonly lintSfc: (a: number, b: number, c: any) => [number, number, number];
178
198
  readonly lintTemplate: (a: number, b: number, c: any) => [number, number, number];
179
199
  readonly parseArt: (a: number, b: number, c: any) => [number, number, number];
200
+ readonly parseCssAst: (a: number, b: number, c: any) => [number, number, number];
180
201
  readonly parseSfc: (a: number, b: number, c: any) => [number, number, number];
181
202
  readonly parseTemplate: (a: number, b: number, c: any) => [number, number, number];
203
+ readonly printCssAst: (a: any, b: any) => [number, number, number];
182
204
  readonly typeCheck: (a: number, b: number, c: any) => [number, number, number];
183
205
  readonly compiler_new: () => number;
184
206
  readonly __wbindgen_malloc: (a: number, b: number) => number;
package/vize_vitrine.js CHANGED
@@ -95,6 +95,21 @@ export class Compiler {
95
95
  }
96
96
  return takeFromExternrefTable0(ret[0]);
97
97
  }
98
+ /**
99
+ * Parse CSS into a serialized LightningCSS AST.
100
+ * @param {string} css
101
+ * @param {any} options
102
+ * @returns {any}
103
+ */
104
+ parseCssAst(css, options) {
105
+ const ptr0 = passStringToWasm0(css, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
106
+ const len0 = WASM_VECTOR_LEN;
107
+ const ret = wasm.compiler_parseCssAst(this.__wbg_ptr, ptr0, len0, options);
108
+ if (ret[2]) {
109
+ throw takeFromExternrefTable0(ret[1]);
110
+ }
111
+ return takeFromExternrefTable0(ret[0]);
112
+ }
98
113
  /**
99
114
  * Parse SFC (.vue file)
100
115
  * @param {string} source
@@ -110,6 +125,19 @@ export class Compiler {
110
125
  }
111
126
  return takeFromExternrefTable0(ret[0]);
112
127
  }
128
+ /**
129
+ * Print CSS from a serialized LightningCSS AST.
130
+ * @param {any} ast
131
+ * @param {any} options
132
+ * @returns {any}
133
+ */
134
+ printCssAst(ast, options) {
135
+ const ret = wasm.compiler_printCssAst(this.__wbg_ptr, ast, options);
136
+ if (ret[2]) {
137
+ throw takeFromExternrefTable0(ret[1]);
138
+ }
139
+ return takeFromExternrefTable0(ret[0]);
140
+ }
113
141
  }
114
142
  if (Symbol.dispose) Compiler.prototype[Symbol.dispose] = Compiler.prototype.free;
115
143
 
@@ -401,6 +429,22 @@ export function parseArt(source, options) {
401
429
  return takeFromExternrefTable0(ret[0]);
402
430
  }
403
431
 
432
+ /**
433
+ * Parse CSS to AST (free function)
434
+ * @param {string} css
435
+ * @param {any} options
436
+ * @returns {any}
437
+ */
438
+ export function parseCssAst(css, options) {
439
+ const ptr0 = passStringToWasm0(css, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
440
+ const len0 = WASM_VECTOR_LEN;
441
+ const ret = wasm.parseCssAst(ptr0, len0, options);
442
+ if (ret[2]) {
443
+ throw takeFromExternrefTable0(ret[1]);
444
+ }
445
+ return takeFromExternrefTable0(ret[0]);
446
+ }
447
+
404
448
  /**
405
449
  * Parse SFC (free function)
406
450
  * @param {string} source
@@ -433,6 +477,20 @@ export function parseTemplate(template, options) {
433
477
  return takeFromExternrefTable0(ret[0]);
434
478
  }
435
479
 
480
+ /**
481
+ * Print CSS from AST (free function)
482
+ * @param {any} ast
483
+ * @param {any} options
484
+ * @returns {any}
485
+ */
486
+ export function printCssAst(ast, options) {
487
+ const ret = wasm.printCssAst(ast, options);
488
+ if (ret[2]) {
489
+ throw takeFromExternrefTable0(ret[1]);
490
+ }
491
+ return takeFromExternrefTable0(ret[0]);
492
+ }
493
+
436
494
  /**
437
495
  * Perform type checking on a Vue SFC
438
496
  *
@@ -469,6 +527,12 @@ function __wbg_get_imports() {
469
527
  getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
470
528
  getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
471
529
  },
530
+ __wbg___wbindgen_bigint_get_as_i64_410e28c7b761ad83: function(arg0, arg1) {
531
+ const v = arg1;
532
+ const ret = typeof(v) === 'bigint' ? v : undefined;
533
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
534
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
535
+ },
472
536
  __wbg___wbindgen_boolean_get_2304fb8c853028c8: function(arg0) {
473
537
  const v = arg0;
474
538
  const ret = typeof(v) === 'boolean' ? v : undefined;
@@ -485,6 +549,10 @@ function __wbg_get_imports() {
485
549
  const ret = arg0 in arg1;
486
550
  return ret;
487
551
  },
552
+ __wbg___wbindgen_is_bigint_aeae3893f30ed54e: function(arg0) {
553
+ const ret = typeof(arg0) === 'bigint';
554
+ return ret;
555
+ },
488
556
  __wbg___wbindgen_is_function_5cd60d5cf78b4eef: function(arg0) {
489
557
  const ret = typeof(arg0) === 'function';
490
558
  return ret;
@@ -506,6 +574,10 @@ function __wbg_get_imports() {
506
574
  const ret = arg0 === undefined;
507
575
  return ret;
508
576
  },
577
+ __wbg___wbindgen_jsval_eq_c0ed08b3e0f393b9: function(arg0, arg1) {
578
+ const ret = arg0 === arg1;
579
+ return ret;
580
+ },
509
581
  __wbg___wbindgen_jsval_loose_eq_0ad77b7717db155c: function(arg0, arg1) {
510
582
  const ret = arg0 == arg1;
511
583
  return ret;
@@ -573,6 +645,16 @@ function __wbg_get_imports() {
573
645
  const ret = result;
574
646
  return ret;
575
647
  },
648
+ __wbg_instanceof_Map_16f217b9a2a08d8c: function(arg0) {
649
+ let result;
650
+ try {
651
+ result = arg0 instanceof Map;
652
+ } catch (_) {
653
+ result = false;
654
+ }
655
+ const ret = result;
656
+ return ret;
657
+ },
576
658
  __wbg_instanceof_Uint8Array_abd07d4bd221d50b: function(arg0) {
577
659
  let result;
578
660
  try {
Binary file