If you don’t have a copy, download the source code of the Phaser release you want, e.g., https://github.com/phaserjs/phaser/archive/refs/tags/v4.2.1.zip and unzip.
In the terminal, run
cd path/to/phaser # the folder you just unzipped
npx typedoc ./types/*.d.ts --out docs --includeVersion --skipErrorChecking
open docs/index.html
There will be some warnings but it should finish.
Now you can browse the API docs offline. ![]()
Alternative: download with git
This is a lot faster because it only downloads the type declarations.
TAG_VERSION="v4.2.1"
git clone --no-checkout --depth 1 --branch $TAG_VERSION https://github.com/phaserjs/phaser.git phaser
cd phaser
git sparse-checkout init --cone
git sparse-checkout set types
git checkout tags/$TAG_VERSION
Then continue with npx typedoc as above.