// generated by diplomat-tool import wasm from "./diplomat-wasm.mjs"; import * as diplomatRuntime from "./diplomat-runtime.mjs"; /** * See the [Rust documentation for `LineBreakWordOption`](https://docs.rs/icu/2.1.1/icu/segmenter/options/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(); } #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 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."); } /** @internal */ static fromValue(value) { return new LineBreakWordOption(value); } get value(){ return [...LineBreakWordOption.#values.keys()][this.#value]; } /** @internal */ 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]; constructor(value) { return this.#internalConstructor(...arguments) } }