pokerogue/src/@types/phase-types.ts
Sirz Benjie 1c4edabd1d
[Refactor] Ensure that new phases are created through the phase manager
https://github.com/pagefaultgames/pokerogue/pull/5955

* Add newPhase method to phase-manager

* Update calls to append/prepend phase to use string phase

* Replace instantiations of new phase with phase manager
2025-06-07 23:55:30 -07:00

26 lines
806 B
TypeScript

import type { PhaseConstructorMap } from "#app/phase-manager";
// Intentionally export the types of everything in phase-manager, as this file is meant to be
// the centralized place for type definitions for the phase system.
export type * from "#app/phase-manager";
// This file includes helpful types for the phase system.
// It intentionally imports the phase constructor map from the phase manager (and re-exports it)
/**
* Map of phase names to constructors for said phase
*/
export type PhaseMap = {
[K in keyof PhaseConstructorMap]: InstanceType<PhaseConstructorMap[K]>;
};
/**
* Union type of all phase constructors.
*/
export type PhaseClass = PhaseConstructorMap[keyof PhaseConstructorMap];
/**
* Union type of all phase names as strings.
*/
export type PhaseString = keyof PhaseMap;