{"id":20260,"library":"phaser3-rex-plugins-types","title":"phaser3-rex-plugins-types","description":"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.","status":"active","version":"0.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/khasanovbi/phaser3-rex-plugins-types","tags":["javascript","phaser3","phaser3-rex-plugins"],"install":[{"cmd":"npm install phaser3-rex-plugins-types","lang":"bash","label":"npm"},{"cmd":"yarn add phaser3-rex-plugins-types","lang":"bash","label":"yarn"},{"cmd":"pnpm add phaser3-rex-plugins-types","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; types reference Phaser types","package":"phaser","optional":false}],"imports":[{"note":"This package provides global augmentation, not a default export. Just import the module for types.","wrong":"import RexPlugins from 'phaser3-rex-plugins-types'","symbol":"Default export (package.json)","correct":"import 'phaser3-rex-plugins-types'"},{"note":"Must be explicitly included to ensure types are loaded.","wrong":"Not adding to include or using triple-slash directives","symbol":"Include in tsconfig","correct":"Add \"node_modules/phaser3-rex-plugins-types\" to tsconfig.json include array"},{"note":"Types augment Phaser's global namespace; plugin-specific exports are not available.","wrong":"import { WebfontLoader } from 'phaser3-rex-plugins-types'","symbol":"WebfontLoader (example plugin)","correct":"// types are available via Phaser.Loader.LoaderPlugin extension. No explicit import needed."}],"quickstart":{"code":"// 1. Install: npm i --save phaser3-rex-plugins-types\n// 2. Add to tsconfig.json:\n/* {\n  \"include\": [\"**/*\", \"node_modules/phaser3-rex-plugins-types\"]\n} */\n// 3. In your game code, types are automatically available:\nimport Phaser from 'phaser';\n\nconst config: Phaser.Types.Core.GameConfig = {\n  type: Phaser.AUTO,\n  width: 800,\n  height: 600,\n  scene: { create },\n};\n\nfunction create(this: Phaser.Scene) {\n  // WebfontLoader: rexWebfont is augmented on this.load\n  this.load.rexWebfont({ key: 'font', custom: 'https://fonts.googleapis.com/css?family=Roboto' });\n  // ContainerLite is available via this.add.rexContainerLite\n  const container = this.add.rexContainerLite(400, 300, 200, 100);\n}\n\nnew Phaser.Game(config);","lang":"typescript","description":"Initializes a basic Phaser 3 game with TypeScript, demonstrating how to use rex plugins types (WebfontLoader and ContainerLite) without explicit imports."},"warnings":[{"fix":"Check the README for supported plugins; for unsupported ones, you must write custom declarations or use `any`.","message":"Types are only provided for a subset of rex plugins; many popular plugins (e.g., BBCodeText, NinePatch, GridTable) are not yet typed.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Ensure tsconfig includes this package and that no other package provides conflicting augmentations.","message":"The 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.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Add \"node_modules/phaser3-rex-plugins-types\" to the include array in tsconfig.json. See quickstart.","message":"Version 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.","severity":"breaking","affected_versions":">=0.1.0"},{"fix":"Validate types against the original rex plugins documentation. Report issues on GitHub.","message":"Some plugin types may be incomplete or incorrect, as the package is in early development (v0.2.0).","severity":"gotcha","affected_versions":">=0.0.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure you have installed and imported phaser3-rex-plugins (the JS package) and added the plugin to the Phaser config. Example:\nimport RexPlugins from 'phaser3-rex-plugins';\nconst config = { plugins: { scene: [{ key: 'rexWebfont', plugin: RexPlugins.WeFontLoader, sceneKey: 'rexWebfont' }] } };\nThen use this.load.rexWebfont(...).","cause":"WebfontLoader is not loaded in the current scene's loader; types only augment after correct loading.","error":"Cannot find name 'rexWebfont'. Did you mean 'webfont'?"},{"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:\nimport RexPlugins from 'phaser3-rex-plugins';\nconst config = { plugins: { scene: [{ key: 'rexContainerLite', plugin: RexPlugins.ContainerLite, sceneKey: 'rexContainerLite' }] } }.","cause":"ContainerLite types not yet loaded or tsconfig include misconfigured.","error":"Property 'rexContainerLite' does not exist on type 'GameObjectFactory'."},{"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.","cause":"This package only provides global type augmentation, not a default export.","error":"Module 'phaser3-rex-plugins-types' has no default export."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}