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.0.0-rc.1.zip, unzip, and open the root directory.
In the terminal, run
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
TAG_VERSION="v4.0.0-rc.1"
git clone --no-checkout --depth 1 --branch $VERSION https://github.com/phaserjs/phaser.git phaser
cd phaser
git sparse-checkout init --cone
git sparse-checkout set types
git checkout tags/$VERSION