diff --git a/biome.jsonc b/biome.jsonc index 470885a543d..d2f7c711dc9 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -19,7 +19,6 @@ // and having to verify whether each individual file is ignored "includes": [ "**", - "!**/*.d.ts", "!**/dist/**/*", "!**/build/**/*", "!**/coverage/**/*", @@ -180,7 +179,7 @@ // Overrides to prevent unused import removal inside `overrides.ts` and enums files (for TSDoc linkcodes), // as well as in all TS files in `scripts/` (which are assumed to be boilerplate templates). { - "includes": ["**/src/overrides.ts", "**/src/enums/**/*", "**/scripts/**/*.ts"], + "includes": ["**/src/overrides.ts", "**/src/enums/**/*", "**/scripts/**/*.ts", "**/*.d.ts"], "linter": { "rules": { "correctness": { diff --git a/global.d.ts b/global.d.ts index 27e96a4d8b5..8b79d966e3c 100644 --- a/global.d.ts +++ b/global.d.ts @@ -1,7 +1,6 @@ +import type { AnyFn } from "#types/type-helpers"; import type { SetupServerApi } from "msw/node"; -export {}; - declare global { /** * Only used in testing. @@ -11,4 +10,11 @@ declare global { * To set up your own server in a test see `game-data.test.ts` */ var server: SetupServerApi; + + // Overloads for `Function.apply` and `Function.call` to add type safety on matching argument types + interface Function { + apply(this: T, thisArg: ThisParameterType, argArray: Parameters): ReturnType; + + call(this: T, thisArg: ThisParameterType, ...argArray: Parameters): ReturnType; + } } diff --git a/src/@types/api/pokerogue-account-api.ts b/src/@types/api/pokerogue-account-api.ts index 7bcdc766664..779592483fb 100644 --- a/src/@types/api/pokerogue-account-api.ts +++ b/src/@types/api/pokerogue-account-api.ts @@ -15,3 +15,10 @@ export interface AccountRegisterRequest { username: string; password: string; } + +export interface AccountChangePwRequest { + password: string; +} +export interface AccountChangePwResponse { + success: boolean; +} diff --git a/src/@types/helpers/type-helpers.ts b/src/@types/helpers/type-helpers.ts index 37f97fcf08c..7ad20b88956 100644 --- a/src/@types/helpers/type-helpers.ts +++ b/src/@types/helpers/type-helpers.ts @@ -94,3 +94,12 @@ export type AbstractConstructor = abstract new (...args: any[]) => T; export type CoerceNullPropertiesToUndefined = { [K in keyof T]: null extends T[K] ? Exclude | undefined : T[K]; }; + +/** + * Type helper to mark all properties in `T` as optional, while still mandating that at least 1 + * of its properties be present. + * + * Distinct from {@linkcode Partial} as this requires at least 1 property to _not_ be undefined. + * @typeParam T - The type to render partial + */ +export type AtLeastOne = Partial & ObjectValues<{ [K in keyof T]: Pick, K> }>; diff --git a/src/battle-scene.ts b/src/battle-scene.ts index aaefcd3a6e2..900a3c6797a 100644 --- a/src/battle-scene.ts +++ b/src/battle-scene.ts @@ -663,9 +663,7 @@ export class BattleScene extends SceneBase { this.ui = ui; ui.setup(); - this.phaseManager.pushNew("LoginPhase"); - this.phaseManager.pushNew("TitlePhase"); - + this.phaseManager.toTitleScreen(true); this.phaseManager.shiftPhase(); } @@ -3538,6 +3536,7 @@ export class BattleScene extends SceneBase { this.gameMode.hasMysteryEncounters && battleType === BattleType.WILD && !this.gameMode.isBoss(waveIndex) && + waveIndex % 10 !== 1 && waveIndex < highestMysteryEncounterWave && waveIndex > lowestMysteryEncounterWave ); diff --git a/src/data/abilities/ability.ts b/src/data/abilities/ability.ts index 0ee1a51a78e..2f57df4a551 100644 --- a/src/data/abilities/ability.ts +++ b/src/data/abilities/ability.ts @@ -1768,7 +1768,7 @@ export interface AddSecondStrikeAbAttrParams extends Omit