Source code

Revision control

Copy as Markdown

Other Tools

// generated by diplomat-tool
import wasm from "./diplomat-wasm.mjs";
import * as diplomatRuntime from "./diplomat-runtime.mjs";
/**
*/
export class DateTimeFormatterLoadError {
#value = undefined;
static #values = new Map([
["Unknown", 0],
["InvalidDateFields", 2049],
["UnsupportedLength", 2051],
["ConflictingField", 2057],
["FormatterTooSpecific", 2058],
["DataMarkerNotFound", 1],
["DataIdentifierNotFound", 2],
["DataInvalidRequest", 3],
["DataInconsistentData", 4],
["DataDowncast", 5],
["DataDeserialize", 6],
["DataCustom", 7],
["DataIo", 8]
]);
static getAllEntries() {
return DateTimeFormatterLoadError.#values.entries();
}
#internalConstructor(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 this;
}
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.");
}
static fromValue(value) {
return new DateTimeFormatterLoadError(value);
}
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),
[2049]: new DateTimeFormatterLoadError(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2049),
[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 InvalidDateFields = DateTimeFormatterLoadError.#objectValues[2049];
static UnsupportedLength = DateTimeFormatterLoadError.#objectValues[2051];
static ConflictingField = DateTimeFormatterLoadError.#objectValues[2057];
static FormatterTooSpecific = 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];
constructor(value) {
return this.#internalConstructor(...arguments)
}
}