// 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/icu/latest/icu/datetime/pattern/enum.PatternLoadError.html), [2](https://docs.rs/icu/latest/icu/provider/struct.DataError.html), [3](https://docs.rs/icu/latest/icu/provider/enum.DataErrorKind.html) */ export class DateTimeFormatterLoadError { #value = undefined; static #values = new Map([ ["Unknown", 0], ["UnsupportedLength", 2051], ["DuplicateField", 2057], ["TypeTooSpecific", 2058], ["DataMarkerNotFound", 1], ["DataIdentifierNotFound", 2], ["DataInvalidRequest", 3], ["DataInconsistentData", 4], ["DataDowncast", 5], ["DataDeserialize", 6], ["DataCustom", 7], ["DataIo", 8] ]); static getAllEntries() { return DateTimeFormatterLoadError.#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 DateTimeFormatterLoadError.#objectValues[arguments[1]]; } if (value instanceof DateTimeFormatterLoadError) { return value; } let intVal = DateTimeFormatterLoadError.#values.get(value); // Nullish check, checks for null or undefined if (intVal == null) { return DateTimeFormatterLoadError.#objectValues[intVal]; } throw TypeError(value + " is not a DateTimeFormatterLoadError and does not correspond to any of its enumerator values."); } get value() { for (let entry of DateTimeFormatterLoadError.#values) { if (entry[1] == this.#value) { return entry[0]; } } } get ffiValue() { return this.#value; } static #objectValues = { [0]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), [2051]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2051), [2057]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2057), [2058]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2058), [1]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), [2]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), [3]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 3), [4]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 4), [5]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 5), [6]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 6), [7]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 7), [8]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 8), }; static Unknown = DateTimeFormatterLoadError.#objectValues[0]; static UnsupportedLength = DateTimeFormatterLoadError.#objectValues[2051]; static DuplicateField = DateTimeFormatterLoadError.#objectValues[2057]; static TypeTooSpecific = DateTimeFormatterLoadError.#objectValues[2058]; static DataMarkerNotFound = DateTimeFormatterLoadError.#objectValues[1]; static DataIdentifierNotFound = DateTimeFormatterLoadError.#objectValues[2]; static DataInvalidRequest = DateTimeFormatterLoadError.#objectValues[3]; static DataInconsistentData = DateTimeFormatterLoadError.#objectValues[4]; static DataDowncast = DateTimeFormatterLoadError.#objectValues[5]; static DataDeserialize = DateTimeFormatterLoadError.#objectValues[6]; static DataCustom = DateTimeFormatterLoadError.#objectValues[7]; static DataIo = DateTimeFormatterLoadError.#objectValues[8]; }