math-core 0.1.1 → 0.2.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.
@@ -5,15 +5,22 @@ interface MathCoreOptions {
5
5
  prettyPrint?: "never" | "always" | "auto";
6
6
  macros?: Map<string, string>;
7
7
  xmlNamespace?: boolean;
8
- continueOnError?: boolean;
8
+ throwOnError?: boolean;
9
9
  }
10
10
 
11
11
 
12
+ export class ConfigParseError {
13
+ private constructor();
14
+ free(): void;
15
+ [Symbol.dispose](): void;
16
+ readonly message: string;
17
+ }
12
18
  export class LatexError {
13
19
  private constructor();
14
20
  free(): void;
15
21
  [Symbol.dispose](): void;
16
- message: any;
22
+ readonly context: string | undefined;
23
+ readonly message: string;
17
24
  location: number;
18
25
  }
19
26
  export class LatexToMathML {
@@ -116,6 +116,41 @@ function takeFromExternrefTable0(idx) {
116
116
  return value;
117
117
  }
118
118
 
119
+ const ConfigParseErrorFinalization = (typeof FinalizationRegistry === 'undefined')
120
+ ? { register: () => {}, unregister: () => {} }
121
+ : new FinalizationRegistry(ptr => wasm.__wbg_configparseerror_free(ptr >>> 0, 1));
122
+
123
+ export class ConfigParseError {
124
+
125
+ static __wrap(ptr) {
126
+ ptr = ptr >>> 0;
127
+ const obj = Object.create(ConfigParseError.prototype);
128
+ obj.__wbg_ptr = ptr;
129
+ ConfigParseErrorFinalization.register(obj, obj.__wbg_ptr, obj);
130
+ return obj;
131
+ }
132
+
133
+ __destroy_into_raw() {
134
+ const ptr = this.__wbg_ptr;
135
+ this.__wbg_ptr = 0;
136
+ ConfigParseErrorFinalization.unregister(this);
137
+ return ptr;
138
+ }
139
+
140
+ free() {
141
+ const ptr = this.__destroy_into_raw();
142
+ wasm.__wbg_configparseerror_free(ptr, 0);
143
+ }
144
+ /**
145
+ * @returns {string}
146
+ */
147
+ get message() {
148
+ const ret = wasm.configparseerror_message(this.__wbg_ptr);
149
+ return ret;
150
+ }
151
+ }
152
+ if (Symbol.dispose) ConfigParseError.prototype[Symbol.dispose] = ConfigParseError.prototype.free;
153
+
119
154
  const LatexErrorFinalization = (typeof FinalizationRegistry === 'undefined')
120
155
  ? { register: () => {}, unregister: () => {} }
121
156
  : new FinalizationRegistry(ptr => wasm.__wbg_latexerror_free(ptr >>> 0, 1));
@@ -142,17 +177,18 @@ export class LatexError {
142
177
  wasm.__wbg_latexerror_free(ptr, 0);
143
178
  }
144
179
  /**
145
- * @returns {any}
180
+ * @returns {string | undefined}
146
181
  */
147
- get message() {
148
- const ret = wasm.__wbg_get_latexerror_message(this.__wbg_ptr);
182
+ get context() {
183
+ const ret = wasm.latexerror_context(this.__wbg_ptr);
149
184
  return ret;
150
185
  }
151
186
  /**
152
- * @param {any} arg0
187
+ * @returns {string}
153
188
  */
154
- set message(arg0) {
155
- wasm.__wbg_set_latexerror_message(this.__wbg_ptr, arg0);
189
+ get message() {
190
+ const ret = wasm.latexerror_message(this.__wbg_ptr);
191
+ return ret;
156
192
  }
157
193
  /**
158
194
  * @returns {number}
@@ -246,9 +282,9 @@ export function __wbg___wbindgen_throw_b855445ff6a94295(arg0, arg1) {
246
282
  throw new Error(getStringFromWasm0(arg0, arg1));
247
283
  };
248
284
 
249
- export function __wbg_continueOnError_b8dff4404d45b65e(arg0) {
250
- const ret = arg0.continueOnError;
251
- return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
285
+ export function __wbg_configparseerror_new(arg0) {
286
+ const ret = ConfigParseError.__wrap(arg0);
287
+ return ret;
252
288
  };
253
289
 
254
290
  export function __wbg_done_2042aa2670fb1db1(arg0) {
@@ -276,7 +312,7 @@ export function __wbg_latexerror_new(arg0) {
276
312
  return ret;
277
313
  };
278
314
 
279
- export function __wbg_macros_4f3a3cb8196fd9f6(arg0) {
315
+ export function __wbg_macros_f77df81fd3cdf2b1(arg0) {
280
316
  const ret = arg0.macros;
281
317
  return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
282
318
  };
@@ -286,7 +322,7 @@ export function __wbg_next_020810e0ae8ebcb0() { return handleError(function (arg
286
322
  return ret;
287
323
  }, arguments) };
288
324
 
289
- export function __wbg_prettyPrint_69e2e31a28db25ad(arg0, arg1) {
325
+ export function __wbg_prettyPrint_efae38397ba4eb91(arg0, arg1) {
290
326
  const ret = arg1.prettyPrint;
291
327
  var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
292
328
  var len1 = WASM_VECTOR_LEN;
@@ -299,12 +335,17 @@ export function __wbg_size_252e34f77ca59a74(arg0) {
299
335
  return ret;
300
336
  };
301
337
 
338
+ export function __wbg_throwOnError_98d85a050ea766f7(arg0) {
339
+ const ret = arg0.throwOnError;
340
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
341
+ };
342
+
302
343
  export function __wbg_value_692627309814bb8c(arg0) {
303
344
  const ret = arg0.value;
304
345
  return ret;
305
346
  };
306
347
 
307
- export function __wbg_xmlNamespace_19354e2aa7a61d14(arg0) {
348
+ export function __wbg_xmlNamespace_1292c444f8ceba75(arg0) {
308
349
  const ret = arg0.xmlNamespace;
309
350
  return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
310
351
  };
Binary file
@@ -1,12 +1,14 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
3
  export const memory: WebAssembly.Memory;
4
+ export const __wbg_configparseerror_free: (a: number, b: number) => void;
4
5
  export const __wbg_get_latexerror_location: (a: number) => number;
5
- export const __wbg_get_latexerror_message: (a: number) => any;
6
6
  export const __wbg_latexerror_free: (a: number, b: number) => void;
7
7
  export const __wbg_latextomathml_free: (a: number, b: number) => void;
8
8
  export const __wbg_set_latexerror_location: (a: number, b: number) => void;
9
- export const __wbg_set_latexerror_message: (a: number, b: any) => void;
9
+ export const configparseerror_message: (a: number) => any;
10
+ export const latexerror_context: (a: number) => any;
11
+ export const latexerror_message: (a: number) => any;
10
12
  export const latextomathml_convert_with_global_counter: (a: number, b: number, c: number, d: number) => [number, number, number];
11
13
  export const latextomathml_convert_with_local_counter: (a: number, b: number, c: number, d: number) => [number, number, number];
12
14
  export const latextomathml_new: (a: any) => [number, number, number];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "math-core",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "Convert LaTeX to MathML Core",
5
5
  "homepage": "https://github.com/tmke8/math-core#readme",
6
6
  "bugs": {