diff --git a/src/@types/common.ts b/src/@types/common.ts index 4126733397e..c1373d93297 100644 --- a/src/@types/common.ts +++ b/src/@types/common.ts @@ -2,3 +2,5 @@ export type ConditionFn = (args?: any[]) => boolean; /** Alias for the constructor of a class */ export type Constructor = new (...args: unknown[]) => T; + +export type nil = null | undefined; diff --git a/src/data/battle-anims.ts b/src/data/battle-anims.ts index ac93a0cac1c..e1966805b40 100644 --- a/src/data/battle-anims.ts +++ b/src/data/battle-anims.ts @@ -7,8 +7,9 @@ import { AnimBlendType, AnimFocus, AnimFrameTarget, ChargeAnim, CommonAnim } fro import { MoveFlags } from "#enums/move-flags"; import { MoveId } from "#enums/move-id"; import type { Pokemon } from "#field/pokemon"; +import type { nil } from "#types/common"; import { coerceArray } from "#utils/array"; -import { getFrameMs, type nil } from "#utils/common"; +import { getFrameMs } from "#utils/common"; import { getEnumKeys, getEnumValues } from "#utils/enums"; import { toKebabCase } from "#utils/strings"; import Phaser from "phaser"; diff --git a/src/data/pokemon-forms.ts b/src/data/pokemon-forms.ts index 1b392f6fb21..0517459aaa1 100644 --- a/src/data/pokemon-forms.ts +++ b/src/data/pokemon-forms.ts @@ -24,8 +24,7 @@ import { SpeciesFormKey } from "#enums/species-form-key"; import { SpeciesId } from "#enums/species-id"; import { WeatherType } from "#enums/weather-type"; import type { Pokemon } from "#field/pokemon"; -import type { Constructor } from "#types/common"; -import type { nil } from "#utils/common"; +import type { Constructor, nil } from "#types/common"; export type SpeciesFormChangeConditionPredicate = (p: Pokemon) => boolean; export type SpeciesFormChangeConditionEnforceFunc = (p: Pokemon) => void; diff --git a/src/phases/move-effect-phase.ts b/src/phases/move-effect-phase.ts index be6d0164698..2115694d6c7 100644 --- a/src/phases/move-effect-phase.ts +++ b/src/phases/move-effect-phase.ts @@ -37,9 +37,9 @@ import { getMoveTargets, isFieldTargeted } from "#moves/move-utils"; import { PokemonMove } from "#moves/pokemon-move"; import { PokemonPhase } from "#phases/pokemon-phase"; import { DamageAchv } from "#system/achv"; +import type { nil } from "#types/common"; import type { DamageResult } from "#types/damage-result"; import type { TurnMove } from "#types/turn-move"; -import type { nil } from "#utils/common"; import { BooleanHolder, NumberHolder } from "#utils/common"; import i18next from "i18next"; diff --git a/src/timed-event-manager.ts b/src/timed-event-manager.ts index 75f4afa772e..d0ebb5607bb 100644 --- a/src/timed-event-manager.ts +++ b/src/timed-event-manager.ts @@ -7,8 +7,8 @@ import { MysteryEncounterType } from "#enums/mystery-encounter-type"; import { SpeciesId } from "#enums/species-id"; import { TextStyle } from "#enums/text-style"; import { WeatherType } from "#enums/weather-type"; +import type { nil } from "#types/common"; import { addTextObject } from "#ui/text"; -import type { nil } from "#utils/common"; import i18next from "i18next"; export enum EventType { diff --git a/src/utils/common.ts b/src/utils/common.ts index cd6b726938e..ae586b60455 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -3,8 +3,6 @@ import { MoneyFormat } from "#enums/money-format"; import type { Variant } from "#sprites/variant"; import i18next from "i18next"; -export type nil = null | undefined; - export const MissingTextureKey = "__MISSING"; // TODO: Draft tests for these utility functions