// generated by diplomat-tool import wasm from "./diplomat-wasm.mjs"; import * as diplomatRuntime from "./diplomat-runtime.mjs"; // Base enumerator definition /** Additional information: [1](https://docs.rs/fixed_decimal/latest/fixed_decimal/enum.ParseError.html) */ export class FixedDecimalParseError { #value = undefined; static #values = new Map([ ["Unknown", 0], ["Limit", 1], ["Syntax", 2] ]); static getAllEntries() { return FixedDecimalParseError.#values.entries(); } constructor(value) { if (arguments.length > 1 && arguments[0] === diplomatRuntime.internalConstructor) { // We pass in two internalConstructor arguments to create *new* // instances of this type, otherwise the enums are treated as singletons. if (arguments[1] === diplomatRuntime.internalConstructor ) { this.#value = arguments[2]; return; } return FixedDecimalParseError.#objectValues[arguments[1]]; } if (value instanceof FixedDecimalParseError) { return value; } let intVal = FixedDecimalParseError.#values.get(value); // Nullish check, checks for null or undefined if (intVal == null) { return FixedDecimalParseError.#objectValues[intVal]; } throw TypeError(value + " is not a FixedDecimalParseError and does not correspond to any of its enumerator values."); } get value() { return [...FixedDecimalParseError.#values.keys()][this.#value]; } get ffiValue() { return this.#value; } static #objectValues = [ new FixedDecimalParseError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), new FixedDecimalParseError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), new FixedDecimalParseError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), ]; static Unknown = FixedDecimalParseError.#objectValues[0]; static Limit = FixedDecimalParseError.#objectValues[1]; static Syntax = FixedDecimalParseError.#objectValues[2]; }