Registry / type-stubs / phaser3-rex-plugins-types

phaser3-rex-plugins-types

JSON →
library0.2.0jsnpmunverified

TypeScript type definitions for phaser3-rex-plugins, a comprehensive collection of plugins for Phaser 3. Current stable version 0.2.0, released 2023-09-12. Provides type safety and autocompletion for popular plugins like Webfont loader, Container Lite, Input text, and more. Updated infrequently; supports only a subset of all rex plugins (marked as [x] in README). No built-in tests or CI beyond Travis. Differentiator: fills the gap for TypeScript users of the rexrainbow plugin ecosystem, unlike the JS-only original.

npm install phaser3-rex-plugins-types
INSTALL
IMPORT
SIG · PHASER3-REX-PLUGIN
P
phaser3-rex-plugins-types
type-stubsjavascriptv0.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Default export (package.json)
import 'phaser3-rex-plugins-types'
import RexPlugins from 'phaser3-rex-plugins-types'
This package provides global augmentation, not a default export. Just import the module for types.
Include in tsconfig
Add "node_modules/phaser3-rex-plugins-types" to tsconfig.json include array
Not adding to include or using triple-slash directives
Must be explicitly included to ensure types are loaded.
WebfontLoader (example plugin)
// types are available via Phaser.Loader.LoaderPlugin extension. No explicit import needed.
import { WebfontLoader } from 'phaser3-rex-plugins-types'
Types augment Phaser's global namespace; plugin-specific exports are not available.

Initializes a basic Phaser 3 game with TypeScript, demonstrating how to use rex plugins types (WebfontLoader and ContainerLite) without explicit imports.

// 1. Install: npm i --save phaser3-rex-plugins-types // 2. Add to tsconfig.json: /* { "include": ["**/*", "node_modules/phaser3-rex-plugins-types"] } */ // 3. In your game code, types are automatically available: import Phaser from 'phaser'; const config: Phaser.Types.Core.GameConfig = { type: Phaser.AUTO, width: 800, height: 600, scene: { create }, }; function create(this: Phaser.Scene) { // WebfontLoader: rexWebfont is augmented on this.load this.load.rexWebfont({ key: 'font', custom: 'https://fonts.googleapis.com/css?family=Roboto' }); // ContainerLite is available via this.add.rexContainerLite const container = this.add.rexContainerLite(400, 300, 200, 100); } new Phaser.Game(config);
Debug
Known issues
gotchaTypes are only provided for a subset of rex plugins; many popular plugins (e.g., BBCodeText, NinePatch, GridTable) are not yet typed.
fix
Check the README for supported plugins; for unsupported ones, you must write custom declarations or use `any`.
affects: >=0.0.1
gotchaThe types augment Phaser's global namespace using module augmentation. This may conflict with other Phaser type augmentations or cause unexpected behavior if not loaded correctly.
fix
Ensure tsconfig includes this package and that no other package provides conflicting augmentations.
affects: >=0.0.1
breakingVersion 0.1.0 changed the way types are included: previously you could just import the module; now you must add to tsconfig.json's include array.
fix
Add "node_modules/phaser3-rex-plugins-types" to the include array in tsconfig.json. See quickstart.
affects: >=0.1.0
gotchaSome plugin types may be incomplete or incorrect, as the package is in early development (v0.2.0).
fix
Validate types against the original rex plugins documentation. Report issues on GitHub.
affects: >=0.0.1
Errors
Common errors & fixes
Cannot find name 'rexWebfont'. Did you mean 'webfont'?
WebfontLoader is not loaded in the current scene's loader; types only augment after correct loading.
fix
Ensure you have installed and imported phaser3-rex-plugins (the JS package) and added the plugin to the Phaser config. Example:
import RexPlugins from 'phaser3-rex-plugins';
const config = { plugins: { scene: [{ key: 'rexWebfont', plugin: RexPlugins.WeFontLoader, sceneKey: 'rexWebfont' }] } };
Then use this.load.rexWebfont(...).
Property 'rexContainerLite' does not exist on type 'GameObjectFactory'.
ContainerLite types not yet loaded or tsconfig include misconfigured.
fix
Confirm you have added this package to tsconfig include array AND that the plugin is registered in Phaser config via phaser3-rex-plugins. Example:
import RexPlugins from 'phaser3-rex-plugins';
const config = { plugins: { scene: [{ key: 'rexContainerLite', plugin: RexPlugins.ContainerLite, sceneKey: 'rexContainerLite' }] } }.
Module 'phaser3-rex-plugins-types' has no default export.
This package only provides global type augmentation, not a default export.
fix
Do not use `import something from 'phaser3-rex-plugins-types'`. Instead, just `import 'phaser3-rex-plugins-types'` once at the top of your entry file.
Upgrade
Version history
0.2.0latest on npm
Audit
Dependencies
phaserrequiredPeer dependency; types reference Phaser types
Agent activity
24 hits · last 30 days
node
22
OpenAI (training)
1
Resources
phaser3-rex-plugins-types — npm install phaser3-rex-plugins-types · libregistry