// generated by diplomat-tool
import wasm from "./diplomat-wasm.mjs";
import * as diplomatRuntime from "./diplomat-runtime.mjs";



/**
 * See the [Rust documentation for `BidiPairedBracketType`](https://docs.rs/icu/2.2.0/icu/properties/props/enum.BidiPairedBracketType.html) for more information.
 */
export class BidiPairedBracketType {
    #value = undefined;

    static #values = new Map([
        ["Open", 0],
        ["Close", 1],
        ["None", 2]
    ]);

    static getAllEntries() {
        return BidiPairedBracketType.#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 BidiPairedBracketType.#objectValues[arguments[1]];
        }

        if (value instanceof BidiPairedBracketType) {
            return value;
        }

        let intVal = BidiPairedBracketType.#values.get(value);

        // Nullish check, checks for null or undefined
        if (intVal != null) {
            return BidiPairedBracketType.#objectValues[intVal];
        }

        throw TypeError(value + " is not a BidiPairedBracketType and does not correspond to any of its enumerator values.");
    }

    /** @internal */
    static fromValue(value) {
        return new BidiPairedBracketType(value);
    }

    get value(){
        return [...BidiPairedBracketType.#values.keys()][this.#value];
    }

    /** @internal */
    get ffiValue(){
        return this.#value;
    }
    static #objectValues = [
        new BidiPairedBracketType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 0),
        new BidiPairedBracketType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 1),
        new BidiPairedBracketType(diplomatRuntime.internalConstructor, diplomatRuntime.internalConstructor, 2),
    ];

    /**
     * Represents `Bidi_Paired_Bracket_Type=Open`.
     */
    static Open = BidiPairedBracketType.#objectValues[0];
    /**
     * Represents `Bidi_Paired_Bracket_Type=Close`.
     */
    static Close = BidiPairedBracketType.#objectValues[1];
    /**
     * Represents `Bidi_Paired_Bracket_Type=None`.
     */
    static None = BidiPairedBracketType.#objectValues[2];


    constructor(value) {
        return this.#internalConstructor(...arguments)
    }
}