//·························································· // Copyright (c) 2023-2026. Jonathan Bédard ~ JóôòKiwi // // This project is free to use. // All the right is reserved to the author of this project. // My projects: // - https://github.com/joooKiwi/type // - https://github.com/joooKiwi/lazy // - https://github.com/joooKiwi/collection // - https://github.com/joooKiwi/enumeration //·························································· import type {PossibleEdgeCaseNumericName} from "@joookiwi/type" import type {EnumConstants} from "../EnumConstants" import type {Enumerable} from "../Enumerable" import type {CompanionOf, PossibleEnumerableMembers} from "../Enumerable.types" import type {EnumerableWithNullableGrandParent} from "../EnumerableWithNullableGrandParent" import type {EnumerableWithNullableGreatGrandParent} from "../EnumerableWithNullableGreatGrandParent" import type {EnumerableWithNullableParent} from "../EnumerableWithNullableParent" import type {EnumerableConstructor} from "../EnumerableConstructor" import type {CompanionEnum} from "./CompanionEnum" import type {CompanionEnumDeclaration} from "./CompanionEnum.declaration" import type {CompanionEnumWithParent} from "./CompanionEnumWithParent" import type {CompanionEnumWithParentDeclaration} from "./CompanionEnumWithParent.declaration" import type {CompanionEnumWithGrandParent} from "./CompanionEnumWithGrandParent" import type {CompanionEnumWithGrandParentDeclaration} from "./CompanionEnumWithGrandParent.declaration" import type {CompanionEnumWithGreatGrandParent} from "./CompanionEnumWithGreatGrandParent" import type {CompanionEnumWithGreatGrandParentDeclaration} from "./CompanionEnumWithGreatGrandParent.declaration" /** * The {@link CompanionEnumDeclaration} name in a {@link Object.toString toString()} method * * @deprecated Replace with the same type in @joookiwi/enumerable/type/symbol" instead. This will be removed in version 3.14. */ export type CompanionEnumName = typeof EnumConstants["COMPANION_ENUM_TO_STRING_TAG"] /** * Every possible string that throws an {@link ForbiddenNameException} * when being retrieving in a {@link CompanionEnumDeclaration} * * @deprecated Replace with the same type in @joookiwi/enumerable/type/name" instead. This will be removed in version 3.14. */ export type ImpossibleNames = | PossibleEdgeCaseNumericName | Exclude /** * The possible {@link CompanionEnumDeclaration} members itself * or by an inheritor (in the project) * * @see EnumConstants.EVERY_COMPANION_ENUM_MEMBERS * @deprecated Replace with {@link KeyOfCompanionEnumWithGreatGrandParent} instead. This will be removed in version 3.14. */ export type PossibleCompanionEnumMembers = | keyof CompanionEnumDeclaration | keyof CompanionEnumWithParentDeclaration | keyof CompanionEnumWithGrandParentDeclaration | keyof CompanionEnumWithGreatGrandParentDeclaration /** @deprecated Replace with the same type in @joookiwi/enumerable/type/companionFrom" instead. This will be removed in version 3.14. */ export type CompanionEnumFromEnumerableConstructorOrCompanionEnum, > = T extends EnumerableConstructor ? CompanionOf : T extends CompanionEnumDeclaration ? T : never /** * The possible {@link Enumerable} instances. Either a {@link EnumerableConstructor} or a {@link CompanionEnumDeclaration} * * @deprecated Replace with the same type in @joookiwi/enumerable/type/possibleInstance" instead. This will be removed in version 3.14. */ export type PossibleEnumerableInstance = | CompanionEnumDeclarationType | CompanionEnumWithParentDeclaration | CompanionEnumWithGrandParentDeclaration | CompanionEnumWithGreatGrandParentDeclaration | EnumerableConstructor> //#region -------------------- Recursive companion enum type -------------------- /** * A type for the {@link CompanionEnum} with its {@link EnumerableConstructor} referencing itself * * @deprecated Replace with the same type in @joookiwi/enumerable/type/companion" instead. This will be removed in version 3.14. */ export type CompanionEnumType = CompanionEnum>> /** * A type for the {@link CompanionEnumDeclaration} with its {@link EnumerableConstructor} referencing itself * * @deprecated Replace with {@link CompanionEnumerableType} instead. This will be removed in version 3.14. */ export type CompanionEnumDeclarationType = CompanionEnumDeclaration>> /** * A type for the {@link CompanionEnumWithParent} with its {@link EnumerableConstructor} referencing itself * * @deprecated Replace with the same type in @joookiwi/enumerable/type/companion" instead. This will be removed in version 3.14. */ export type CompanionEnumWithParentType, PARENT_ENUM extends Enumerable, > = CompanionEnumWithParent>, PARENT_ENUM, EnumerableConstructor>> /** * A type for the {@link CompanionEnumWithParentDeclaration} with its {@link EnumerableConstructor} referencing itself * * @deprecated Replace with {@link CompanionEnumerableWithParentType} instead. This will be removed in version 3.14. */ export type CompanionEnumWithParentDeclarationType, PARENT_ENUM extends Enumerable, > = CompanionEnumWithParentDeclaration>, PARENT_ENUM, EnumerableConstructor>> /** * A type for the {@link CompanionEnumWithGrandParent} with its {@link EnumerableConstructor} referencing itself * * @deprecated Replace with the same type in @joookiwi/enumerable/type/companion" instead. This will be removed in version 3.14. */ export type CompanionEnumWithGrandParentType, PARENT_ENUM extends EnumerableWithNullableParent, GRAND_PARENT_ENUM extends Enumerable, > = CompanionEnumWithGrandParent>, PARENT_ENUM, EnumerableConstructor>, GRAND_PARENT_ENUM, EnumerableConstructor>> /** * A type for the {@link CompanionEnumWithGrandParentDeclaration} with its {@link EnumerableConstructor} referencing itself * * @deprecated Replace with {@link CompanionEnumerableWithGrandParentType} instead. This will be removed in version 3.14. */ export type CompanionEnumWithGrandParentDeclarationType, PARENT_ENUM extends EnumerableWithNullableParent, GRAND_PARENT_ENUM extends Enumerable, > = CompanionEnumWithGrandParentDeclaration>, PARENT_ENUM, EnumerableConstructor>, GRAND_PARENT_ENUM, EnumerableConstructor>> /** * A type for the {@link CompanionEnumWithGreatGrandParent} with its {@link EnumerableConstructor} referencing itself * * @deprecated Replace with the same type in @joookiwi/enumerable/type/companion" instead. This will be removed in version 3.14. */ export type CompanionEnumWithGreatGrandParentType, PARENT_ENUM extends EnumerableWithNullableGrandParent, GRAND_PARENT_ENUM extends EnumerableWithNullableParent, GREAT_GRAND_PARENT_ENUM extends Enumerable, > = CompanionEnumWithGreatGrandParent>, PARENT_ENUM, EnumerableConstructor>, GRAND_PARENT_ENUM, EnumerableConstructor>, GREAT_GRAND_PARENT_ENUM, EnumerableConstructor>> /** * A type for the {@link CompanionEnumWithGreatGrandParentDeclaration} with its {@link EnumerableConstructor} referencing itself * * @deprecated Replace with {@link CompanionEnumerableWithGreatGrandParentType} instead. This will be removed in version 3.14. */ export type CompanionEnumWithGreatGrandParentDeclarationType, PARENT_ENUM extends EnumerableWithNullableGrandParent, GRAND_PARENT_ENUM extends EnumerableWithNullableParent, GREAT_GRAND_PARENT_ENUM extends Enumerable, > = CompanionEnumWithGreatGrandParentDeclaration>, PARENT_ENUM, EnumerableConstructor>, GRAND_PARENT_ENUM, EnumerableConstructor>, GREAT_GRAND_PARENT_ENUM, EnumerableConstructor>> //#endregion -------------------- Recursive companion enum type --------------------