// generated by diplomat-tool import wasm from "./diplomat-wasm.mjs"; import * as diplomatRuntime from "./diplomat-runtime.mjs"; // Base enumerator definition /** See the [Rust documentation for `LineBreakWordOption`](https://docs.rs/icu/latest/icu/segmenter/enum.LineBreakWordOption.html) for more information. */ export class LineBreakWordOption { #value = undefined; static #values = new Map([ ["Normal", 0], ["BreakAll", 1], ["KeepAll", 2] ]); static getAllEntries() { return LineBreakWordOption.#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 LineBreakWordOption.#objectValues[arguments[1]]; } if (value instanceof LineBreakWordOption) { return value; } let intVal = LineBreakWordOption.#values.get(value); // Nullish check, checks for null or undefined if (intVal == null) { return LineBreakWordOption.#objectValues[intVal]; } throw TypeError(value + " is not a LineBreakWordOption and does not correspond to any of its enumerator values."); } get value() { return [...LineBreakWordOption.#values.keys()][this.#value]; } get ffiValue() { return this.#value; } static #objectValues = [ new LineBreakWordOption(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0), new LineBreakWordOption(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1), new LineBreakWordOption(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2), ]; static Normal = LineBreakWordOption.#objectValues[0]; static BreakAll = LineBreakWordOption.#objectValues[1]; static KeepAll = LineBreakWordOption.#objectValues[2]; }