# default | pokemon-rogue-battle
Documentation for pokemon-rogue-battle

# Class default

- Defined in src/test/utils/phaseInterceptor.ts:42

#####
Index

### Constructors

constructor

### Properties

PHASES
endBySetMode
inProgress
interval
intervalRun
log
onHold
originalSetMode
originalSuperEnd
phaseFrom
phases
promptInterval
prompts
scene

### Methods

addToNextPrompt
initPhases
pop
rejectAll
restoreOg
run
runFrom
setMode
startPhase
startPromptHandler
superEndPhase
to
unlock
whenAboutToRun

## Constructors

### constructor

- new default(scene): default

- Constructor to initialize the scene and properties, and to start the phase handling.

  #### Parameters

  - scene: any

    The scene to be managed.

  #### Returns default

  - Defined in src/test/utils/phaseInterceptor.ts:105

## Properties

### `Private` PHASES

PHASES: ((typeof LoginPhase | ((phase) => void))[] | (typeof SelectGenderPhase | ((phase) => void))[] | (typeof EncounterPhase | ((phase) => void))[] | (typeof PostSummonPhase | ((phase) => void))[] | (typeof SummonPhase | ((phase) => void))[] | (typeof ToggleDoublePositionPhase | ((phase) => void))[] | (typeof CheckSwitchPhase | ((phase) => void))[] | (typeof ShowAbilityPhase | ((phase) => void))[] | (typeof MessagePhase | ((phase) => void))[] | (typeof CommandPhase | ((phase) => void))[] | (typeof EnemyCommandPhase | ((phase) => void))[] | (typeof MovePhase | ((phase) => void))[] | (typeof MoveEffectPhase | ((phase) => void))[] | (typeof DamagePhase | ((phase) => void))[] | (typeof FaintPhase | ((phase) => void))[] | (typeof SelectModifierPhase | ((phase) => void))[] | (typeof StatChangePhase | ((phase) => void))[] | (typeof QuietFormChangePhase | ((phase) => void))[] | (typeof SwitchPhase | ((phase) => void))[] | (typeof SwitchSummonPhase | ((phase) => void))[])[] = ...

List of phases with their corresponding start methods.

- Defined in src/test/utils/phaseInterceptor.ts:59

### `Private` endBySetMode

endBySetMode: (typeof SelectGenderPhase | typeof CommandPhase )[] = ...

- Defined in src/test/utils/phaseInterceptor.ts:97

### `Private` inProgress

inProgress: any

- Defined in src/test/utils/phaseInterceptor.ts:52

### `Private` interval

interval: any

- Defined in src/test/utils/phaseInterceptor.ts:47

### `Private` intervalRun

intervalRun: any

- Defined in src/test/utils/phaseInterceptor.ts:49

### log

log: any

- Defined in src/test/utils/phaseInterceptor.ts:45

### `Private` onHold

onHold: any

- Defined in src/test/utils/phaseInterceptor.ts:46

### `Private` originalSetMode

originalSetMode: any

- Defined in src/test/utils/phaseInterceptor.ts:53

### `Private` originalSuperEnd

originalSuperEnd: any

- Defined in src/test/utils/phaseInterceptor.ts:54

### `Private` phaseFrom

phaseFrom: any

- Defined in src/test/utils/phaseInterceptor.ts:51

### phases

phases: {} = {}

#### Type declaration

- Defined in src/test/utils/phaseInterceptor.ts:44

### `Private` promptInterval

promptInterval: any

- Defined in src/test/utils/phaseInterceptor.ts:48

### `Private` prompts

prompts: any

- Defined in src/test/utils/phaseInterceptor.ts:50

### scene

scene: any

- Defined in src/test/utils/phaseInterceptor.ts:43

## Methods

### addToNextPrompt

- addToNextPrompt(phaseTarget, mode, callback, expireFn, awaitingActionInput?): void

- Method to add an action to the next prompt.

  #### Parameters

  - phaseTarget: string

    The target phase for the prompt.

  - mode: Mode

    The mode of the UI.

  - callback: (() => void)

    The callback function to execute.

    - - (): void

      - #### Returns void

  - expireFn: (() => void)

    The function to determine if the prompt has expired.

    - - (): void

      - #### Returns void

  - awaitingActionInput: boolean = false

  #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:324

### initPhases

- initPhases(): void

- Method to initialize phases and their corresponding methods.

  #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:232

### pop

- pop(): void

- #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:224

### rejectAll

- rejectAll(error): void

- #### Parameters

  - error: any

  #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:114

### restoreOg

- restoreOg(): void

- Restores the original state of phases and clears intervals.

  This function iterates through all phases and resets their `start` method to the original function stored in `this.phases`. Additionally, it clears the `promptInterval` and `interval`.

  #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:340

### run

- run(phaseTarget, skipFn?): Promise<void>

- Method to run a phase with an optional skip function.

  #### Parameters

  - phaseTarget: any

    The phase to run.

  - `Optional` skipFn: any

    Optional skip function.

  #### Returns Promise<void>

  A promise that resolves when the phase is run.

  - Defined in src/test/utils/phaseInterceptor.ts:175

### runFrom

- runFrom(phaseFrom): default

- Method to set the starting phase.

  #### Parameters

  - phaseFrom: any

    The phase to start from.

  #### Returns default

  The instance of the PhaseInterceptor.

  - Defined in src/test/utils/phaseInterceptor.ts:128

### setMode

- setMode(mode, ...args): Promise<void>

- m2m to set mode.

  #### Parameters

  - mode: Mode
  - `Rest` ...args: any[]

  #### Returns Promise<void>

  - Defined in src/test/utils/phaseInterceptor.ts:282

### startPhase

- startPhase(phase): void

- Method to start a phase and log it.

  #### Parameters

  - phase: any

    The phase to start.

  #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:251

### startPromptHandler

- startPromptHandler(): void

- Method to start the prompt handler.

  #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:300

### superEndPhase

- superEndPhase(): void

- Method to end a phase and log it.

  #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:271

### to

- to(phaseTo, runTarget?): Promise<void>

- Method to transition to a target phase.

  #### Parameters

  - phaseTo: any

    The phase to transition to.

  - runTarget: boolean = true

  #### Returns Promise<void>

  A promise that resolves when the transition is complete.

  - Defined in src/test/utils/phaseInterceptor.ts:138

### unlock

- unlock(): void

- #### Returns void

  - Defined in src/test/utils/phaseInterceptor.ts:262

### whenAboutToRun

- whenAboutToRun(phaseTarget, skipFn?): Promise<void>

- #### Parameters

  - phaseTarget: any
  - `Optional` skipFn: any

  #### Returns Promise<void>

  - Defined in src/test/utils/phaseInterceptor.ts:209