import type { CollectionHolder, CollectionIterator } from "@joookiwi/collection"; import type { BigIntOrObject, Nullable, NullableString, NullOrUndefined, NumberOrObject, NumberTemplate, NumericOrObject, StringOrNumericOrObject, StringOrObject, TemplateOrNumber, TemplateOrNumericOrObject } from "@joookiwi/type"; import type { Enumerable } from "../Enumerable"; import type { EnumerableConstructor } from "../EnumerableConstructor"; import type { CompanionEnumerable } from "./CompanionEnumerable"; import type { ImpossibleNames } from "../type/name"; import type { NameOf, SpecificNameOf } from "../type/nameOf"; import type { OrdinalOf, SpecificOrdinalOf } from "../type/ordinalOf"; import type { NameByOrdinal, OrdinalByName, ValueBySpecificName, ValueBySpecificOrdinal } from "../type/valueBy"; import type { CompanionEnumName } from "../type/toStringTag"; export declare class CompanionEnum>> implements CompanionEnumerable { #private; /** * The excluded names that are an instance of the current instance. * * Note that giving an invalid name will result in an exception on the first time it is initialized. * From either {@link Enumerable.name get name}, * {@link CompanionEnum.getValue getValue()}, {@link CompanionEnum.values get values}, * {@link CompanionEnum.getOrdinal getOrdinal()}, {@link CompanionEnum.ordinals get ordinals} * {@link CompanionEnum.getName getName()} or {@link CompanionEnum.names get names} */ protected readonly _EXCLUDED_NAMES?: Nullable>; /** * The default {@link Enumerable enumerable value} stored for the current instance at the initialization * * @canUseAGetterMethodInstead * @canOnlyCalledOnce */ protected readonly _DEFAULT?: Nullable; /** * The default {@link Enumerable.name name value} stored for the current instance at the initialization * (is ignored if there is a value on the {@link _DEFAULT}) * * @canUseAGetterMethodInstead * @canOnlyCalledOnce */ protected readonly _DEFAULT_NAME?: Nullable; /** * The default {@link Enumerable.ordinal ordinal value} stored for the current instance at the initialization * (is ignored if there is a value on the {@link _DEFAULT_NAME}) * * @canUseAGetterMethodInstead * @canOnlyCalledOnce */ protected readonly _DEFAULT_ORDINAL?: Nullable; protected constructor(instance: ENUM_CONSTRUCTOR); get instance(): ENUM_CONSTRUCTOR; protected get _excludedNames(): CollectionHolder; get defaultValue(): ENUM; set defaultValue(value: Nullable); setDefaultValue(value: NullOrUndefined): this; setDefaultValue(value: ImpossibleNames): never; setDefaultValue(enumerable: Nullable): this; setDefaultValue(ordinal: Nullable): this; setDefaultValue(name: Nullable): this; setDefaultValue(value: Nullable): this; get values(): CollectionHolder; get names(): CollectionHolder>; get ordinals(): CollectionHolder>; get iterator(): CollectionIterator; /** * Validate that the {@link nameOrOrdinal} is not an {@link EnumConstants.EDGE_CASE_NUMERIC_NAMES edge case number} * in the {@link String} format * * @param nameOrOrdinal The {@link Enumerable.name name} or {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link nameOrOrdinal} * @throws ForbiddenNumericException The {@link nameOrOrdinal} was either ±∞ or {@link NaN} */ protected _isNotInEdgeCaseNumericByString(nameOrOrdinal: string, originalValue: StringOrObject): void; /** * Validate that the {@link ordinal} is not an {@link EnumConstants.EDGE_CASE_NUMERIC_NAMES edge case number} * in the {@link Number} format * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ForbiddenNumericException The {@link ordinal} was either ±∞ or {@link NaN} */ protected _isNotInEdgeCaseNumericByNumber(ordinal: number, originalValue: NumberOrObject): void; /** * Validate that the {@link nameOrOrdinal} is not a {@link EnumConstants.ENUMERABLE_WITH_GREAT_GRAND_PARENT_MEMBERS enumerable member} * * @param nameOrOrdinal The {@link Enumerable.name name} or {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link nameOrOrdinal} * @throws ForbiddenInheritedEnumerableMemberException The {@link nameOrOrdinal} was either `name`, `ordinal`, `parent`, `grandParent` or `greatGrandParent` */ protected _isNotInInheritedEnumerableMembers(nameOrOrdinal: string, originalValue: StringOrObject): void; /** * Validate that the {@link nameOrOrdinal} is not one of the {@link _excludedNames excluded names} * * @param nameOrOrdinal The {@link Enumerable.name name} or {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link nameOrOrdinal} * @throws ForbiddenNameException The {@link nameOrOrdinal} was one of the {@link CompanionEnum._EXCLUDED_NAMES excluded names} */ protected _isNotInExcludedNames(nameOrOrdinal: string, originalValue: StringOrObject): void; /** * Validate that the {@link ordinal} is in the {@link ordinals instance ordinals} * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} was not one of the {@link CompanionEnum.ordinals ordinals} */ protected _isInOrdinalsByString(ordinal: NumberTemplate, originalValue: StringOrObject): void; /** * Validate that the {@link ordinal} is in the {@link ordinals instance ordinals} * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @returns number The {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} was not one of the {@link CompanionEnum.ordinals ordinals} */ protected _isInOrdinalsByNumber(ordinal: number, originalValue: NumberOrObject): OrdinalOf; /** * Validate that the {@link ordinal} is in the {@link ordinals instance ordinals} * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @returns number The converted {@link ordinal} as a {@link Number} * @throws ImpossibleOrdinalException The {@link ordinal} was not one of the {@link CompanionEnum.ordinals ordinals} */ protected _isInOrdinalsByBigInt(ordinal: bigint, originalValue: BigIntOrObject): OrdinalOf; /** * Validate that the {@link ordinal} is positive * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} is negative */ protected _isPositiveByString(ordinal: NumberTemplate, originalValue: StringOrObject): void; /** * Validate that the {@link ordinal} is positive * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} is negative */ protected _isPositiveByNumber(ordinal: number, originalValue: NumberOrObject): void; /** * Validate that the {@link ordinal} is positive * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} is negative */ protected _isPositiveByBigInt(ordinal: bigint, originalValue: BigIntOrObject): void; /** * Validate that the {@link ordinal} is not over the {@link EnumConstants.MAX_VALUE_AS_NUMBER maximum value} * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} is over the {@link EnumConstants.MAX_VALUE_AS_NUMBER} */ protected _isNotOverMaxValueByString(ordinal: NumberTemplate, originalValue: StringOrObject): void; /** * Validate that the {@link ordinal} is not over the {@link EnumConstants.MAX_VALUE_AS_NUMBER maximum value} * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} is over the {@link EnumConstants.MAX_VALUE_AS_NUMBER} */ protected _isNotOverMaxValueByNumber(ordinal: number, originalValue: NumberOrObject): void; /** * Validate that the {@link ordinal} is not over the {@link EnumConstants.MAX_VALUE_AS_BIG_INT maximum value} * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} is over the {@link EnumConstants.MAX_VALUE_AS_BIG_INT} */ protected _isNotOverMaxValueByBigInt(ordinal: bigint, originalValue: BigIntOrObject): void; /** * Validate that the {@link ordinal} is not a floating {@link Number} * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} is a floating {@link Number} */ protected _isNotAFloatingNumberByString(ordinal: NumberTemplate, originalValue: StringOrObject): void; /** * Validate that the {@link ordinal} is not a floating {@link Number} * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} is a floating {@link Number} */ protected _isNotAFloatingNumberByNumber(ordinal: number, originalValue: NumberOrObject): void; /** * Get the valid value that is a valid {@link Enumerable} * for the current {@link instance} * * @param enumerable The instance to validate * @throws InvalidEnumerableException The {@link enumerable} was not an `instanceof` {@link CompanionEnum.instance instance} * @throws NullReferenceException No equivalent value (`===`) was in {@link CompanionEnum.values values} */ protected _getValidValueByEnumerable(enumerable: Enumerable): ENUM; /** * Get a valid value that is a valid {@link Enumerable} for the current instance * * @param value The value to validate * @param nameOrOrdinal Either the {@link Enumerable.name name} or the {@link Enumerable.ordinal ordinal} * @param originalValue The original {@link nameOrOrdinal} received * @param instance The instance to tell if it is an instance of it * @throws InvalidInstanceException The value found reflectively was not an `instanceof` the {@link instance} */ protected _getValidValueByString(value: NonNullable, nameOrOrdinal: string, originalValue: StringOrObject, instance: ENUM_CONSTRUCTOR): ENUM; /** * Get an {@link Enumerable} via reflection * * @param nameOrOrdinal The {@link Enumerable.name name} or {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link nameOrOrdinal} * @throws InvalidInstanceException The value found reflectively was not an `instanceof` the {@link CompanionEnum.instance instance} * @throws NullReferenceException The value found reflectively was `null` * @throws NullReferenceException No value exist in the {@link CompanionEnum.instance instance} with the {@link nameOrOrdinal} */ protected _getValueFromReflection(nameOrOrdinal: string, originalValue: StringOrObject): ENUM; /** * Get an {@link Enumerable} from the {@link ordinals instance ordinals} * (utilizing the {@link values instance values}) * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws NullReferenceException The {@link ordinal} did not have any association in {@link CompanionEnum.values values} */ protected _getValueFromOrdinals(ordinal: OrdinalOf, originalValue: NumericOrObject): ENUM; /** * Get an {@link Enumerable} from the {@link values} * * @param value The {@link Enumerable} to find * @throws NullReferenceException No equivalent value (`===`) was in {@link CompanionEnum.values values} */ protected _getValueFromValues(value: Enumerable): ENUM; /** * The main validator method to tell if the {@link nameOrOrdinal} is valid * * @param nameOrOrdinal The {@link Enumerable.name name} or {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link nameOrOrdinal} * @throws ForbiddenInheritedEnumerableMemberException The {@link nameOrOrdinal} was either `name`, `ordinal`, `parent`, `grandParent` or `greatGrandParent` * @throws ForbiddenNameException The {@link nameOrOrdinal} was one of the {@link CompanionEnum._EXCLUDED_NAMES excluded names} * @throws ForbiddenNumericException The {@link nameOrOrdinal} was either ±∞ or {@link NaN} * @throws ImpossibleOrdinalException The {@link nameOrOrdinal} is positive * @throws ImpossibleOrdinalException The {@link nameOrOrdinal} is over {@link EnumConstants.MAX_VALUE_AS_NUMBER} * @throws ImpossibleOrdinalException The {@link nameOrOrdinal} is a floating {@link Number} * @throws ImpossibleOrdinalException The {@link nameOrOrdinal} was not one of the {@link CompanionEnum.ordinals ordinals} */ protected _getValidName(nameOrOrdinal: string, originalValue: StringOrObject): string; /** * The main validator to tell if the {@link ordinal} is valid * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ForbiddenNumericException The {@link ordinal} was either ±∞ or {@link NaN} * @throws ImpossibleOrdinalException The {@link ordinal} is positive * @throws ImpossibleOrdinalException The {@link ordinal} is over {@link EnumConstants.MAX_VALUE_AS_NUMBER} * @throws ImpossibleOrdinalException The {@link ordinal} is a floating {@link Number} * @throws ImpossibleOrdinalException The {@link ordinal} was not one of the {@link CompanionEnum.ordinals ordinals} */ protected _getValidOrdinalByNumber(ordinal: number, originalValue: NumberOrObject): OrdinalOf; /** * The main validator to tell if the {@link ordinal} is valid * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} is positive * @throws ImpossibleOrdinalException The {@link ordinal} is over {@link EnumConstants.MAX_VALUE_AS_BIG_INT} * @throws ImpossibleOrdinalException The {@link ordinal} was not one of the {@link CompanionEnum.ordinals ordinals} */ protected _getValidOrdinalByBigInt(ordinal: bigint, originalValue: BigIntOrObject): OrdinalOf; /** * Get the {@link NonNullable} {@link value} or throw a {@link NullEnumerableException} * from a {@link getValue} method * * @param value The value to validate * @throws NullEnumerableException The {@link value} was `null`|`undefined` */ protected _getNonNullValueFromGetValue(value: Nullable): T; /** * Get the {@link NonNullable} {@link value} or throw a {@link NullEnumerableException} * from a {@link getName} method * * @param value The value to validate * @throws NullEnumerableException The {@link value} was `null`|`undefined` */ protected _getNonNullValueFromGetName(value: Nullable): T; /** * Get the {@link NonNullable} {@link value} or throw a {@link NullEnumerableException} * from a {@link getOrdinal} method * * @param value The value to validate * @throws NullEnumerableException The {@link value} was `null`|`undefined` */ protected _getNonNullValueFromGetOrdinal(value: Nullable): T; getValue(value: Nullable): never; getValue(ordinal: Nullable): ValueBySpecificOrdinal; getValue(ordinal: Nullable>): ValueBySpecificOrdinal; getValue(ordinal: Nullable): ENUM; getValue(name: Nullable): ValueBySpecificName; getValue(nameOrOrdinal: Nullable): ENUM; getValue(instance: Nullable): INSTANCE; getValue(value: Nullable | NAME | String | Number | BigIntOrObject | INSTANCE>): ValueBySpecificOrdinal | ValueBySpecificName | INSTANCE | ENUM; /** * Get an {@link Enumerable} by any possible values * ({@link String}, {@link Number}, {@link BigInt} or an {@link Enumerable}) * * @param value The value to compare and to retrieve the {@link Enumerable instance} * @note This method is only here in order to provide a way to distinguish the type of the value. * It should not be overridden in normal circumstances. * @throws ForbiddenInheritedEnumerableMemberException The {@link value} was either `name`, `ordinal`, `parent`, `grandParent` or `greatGrandParent` * @throws ForbiddenNameException The {@link value} was one of the {@link CompanionEnum._EXCLUDED_NAMES excluded names} * @throws ForbiddenNumericException The {@link value} was either ±∞ or {@link NaN} * @throws ImpossibleOrdinalException The {@link value} is positive * @throws ImpossibleOrdinalException The {@link value} is over the MAX_VALUE ({@link EnumConstants.MAX_VALUE_AS_NUMBER number} or {@link EnumConstants.MAX_VALUE_AS_BIG_INT bigint}) * @throws ImpossibleOrdinalException The {@link value} is a floating {@link Number} * @throws ImpossibleOrdinalException The {@link value} was not one of the {@link CompanionEnum.ordinals ordinals} * @throws InvalidEnumerableException The {@link value} was not an `instanceof` {@link CompanionEnum.instance instance} * @throws InvalidInstanceException The {@link value} found reflectively was not an `instanceof` {@link CompanionEnum.instance instance} * @throws NullEnumerableException The {@link value} was `null`|`undefined` * @throws NullReferenceException The value found reflectively was `null` * @throws NullReferenceException The {@link value} did not have any association in {@link CompanionEnum.values values} * @throws NullReferenceException No value exist in the {@link CompanionEnum.instance instance} with the {@link value} * @throws NullReferenceException No equivalent value (`===`) was in {@link CompanionEnum.values values} * @throws UnhandledValueException The {@link value} was an improper type * @readonly */ protected _getValue(value: Nullable): ENUM; /** * Get a valid {@link Enumerable} by an {@link Enumerable} * * @param enumerable The enumerable to validate * @throws InvalidEnumerableException The {@link enumerable} was not an `instanceof` {@link CompanionEnum.instance instance} * @throws NullReferenceException No equivalent value (`===`) was in {@link CompanionEnum.values values} */ protected _getValueByEnumerable(enumerable: Enumerable): ENUM; /** * Get a valid {@link Enumerable} by a {@link String} * * @param name The name to validate * @param originalValue The original {@link name} * @throws ForbiddenInheritedEnumerableMemberException The {@link name} was either `name`, `ordinal`, `parent`, `grandParent` or `greatGrandParent` * @throws ForbiddenNameException The {@link name} was one of the {@link CompanionEnum._EXCLUDED_NAMES excluded names} * @throws ForbiddenNumericException The {@link name} was either ±∞ or {@link NaN} * @throws ImpossibleOrdinalException The {@link name} is positive * @throws ImpossibleOrdinalException The {@link name} is over the {@link EnumConstants.MAX_VALUE_AS_NUMBER} * @throws ImpossibleOrdinalException The {@link name} is a floating {@link Number} * @throws ImpossibleOrdinalException The {@link name} was not one of the {@link CompanionEnum.ordinals ordinals} * @throws InvalidInstanceException The {@link value} found reflectively was not an `instanceof` {@link CompanionEnum.instance instance} * @throws NullReferenceException The value found reflectively was `null` * @throws NullReferenceException No value exist in the {@link CompanionEnum.instance instance} with the {@link name} */ protected _getValueByString(name: string, originalValue: StringOrObject): ENUM; /** * Get a valid {@link Enumerable} by a {@link Number} * * @param ordinal The ordinal to validate * @param originalValue The original {@link ordinal} * @throws ForbiddenNumericException The {@link ordinal} was either ±∞ or {@link NaN} * @throws ImpossibleOrdinalException The {@link ordinal} is positive * @throws ImpossibleOrdinalException The {@link ordinal} is over the {@link EnumConstants.MAX_VALUE_AS_NUMBER} * @throws ImpossibleOrdinalException The {@link ordinal} is a floating {@link Number} * @throws ImpossibleOrdinalException The {@link ordinal} was not one of the {@link CompanionEnum.ordinals ordinals} * @throws NullReferenceException The {@link ordinal} did not have any association in {@link CompanionEnum.values values} */ protected _getValueByNumber(ordinal: number, originalValue: NumberOrObject): ENUM; /** * Get a valid {@link Enumerable} from a {@link BigInt} * * @param ordinal The ordinal * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} is positive * @throws ImpossibleOrdinalException The {@link ordinal} is over the {@link EnumConstants.MAX_VALUE_AS_BIG_INT} * @throws ImpossibleOrdinalException The {@link ordinal} was not one of the {@link CompanionEnum.ordinals ordinals} * @throws NullReferenceException The {@link ordinal} did not have any association in {@link CompanionEnum.values values} */ protected _getValueByBigInt(ordinal: bigint, originalValue: BigIntOrObject): ENUM; getName(value: Nullable): never; getName(ordinal: Nullable): NameByOrdinal; getName(ordinal: Nullable>): NameByOrdinal; getName(ordinal: Nullable): NameOf; getName(name: Nullable): SpecificNameOf; getName(nameOrOrdinal: Nullable): NameOf; getName(instance: Nullable): NameOf; getName(value: Nullable | NAME | String | Number | BigIntOrObject | INSTANCE>): NameByOrdinal | SpecificNameOf | NameOf | NameOf; /** * Get an {@link Enumerable} {@link Enumerable.name name} by any possible values * ({@link String}, {@link Number}, {@link BigInt} or an {@link Enumerable}) * * @param value The value to compare and to retrieve the {@link Enumerable instance} {@link Enumerable.name name} * @note This method is only here in order to provide a way to distinguish the type of the value. * It should not be overridden in normal circumstances. * @throws ForbiddenInheritedEnumerableMemberException The {@link value} was either `name`, `ordinal`, `parent`, `grandParent` or `greatGrandParent` * @throws ForbiddenNameException The {@link value} was one of the {@link CompanionEnum._EXCLUDED_NAMES excluded names} * @throws ForbiddenNumericException The {@link value} was either ±∞ or {@link NaN} * @throws ImpossibleOrdinalException The {@link value} is positive * @throws ImpossibleOrdinalException The {@link value} is over the MAX_VALUE ({@link EnumConstants.MAX_VALUE_AS_NUMBER number} or {@link EnumConstants.MAX_VALUE_AS_BIG_INT bigint}) * @throws ImpossibleOrdinalException The {@link value} is a floating {@link Number} * @throws ImpossibleOrdinalException The {@link value} was not one of the {@link CompanionEnum.ordinals ordinals} * @throws InvalidEnumerableException The {@link value} was not an `instanceof` {@link CompanionEnum.instance instance} * @throws InvalidInstanceException The {@link value} found reflectively was not an `instanceof` {@link CompanionEnum.instance instance} * @throws NullEnumerableException The {@link value} was `null`|`undefined` * @throws NullReferenceException The value found reflectively was `null` * @throws NullReferenceException The {@link value} did not have any association in {@link CompanionEnum.values values} * @throws NullReferenceException No value exist in the {@link CompanionEnum.instance instance} with the {@link value} * @throws NullReferenceException No equivalent value (`===`) was in {@link CompanionEnum.values values} * @throws UnhandledValueException The {@link value} was an improper type * @readonly */ protected _getName(value: Nullable): NameOf; /** * Get a valid {@link Enumerable.name} by an {@link Enumerable} * * @param enumerable The {@link Enumerable} to validate * @throws InvalidEnumerableException The {@link enumerable} was not an `instanceof` {@link CompanionEnum.instance instance} * @throws NullReferenceException No equivalent value (`===`) was in {@link CompanionEnum.values values} */ protected _getNameByEnumerable(enumerable: Enumerable): NameOf; /** * Get a valid {@link Enumerable.name} by a {@link String} * * @param nameOrOrdinal The {@link Enumerable.name name} or {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link nameOrOrdinal} * @throws ForbiddenInheritedEnumerableMemberException The {@link nameOrOrdinal} was either `name`, `ordinal`, `parent`, `grandParent` or `greatGrandParent` * @throws ForbiddenNameException The {@link nameOrOrdinal} was one of the {@link CompanionEnum._EXCLUDED_NAMES excluded names} * @throws ForbiddenNumericException The {@link nameOrOrdinal} was either ±∞ or {@link NaN} * @throws ImpossibleOrdinalException The {@link nameOrOrdinal} is positive * @throws ImpossibleOrdinalException The {@link nameOrOrdinal} is over the {@link EnumConstants.MAX_VALUE_AS_NUMBER} * @throws ImpossibleOrdinalException The {@link nameOrOrdinal} is a floating {@link Number} * @throws ImpossibleOrdinalException The {@link nameOrOrdinal} was not one of the {@link CompanionEnum.ordinals ordinals} * @throws InvalidInstanceException The {@link nameOrOrdinal} found reflectively was not an `instanceof` {@link CompanionEnum.instance instance} * @throws NullReferenceException No value exist in the {@link CompanionEnum.instance instance} with the {@link nameOrOrdinal} */ protected _getNameByString(nameOrOrdinal: string, originalValue: StringOrObject): NameOf; /** * Get a valid {@link Enumerable.name} by a {@link Number} * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ForbiddenNumericException The {@link ordinal} was either ±∞ or {@link NaN} * @throws ImpossibleOrdinalException The {@link ordinal} is positive * @throws ImpossibleOrdinalException The {@link ordinal} is over the {@link EnumConstants.MAX_VALUE_AS_NUMBER} * @throws ImpossibleOrdinalException The {@link ordinal} is a floating {@link Number} * @throws ImpossibleOrdinalException The {@link ordinal} was not one of the {@link CompanionEnum.ordinals ordinals} * @throws NullReferenceException The {@link ordinal} did not have any association in {@link CompanionEnum.values values} */ protected _getNameByNumber(ordinal: number, originalValue: NumberOrObject): NameOf; /** * Get a valid {@link Enumerable.name} by a {@link BigInt} * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} is positive * @throws ImpossibleOrdinalException The {@link ordinal} is over the {@link EnumConstants.MAX_VALUE_AS_BIG_INT} * @throws ImpossibleOrdinalException The {@link ordinal} was not one of the {@link CompanionEnum.ordinals ordinals} * @throws NullReferenceException The {@link ordinal} did not have any association in {@link CompanionEnum.values values} */ protected _getNameByBigInt(ordinal: bigint, originalValue: BigIntOrObject): NameOf; getOrdinal(value: Nullable): never; getOrdinal(ordinal: Nullable): SpecificOrdinalOf; getOrdinal(ordinal: Nullable>): SpecificOrdinalOf; getOrdinal(ordinal: Nullable): OrdinalOf; getOrdinal(name: Nullable): OrdinalByName; getOrdinal(nameOrOrdinal: Nullable): OrdinalOf; getOrdinal(instance: Nullable): OrdinalOf; getOrdinal(value: Nullable | NAME | String | Number | BigIntOrObject | INSTANCE>): SpecificOrdinalOf | OrdinalByName | OrdinalOf | OrdinalOf; /** * Get an {@link Enumerable} {@link Enumerable.ordinal ordinal} by any possible values * ({@link String}, {@link Number}, {@link BigInt} or an {@link Enumerable}). * * @param value The value to compare and to retrieve the {@link Enumerable instance} {@link Enumerable.ordinal ordinal} * @note This method is only here in order to provide a way to distinguish the type of the value. * It should not be overridden in normal circumstances. * @throws ForbiddenInheritedEnumerableMemberException The {@link value} was either `name`, `ordinal`, `parent`, `grandParent` or `greatGrandParent` * @throws ForbiddenNameException The {@link value} was one of the {@link CompanionEnum._EXCLUDED_NAMES excluded names} * @throws ForbiddenNumericException The {@link value} was either ±∞ or {@link NaN} * @throws ImpossibleOrdinalException The {@link value} is positive * @throws ImpossibleOrdinalException The {@link value} is over the MAX_VALUE ({@link EnumConstants.MAX_VALUE_AS_NUMBER number} or {@link EnumConstants.MAX_VALUE_AS_BIG_INT bigint}) * @throws ImpossibleOrdinalException The {@link value} is a floating {@link Number} * @throws ImpossibleOrdinalException The {@link value} was not one of the {@link CompanionEnum.ordinals ordinals} * @throws InvalidEnumerableException The {@link value} was not an `instanceof` {@link CompanionEnum.instance instance} * @throws InvalidInstanceException The {@link value} found reflectively was not an `instanceof` {@link CompanionEnum.instance instance} * @throws NullEnumerableException The {@link value} was `null`|`undefined` * @throws NullReferenceException The value found reflectively was `null` * @throws NullReferenceException No value exist in the {@link CompanionEnum.instance instance} with the {@link value} * @throws NullReferenceException No equivalent value (`===`) was in {@link CompanionEnum.values values} * @throws UnhandledValueException The {@link value} was an improper type */ protected _getOrdinal(value: Nullable): OrdinalOf; /** * Get a valid {@link Enumerable.ordinal} by an {@link Enumerable} * * @param enumerable The enumerable to validate * @throws InvalidEnumerableException The {@link enumerable} was not an `instanceof` {@link CompanionEnum.instance instance} * @throws NullReferenceException No equivalent value (`===`) was in {@link CompanionEnum.values values} */ protected _getOrdinalByEnumerable(enumerable: Enumerable): OrdinalOf; /** * Get a valid {@link Enumerable.ordinal} by a {@link String} * * @param nameOrOrdinal The {@link Enumerable.name name} or {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link nameOrOrdinal} * @throws ForbiddenInheritedEnumerableMemberException The {@link nameOrOrdinal} was either `name`, `ordinal`, `parent`, `grandParent` or `greatGrandParent` * @throws ForbiddenNameException The {@link nameOrOrdinal} was one of the {@link CompanionEnum._EXCLUDED_NAMES excluded names} * @throws ForbiddenNumericException The {@link nameOrOrdinal} was either ±∞ or {@link NaN} * @throws ImpossibleOrdinalException The {@link nameOrOrdinal} is positive * @throws ImpossibleOrdinalException The {@link nameOrOrdinal} is over the {@link EnumConstants.MAX_VALUE_AS_NUMBER} * @throws ImpossibleOrdinalException The {@link nameOrOrdinal} is a floating {@link Number} * @throws ImpossibleOrdinalException The {@link nameOrOrdinal} was not one of the {@link CompanionEnum.ordinals ordinals} * @throws InvalidInstanceException The {@link nameOrOrdinal} found reflectively was not an `instanceof` {@link CompanionEnum.instance instance} * @throws NullReferenceException The value found reflectively was `null` * @throws NullReferenceException No value exist in the {@link CompanionEnum.instance instance} with the {@link nameOrOrdinal} */ protected _getOrdinalByString(nameOrOrdinal: string, originalValue: StringOrObject): OrdinalOf; /** * Get a valid {@link Enumerable.ordinal} by a {@link Number} * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ForbiddenNumericException The {@link ordinal} was either ±∞ or {@link NaN} * @throws ImpossibleOrdinalException The {@link ordinal} is positive * @throws ImpossibleOrdinalException The {@link ordinal} is over the {@link EnumConstants.MAX_VALUE_AS_NUMBER} * @throws ImpossibleOrdinalException The {@link ordinal} is a floating {@link Number} * @throws ImpossibleOrdinalException The {@link ordinal} was not one of the {@link CompanionEnum.ordinals ordinals} */ protected _getOrdinalByNumber(ordinal: number, originalValue: NumberOrObject): OrdinalOf; /** * Get a valid {@link Enumerable.ordinal} by a {@link BigInt} * * @param ordinal The {@link Enumerable.ordinal ordinal} to validate * @param originalValue The original {@link ordinal} * @throws ImpossibleOrdinalException The {@link ordinal} is positive * @throws ImpossibleOrdinalException The {@link ordinal} is over the {@link EnumConstants.MAX_VALUE_AS_BIG_INT} * @throws ImpossibleOrdinalException The {@link ordinal} was not one of the {@link CompanionEnum.ordinals ordinals} */ protected _getOrdinalByBigInt(ordinal: bigint, originalValue: BigIntOrObject): OrdinalOf; [Symbol.iterator](): CollectionIterator; get [Symbol.toStringTag](): CompanionEnumName; } //# sourceMappingURL=CompanionEnum.d.ts.map