{"_id":"@agogpixel/phaser3-ts-utils","_rev":"39-e7451f27da29b94af31d9c7885daa660","name":"@agogpixel/phaser3-ts-utils","dist-tags":{"next":"0.3.0--dev-build-1641887104","latest":"0.2.0","v0.1.0~next":"0.1.0-alpha.4","v0~next":"0.1.0-alpha.4","v0.1~next":"0.1.0-alpha.4","v0~latest":"0.2.0","v0.1~latest":"0.1.0","v0.2~latest":"0.2.0"},"versions":{"0.0.0-dev.1635470216":{"name":"@agogpixel/phaser3-ts-utils","version":"0.0.0-dev.1635470216","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://github.com/agogpixel/phaser3-ts-utils#readme","peerDependencies":{"phaser":">=3.8.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-dev.tgz","_id":"@agogpixel/phaser3-ts-utils@0.0.0-dev.1635470216","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-xO0pDfMTLkHCqzDqf36u8XY9AkNoVK+ELWWUtfsN36/l/7iyr5yVJMz93jgGPEGyZkgjKAEyb1dgoMbLcVgSJw==","shasum":"b6972d73a0ae8b6051c672a2386b1f853472ee6b","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.0.0-dev.1635470216.tgz","fileCount":113,"unpackedSize":586743,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHossFwpjmbjW1O/qdT2pWQxBY+rSIRquNb9nc2clb4xAiEA7sFVwL58Ndddcave6VCPf2IkVIidrbd0E9q/nONdkKI="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.0.0-dev.1635470216_1635470267459_0.4319011735318077"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.0-dev.1635470967":{"name":"@agogpixel/phaser3-ts-utils","version":"0.0.0-dev.1635470967","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://github.com/agogpixel/phaser3-ts-utils#readme","peerDependencies":{"phaser":">=3.8.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-dev.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n      ...\n      \"compilerOptions\": {\n        ...\n        \"types\": [..., \"@agogpixel/phaser3-ts-utils\"],\n        ...\n      }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nclass MyBaseScene extends Phaser.Scene {}\n\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.0.0-dev.1635470967","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-0fLh/E6YXP4j/jUWd3Yv7VNLHL7nRu2sW/LUueDzlmvSrZrhJrbGvMA2WdxqDLBJcCMH7CEV7E1PhoEcq5Vw6A==","shasum":"c1695b7e652f6f561cc86ad90d426eeebed3be57","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.0.0-dev.1635470967.tgz","fileCount":113,"unpackedSize":586743,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFK5ur22RJvSZeMrjmHtMMbTXgdQURA8Xhbrv61AjOGLAiAVkrRay14ebLPjmn6Vx6dHPuZnCOolT9kR7giGJjykzA=="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.0.0-dev.1635470967_1635471011372_0.032366587824102844"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.0-dev.1635472119":{"name":"@agogpixel/phaser3-ts-utils","version":"0.0.0-dev.1635472119","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://github.com/agogpixel/phaser3-ts-utils#readme","peerDependencies":{"phaser":">=3.8.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-dev.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n      ...\n      \"compilerOptions\": {\n        ...\n        \"types\": [..., \"@agogpixel/phaser3-ts-utils\"],\n        ...\n      }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nclass MyBaseScene extends Phaser.Scene {}\n\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.0.0-dev.1635472119","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-7wgsHaUT0U4Lw73fvOwKhY79+NLgrhiQgnttCcJsoAHZEpYhmGVLU3RaMDYPuykegQZBGe9YfLCSi24/Zr/jEA==","shasum":"e7d7ada3e5c9c6d68951a5c9d3024cad2faba464","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.0.0-dev.1635472119.tgz","fileCount":113,"unpackedSize":586743,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCPuiCa6AAHyDA5/GN9+xacFD6iNb099+FKQRnIxpkxMAIgYsYHMTtciuGDj1BUfQ+Q6Uf9EQYpXI9gFFGK57OxS7A="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.0.0-dev.1635472119_1635472163089_0.571939435206811"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.0-dev.1635473332":{"name":"@agogpixel/phaser3-ts-utils","version":"0.0.0-dev.1635473332","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://github.com/agogpixel/phaser3-ts-utils#readme","peerDependencies":{"phaser":">=3.8.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-dev.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nclass MyBaseScene extends Phaser.Scene {}\n\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.0.0-dev.1635473332","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-iWoqZ/lE7TKMujhhADheM5WQD6fr5KSYykacavFGa1GelgZ58jxMUd/R6SPRjeg7cMw5qFA94JlibAVXoLV8TA==","shasum":"be9d197c953d73d8514e4f64f37b3ef99e7a804b","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.0.0-dev.1635473332.tgz","fileCount":113,"unpackedSize":586181,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAiAho6w0kyHMdcXURB8rPb2OmmaQn9uXYqBnzC/rUpAIgOuaH4Yw0SKjGMfBHl4mxT5+qTwPpffZA2VoH/jYNO88="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.0.0-dev.1635473332_1635473371140_0.7840129720999363"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.0-dev.1635474186":{"name":"@agogpixel/phaser3-ts-utils","version":"0.0.0-dev.1635474186","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://github.com/agogpixel/phaser3-ts-utils#readme","peerDependencies":{"phaser":">=3.8.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-dev.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nclass MyBaseScene extends Phaser.Scene {}\n\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.0.0-dev.1635474186","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-brpOYPmJZuUDMHIb9B+3vqvVMIfWm9iYxNPfIuBAJaVGoBYcJcdlw/glXwSRzw9E+xwIx8pc/Ob3eecExU/0wA==","shasum":"fa97bb91b2c62dc8aac3aa77bee50249d0458f9d","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.0.0-dev.1635474186.tgz","fileCount":113,"unpackedSize":586181,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF0FxziCLNCrAOOygk2p2oRnQ+MCJyJHqHYrMjQrPtHPAiEAyXFoBUmJvLCKHM7WHaJLN1M6VGdRaPtQ0g9+s5uF7wU="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.0.0-dev.1635474186_1635474229255_0.9232183795097548"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.0-dev.1635478436":{"name":"@agogpixel/phaser3-ts-utils","version":"0.0.0-dev.1635478436","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://github.com/agogpixel/phaser3-ts-utils#readme","peerDependencies":{"phaser":">=3.8.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-dev.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nclass MyBaseScene extends Phaser.Scene {}\n\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.0.0-dev.1635478436","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-6ffia2D88NYxoAE6qKHD70EjN7eWCeVE1+o+FST15VJItsuzxb6TLF8lMQhym+csRtGNLFcSXYzxAbkzCGUsoQ==","shasum":"1c89fe103ddda76420658c4f49f4f70b6905527c","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.0.0-dev.1635478436.tgz","fileCount":113,"unpackedSize":586181,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuD57cjozkGvbVR67TokgwEfo/mOulBB+SxcKjjLXQgQIgG2eh5wnm5xjNaxt05Jsl3Xmvnuza555R7lMyOaOTGMY="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.0.0-dev.1635478436_1635478476081_0.5928940262426958"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.0-dev.1635478860":{"name":"@agogpixel/phaser3-ts-utils","version":"0.0.0-dev.1635478860","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://github.com/agogpixel/phaser3-ts-utils#readme","peerDependencies":{"phaser":">=3.8.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-dev.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nclass MyBaseScene extends Phaser.Scene {}\n\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.0.0-dev.1635478860","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-NyjQPYjTvwzb7evwvAL7HJ67DL352anBQsO3I+fl/aYPFyajZ3UBGpwthKHLmGRXqF/h9Sm8BkCKQa/W8bJZ7g==","shasum":"1ca66eaadd21e5b56533c6857084fa1d5852d894","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.0.0-dev.1635478860.tgz","fileCount":113,"unpackedSize":586181,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFrc8nsqiymRJq2PY8N2u31AxZ6JH87GBMqTQc+pXJN0AiEA3GbMurfv+e3/llGRHA/ZFzRlP4/ehF790NqO1d2joO4="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.0.0-dev.1635478860_1635478908543_0.2783809556882344"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.0-dev.1635530738":{"name":"@agogpixel/phaser3-ts-utils","version":"0.0.0-dev.1635530738","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://github.com/agogpixel/phaser3-ts-utils#readme","peerDependencies":{"phaser":">=3.8.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-next.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nclass MyBaseScene extends Phaser.Scene {}\n\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.0.0-dev.1635530738","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-zyu/GMeIMjhQvt/i6XbG1wCX0H2GSUSq9XzOQ5WfKg2eElTCo1mn1J2TMMSN+BjIZQwPPzSphbtF5DgsLFwpLA==","shasum":"bff0ef700501b732b56c4bb93a39c508cdb18f19","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.0.0-dev.1635530738.tgz","fileCount":113,"unpackedSize":586181,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFxsMCVeglU8eaZp52HbE+OVCyAVX0bv0ZEg7w/sIlFbAiAl90bpubND2JMel3yXNDgZyubaznqxnVg3MiN2n1OQFQ=="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.0.0-dev.1635530738_1635530784778_0.7439387714915191"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.0.0-dev.1635784565":{"name":"@agogpixel/phaser3-ts-utils","version":"0.0.0-dev.1635784565","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-next.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.0.0-dev.1635784565","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-kpaFuiFJ+ZJud90U/GKiLqITheu1kCebBYYNxGJTiVRh86uFhgBfoZCJ/fx0X1f5AHgzmD1Yc48xUJQrEX0k7g==","shasum":"28b74acb0d99ed4dea6774cbce19070f568cc8c8","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.0.0-dev.1635784565.tgz","fileCount":113,"unpackedSize":592996,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHDCfdz/aEi9CZXQTf+28UbXawXFSYf21MhyZjHbB1X6AiEA6OuqRB6CxRdu0a760/5bF78VXAEqcyE7hBHmxuDwo2E="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.0.0-dev.1635784565_1635784616162_0.6246999683769674"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0-alpha-dev.1635784994":{"name":"@agogpixel/phaser3-ts-utils","version":"0.1.0-alpha-dev.1635784994","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-next.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.1.0-alpha-dev.1635784994","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-1ST5B4DDUK9hKMiLK0YwkhZUa2ZrVU9lrbl+E5vfRPIVq4sFIBP32IJ1MNJXVP798llTVrQjyPlY6v1kiNjHqg==","shasum":"1cc2e05861741cd563e7c7168cce97496476607c","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.1.0-alpha-dev.1635784994.tgz","fileCount":113,"unpackedSize":593002,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEML/Lsb3WuYTD+5/R1O7NBPhp7VRUuP+eP+fp5TN1PsAiEA8tN8AnM2ytpzAgLFxpIv/9TfqerqmAS5IC+UTY+eUys="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.1.0-alpha-dev.1635784994_1635785032365_0.38656701059397536"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0-alpha-dev.1635785319":{"name":"@agogpixel/phaser3-ts-utils","version":"0.1.0-alpha-dev.1635785319","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-next.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.1.0-alpha-dev.1635785319","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-IdwiBJMjIo1Gw9LWKhuNqbFnJhdU0KxRzR8vW/IdVwVJ6Hwkx5TGBkkXCZKGu/0E2xkm45vxSXqOzCQWPnZZ8Q==","shasum":"32eb99bebc90c0b5945a28d274e3f291f749d000","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.1.0-alpha-dev.1635785319.tgz","fileCount":113,"unpackedSize":593002,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGP2EDGTVZh8f3HEeHgHwF61LeElvcCkNwxLHQ2o5XGAAiBnuZi9m6l6837oS99C8TSkjGQuNlZyhpOpNoxPNOFBng=="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.1.0-alpha-dev.1635785319_1635785389337_0.7663795680866281"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0-alpha.1-dev.1635786189":{"name":"@agogpixel/phaser3-ts-utils","version":"0.1.0-alpha.1-dev.1635786189","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-next.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.1.0-alpha.1-dev.1635786189","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-NqQNBWYNwmemTDNvtDfZWYf5TGUrTy264Aym3G3mqUDg/Ob8wtfOIAzuH065NXoKpFTgXTRQGmW80wzQJJ7MMw==","shasum":"aa306646debe34466c3fb074632e6cd4d83c95b4","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.1.0-alpha.1-dev.1635786189.tgz","fileCount":113,"unpackedSize":593004,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGa/WQi7rRPjqmy8C6OsI/OmaM/dHY8EI4SiFG5PrdLPAiEAmooqXHR6jQI4fKaiK3J3CQ1x5NCHYQej+IjhbFh4mdc="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.1.0-alpha.1-dev.1635786189_1635786241904_0.6037344708901544"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0-alpha.1-dev.1635786290":{"name":"@agogpixel/phaser3-ts-utils","version":"0.1.0-alpha.1-dev.1635786290","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-next.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.1.0-alpha.1-dev.1635786290","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-st4KZTB3j+Vb4YjZ7eSk7LprZR++LWYmLk0M9C/xHE/MRNS0EQBATbF3oqEnirWLtcdLtL3ahle65V8AJ0Cn/A==","shasum":"f2ac63aa4638b2e25e3145979e5cb2d8c0f2309e","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.1.0-alpha.1-dev.1635786290.tgz","fileCount":113,"unpackedSize":593004,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCz0x9W6MBtruMWy2my27v4y9g3Bvl8SKCGRmXJpjYMNQIhAM1aDrZdwXyfx91Wz9W1uAa7e43ZvWaNFODI7eHhmWqY"}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.1.0-alpha.1-dev.1635786290_1635786339150_0.7480930202077023"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0-alpha.2-dev.1635786636":{"name":"@agogpixel/phaser3-ts-utils","version":"0.1.0-alpha.2-dev.1635786636","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-next.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.1.0-alpha.2-dev.1635786636","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-rnN1aOaS8LVlCMlxSKnpMLaYDy/16fVW4xS1nvnWaLxFG1+UfqOIR1dZ2GaPnn+CDUFQFRCdjL0zUMRAA23HBQ==","shasum":"273853c611fd7bffaeb4bb997133c40273ff6fbd","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.1.0-alpha.2-dev.1635786636.tgz","fileCount":113,"unpackedSize":593004,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF/DjsOtJEqvBMyg0DwI6atcf3zoIORL7gKTQ5GVfLfMAiBE9BzjQLAKbrla0uJlG9b1y6QYIz9KufqiLEQIbsPCJw=="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.1.0-alpha.2-dev.1635786636_1635786687469_0.48507722158740574"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0-alpha.2-dev.1635786738":{"name":"@agogpixel/phaser3-ts-utils","version":"0.1.0-alpha.2-dev.1635786738","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-next.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.1.0-alpha.2-dev.1635786738","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-5eBb3pgoErQ/fHZO8benai8QyGrtoUMaRzV94A53mCywsWtZ3Zt8rDL4CgDzTHGI2KPT6UhGWVic0tdKc87t0Q==","shasum":"f044a1f7ef1a572c7f5e0732c1dbb5e0106bfb03","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.1.0-alpha.2-dev.1635786738.tgz","fileCount":113,"unpackedSize":593004,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbDMU4Fff+SrQok4tdy5dLUF2Hb1EORz7sppmDHX6RiQIhAIiGv3mzpiCl3J28I3qWnzgFoWWq20Nm7MxLUy6tRC5H"}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.1.0-alpha.2-dev.1635786738_1635786794441_0.5468835323290504"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0-alpha.3-dev.1635787405":{"name":"@agogpixel/phaser3-ts-utils","version":"0.1.0-alpha.3-dev.1635787405","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-next.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.1.0-alpha.3-dev.1635787405","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-2rVSetTv/spFU8wR8UpmY85jS71SC37xb4XbCtT/f/VuD8WjZgSN/4d2ZH9FGE666LxJCqizvJAdg7UqyQMLVw==","shasum":"eec532b998872604f1080834d6ee139aa5ac12aa","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.1.0-alpha.3-dev.1635787405.tgz","fileCount":113,"unpackedSize":593004,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCj/QBr5DP1lWPJWgpJ86yukbOZ6yMkpbV6FDrb3DvCRAIhANiuYSELLM7LQiS57mPXXYvvrzqghcbC4KLWk/D+mqSh"}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.1.0-alpha.3-dev.1635787405_1635787451500_0.9475450103241829"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0-alpha.3":{"name":"@agogpixel/phaser3-ts-utils","version":"0.1.0-alpha.3","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-v0.1.0-alpha.3.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.1.0-alpha.3","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-PTIHxYLbBkv6EhJvU62Eaj7JgqvxXakiVpbd6VfhGLtuZD+B1o0Myovjj7IETYTq0N0FAPytVmjSWXDGtv+QWg==","shasum":"06e8834f123bf41d10e674ecdb2577d414762374","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.1.0-alpha.3.tgz","fileCount":113,"unpackedSize":592990,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCcnP8RIRpHWRYpB+0JqZWBe9EUaQhS9QEcT5SHpuRQQIgR+SN7u9emzlhMaReHQSq2zWGVw7BDKqJ6cUfT8VLspA="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.1.0-alpha.3_1635787527760_0.7420984102052217"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0-alpha.4-dev.1635800373":{"name":"@agogpixel/phaser3-ts-utils","version":"0.1.0-alpha.4-dev.1635800373","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-next.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.1.0-alpha.4-dev.1635800373","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-nzevdH+KNWtlCtnNkvhfC1T6oE8eWPOks/P/JkjsPz0cHDhgwijWncMQ7y1zj1O3SrkkbfEFKUWgYN7JCwmeMA==","shasum":"d1b1bc03f19b138abe13c5c5312eb95bb9cdf6e6","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.1.0-alpha.4-dev.1635800373.tgz","fileCount":113,"unpackedSize":593004,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDe0gtZsK5dI0k7/j7cNGgl0V0ccp0Q/v29waYiOjhjPwIhAMEIgShgS+GMGRFtvGpDgFaus68jrLRwKdrg4KuYFYqO"}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.1.0-alpha.4-dev.1635800373_1635800415557_0.9546527765053938"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0-alpha.4":{"name":"@agogpixel/phaser3-ts-utils","version":"0.1.0-alpha.4","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-v0.1.0-alpha.4.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.1.0-alpha.4","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-c0cajTGR+LSI7tnJ0A6xR2YfBaXdneo3C777UZBOW8YB5qgpQ0zA8idzHly5/ugeacv/AYwugKmhT8yTqLlX6g==","shasum":"09ef5bf5c14aac48b748569ee05a84ae34fff409","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.1.0-alpha.4.tgz","fileCount":113,"unpackedSize":592990,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQfeisFItSM61NUwqUMrhA/CQrPWRLTUYddMTaUMOnuAIhAIXiAVhaTq608MXF3fQerGUcYJquOXwYSUruqb3KqgNU"}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.1.0-alpha.4_1635800489391_0.4353108198965694"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0-dev.1635801170":{"name":"@agogpixel/phaser3-ts-utils","version":"0.1.0-dev.1635801170","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-next.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.1.0-dev.1635801170","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-HJMTbiHRzwjCPUs4G8lflmgpK+4mXCi9MMHVToqVqn46EuQDT5oDjE+L/LcgKnxxJl6OkU3DQrizDpc9oye5+w==","shasum":"713e3fde0b520249d29497bdb9d0645e5817b796","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.1.0-dev.1635801170.tgz","fileCount":113,"unpackedSize":592996,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCkDhdFlYhoMObZNw3LHQKxhrtJeXKfDWVmg5Zv1GtJwIhAPwx7Tm1lRrMy6XiCsh+KjWGyw70jqMQY7ao35XaaEe+"}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.1.0-dev.1635801170_1635801206373_0.2555108906023582"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.0":{"name":"@agogpixel/phaser3-ts-utils","version":"0.1.0","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:phaser3-ts-utils-v0.1.0.tgz","_id":"@agogpixel/phaser3-ts-utils@0.1.0","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-J0/Eb8fzfEfKotF34ARbFu5KAQYxmaUxA5UECKgmhfoceWB/FxpSSFJkMPiLvrpoMmxpHtU6uKc/5pfQtaQS2w==","shasum":"10d0216fe9fac7da2f9c369e5da1810261cdd2cc","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.1.0.tgz","fileCount":113,"unpackedSize":592982,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD3Ci247jPIzJDczBkexd/3AavqigVZDnXftKJrwYcRPQIgYPRGgHQCqnUVOizJzc7I/135ngzG4BKe6f1Cx4MkBbg="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.1.0_1635801319176_0.7785730307337981"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0-alpha--dev-build-1638731494":{"name":"@agogpixel/phaser3-ts-utils","version":"0.2.0-alpha--dev-build-1638731494","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:/home/runner/work/phaser3-ts-utils/phaser3-ts-utils/agogpixel-phaser3-ts-utils-0.2.0-alpha--dev-build-1638731494.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-package-tarball               # Development stream.\nnpm run create-package-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-package-tarball -- NPM\nnpm run publish-package-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.2.0-alpha--dev-build-1638731494","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-YvmqAu4C+LGt74EqFBKA2geA41doZS5b08Ea5l8ozA1Cn0crkZ95y+3tIHpLJGGmoKJXBFLRhDCQ59MEbvbcVg==","shasum":"ec44714d0959e092b320fdead1a4067fc3a8fcaa","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.2.0-alpha--dev-build-1638731494.tgz","fileCount":113,"unpackedSize":592944,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrQ8NCRA9TVsSAnZWagAADlEQAJkt95ZetUCk1qkeTbeY\nQObYNZ81689aNlIfxbqsAz/KfkT+IrATjJtJ4GQzBqW+eFlEeOL2LcuoPrSK\n1VpDieryNwrwqPSnv3t9y0BGTPl0PFwhbSd5yBSh1cFR3fAY0V/hWt6rWEB2\nZKNVnMDVEToYy+n+ca+oa5MbEkXvGo+71oeLUB9h3IBnNJehmYxx09hWl5lM\nCz6RIPyJ1JztAiRsViAOmKLuyq3XvOokW/MCb3AgdzYnbVBRPBI5ChUNc/k3\n+PszMCc/u2UgOuK6l9eU66O9XQrOyTgdP9X45OfyaO90JEUUzAQKUMcnQ3jd\nzenjSRtdv979QmzmdvkKi1jdiPjeW8pqUYRtupvCuKJ3L9kAnLzZ4mjyEUKy\nw0TArNg1I0Jh/GU8WfztNoCnGG4d0jwml93NH6J6VHDVVZ9SK/dbFrd4qUZT\nnHL+/jzXkf4IsRT3mQgvDzEaDU/MD5DFqDsMh/sWV3cRrvTEXhpVFAFeOIQ9\nU3Siuj5ezyTEBvXKRel/CDm4ZBQ4wjZRKa4ZVqtpfUjFS4f26yYenZL5k9jj\nHmklccBgjwJRiP0TD8IZg7qoCT+GuWSeGJzn619F9yIBnq5m6b/zOWcjyJP4\nNthHJ5PsfAkcQq4IKov/9scWNrOmoJdABwBXftnjOub25hBOdsic5QC7z9kS\nrp8G\r\n=EY/j\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQ6Tg5Y3KPG0yO0Wz6qwU9aeyi0eHV7tsGzXfj0Vu5jAIhALKL3n0IWjpKRGkkQKtdJx1k1kk0g+DJMmMvIJXczYDP"}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.2.0-alpha--dev-build-1638731494_1638731533106_0.4202051974473704"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0-alpha--dev-build-1638731929":{"name":"@agogpixel/phaser3-ts-utils","version":"0.2.0-alpha--dev-build-1638731929","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:/home/runner/work/phaser3-ts-utils/phaser3-ts-utils/agogpixel-phaser3-ts-utils-0.2.0-alpha--dev-build-1638731929.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-tarball               # Development stream.\nnpm run create-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-tarball -- NPM\nnpm run publish-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.2.0-alpha--dev-build-1638731929","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-GVrmTuqpoNL98TCcIbcxQKXnc3L+wxUpXE4FdVbrDkCKPdVIXHkDatjJY7geaxIYVvDjYfCQx25TMkCRJiiiNQ==","shasum":"0fc68ad4c88ada13f7d3aad053fee5af3f59f96b","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.2.0-alpha--dev-build-1638731929.tgz","fileCount":113,"unpackedSize":592880,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhrRDFCRA9TVsSAnZWagAAVogQAI3KCRitxHywxjHhCYK6\nJTRf5cwVJloQsMfN+SylI2t0YoZpeKjEe8tHn8M6tV8/ZeiAyYi8YD9NLDPU\nCGT56LjZQIvpukRhttCn06cJ+V/Kc63roGJ3mfPr09wTq2Gcpm7r1HiRZdNT\n+IKTBH+S2w1bo0U5PxJzndFlKD3CdToN/NretYS7/8XO1gpDSlwugfZvYRWm\nFsYEjxqqGAba5Pt4iWlp+WCw09Dfyo7DzePcqnsPY3Fj2enfcTnwUvMyFRT4\nouOUY9eawPw7m1vqXprprswULjTY/6C7sIXZCAp/r/R0AsniIv1RkUo4s4/S\n05CsFQ6oWpupGodI/Fk3+LkDVFT0GJuzPFl+76wP1ZlTf5E+P68GLwS3J7bs\nza1ATKLmZc6L1lUFmWc41j2wiynMz9DufvHKc6trIneDcHvTWqgXkh2pbkCm\n4IQl9U1iyYBRAlHj8ylSPENKoVFuIrMgpc+bftcL0s1Wf30kII2ueODIbXWB\nAsyFCFw9+Oe2dXf5nUzYujPDmAGv3PYVwM6pvHQ+PRTZt462NLaRc+ry8bQC\nb/wVa2A9Rd+Sol11Q3qcmVcr7nG7/Oj0OHQDIHI1se1PAjZHcKS6n4KeprtL\nY9M8Ez4DtOar9WuzQ7tix79gLLDjX3nh29zW1aio7abNZpA9jUkERD/bAWOF\ndbIX\r\n=yvOI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICUDc/0HXhFC3dLVyoeoeywWU0mSuMY4wVpmlOaYh9l+AiAhL7dMN2vsV0X8DShUPItEhf17LkUuTFgOTjJmMIjNdQ=="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.2.0-alpha--dev-build-1638731929_1638731973796_0.9666956588288067"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0-alpha--dev-build-1638952932":{"name":"@agogpixel/phaser3-ts-utils","version":"0.2.0-alpha--dev-build-1638952932","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.8.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:/home/runner/work/phaser3-ts-utils/phaser3-ts-utils/agogpixel-phaser3-ts-utils-0.2.0-alpha--dev-build-1638952932.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[![Build & Test](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml)\n[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/kidthales/8783260504aa23bb1c4dd36f0ba3be01/raw/phaser3-ts-utils__heads_main.json)]()\n[![Version](https://img.shields.io/npm/v/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![Downloads/week](https://img.shields.io/npm/dw/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![License](https://img.shields.io/npm/l/@agogpixel/phaser3-ts-utils.svg)](https://github.com/agogpixel/phaser3-ts-utils/blob/master/LICENSE)\n\n<hr>\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-tarball               # Development stream.\nnpm run create-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-tarball -- NPM\nnpm run publish-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.2.0-alpha--dev-build-1638952932","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-gAvT89CsBYdvz78puMD0N883Z16jgCs8LUIALxMpqwNWX9RqzYdpV0tvWSKH8IgapxqKh+1t4mI++y1aE+3fNw==","shasum":"995787e0823ad4e5e0531a0829052be7f0cd99b8","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.2.0-alpha--dev-build-1638952932.tgz","fileCount":119,"unpackedSize":630357,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsHAOCRA9TVsSAnZWagAA+t4QAJ779hh59oNZ65kV7TdH\n/6sZssMmXDdJhZOhoSi6f52o5vTCffScvw1JeLDQePi40OQpZT8BHF5fbVo6\n8b0DDpXH7D7kL8pv8BpQZJ/yBPnd8ZSWUrVF5NF+dhsXgOjVokT41IQC91Jj\n7SLoU78Fu8J10DH8DL+d7100+4eBV3D3p1n9MMlWZcGxpEnoAdIlLhswrsRJ\nXORlQyDP5Q0U/4JG+lHfI9OPjUTtohuOTufQTgsgfzOchdvngQU2eCn/Mp1E\nq2QD9Bqc32QrJ+jeaV4W4/yVSPEIR8pF7XWGC0k6dfU6vhIwvzKCEL2qKx4T\nBSOElFtSOsuSS0q43v3LA2bBdAhqioAFneW1moMZOc9TAg+E1wblCpfDv06p\nuF4UHTrthWS6gNNOZqq9pdaPWEl5tmDfH/iTttf1hmBdFm7ls0todgaP/geT\nENAybphgu5FI/xcnSDZlJJEPT89fgd8FQOLoagKC19boO2F93/xN4DC7QYgw\nbO2cJNbF2ZixllmwVWpPtEEfdVWjD7GleJl2j/Y/pcmzWXUEI1CTL3C6UDiM\nIzT+JeNqW2YWedN3kE6s3zml+g9ZuRqWjIyoxtssCrC7q5V5jTPkFHoIX28Q\nDirwwKDdanlrDgJuamkhApbmEvpJpkEz1eWTMThzu6r7jZzhKTj8Uv2oM58z\nCeWa\r\n=D0Hw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAaQDe0Jc+5e7+jpHHzO+CTCIzvEV8NntWll5ylf8qylAiAShNxny+UOrUeWvmqPO0CoueFsSYrc2bxu95m5WySwDQ=="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.2.0-alpha--dev-build-1638952932_1638952974128_0.9174955930226589"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0-alpha--dev-build-1639114159":{"name":"@agogpixel/phaser3-ts-utils","version":"0.2.0-alpha--dev-build-1639114159","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.60.0-beta.3","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:/home/runner/work/phaser3-ts-utils/phaser3-ts-utils/agogpixel-phaser3-ts-utils-0.2.0-alpha--dev-build-1639114159.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[![Build & Test](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml)\n[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/kidthales/8783260504aa23bb1c4dd36f0ba3be01/raw/phaser3-ts-utils__heads_main.json)](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml)\n[![Version](https://img.shields.io/npm/v/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![Downloads/week](https://img.shields.io/npm/dw/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![License](https://img.shields.io/npm/l/@agogpixel/phaser3-ts-utils.svg)](https://github.com/agogpixel/phaser3-ts-utils/blob/master/LICENSE)\n\n<hr>\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n##### CustomGameObject\n\nTo help streamline the [components](#components) example, a [CustomGameObject](./src/mixins/gameobjects/custom-gameobject.ts) factory function is now available:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyGameObject extends PhaserTSUtils.Mixins.GameObjects.CustomGameObject(\n    Alpha,\n    BlendMode,\n    Texture,\n    Transform,\n    Visible\n) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-tarball               # Development stream.\nnpm run create-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-tarball -- NPM\nnpm run publish-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.2.0-alpha--dev-build-1639114159","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-QeQwz140Lb9nx2KoKyamwUxLhuWdv0IjW1Qn178beTXa5t2nhm6uD9dH6mGGIwVANYY8n8tOtgjpF3D7IqT6nw==","shasum":"bd2550acda30a8af50034d3274be76a20f79b03b","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.2.0-alpha--dev-build-1639114159.tgz","fileCount":119,"unpackedSize":633838,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhsuXWCRA9TVsSAnZWagAAKywP/jPY00BcD/+uSINkeLwT\nzAo9l2wuwOUfhly/62XxAGwUKN4rL7WSqbcdhJ6Ayb7c0xqC8iNcjYr0tEXv\nqz+Ag3GtUNJCKuf4Cx9FtVHpoudu+cYvsK2P03y+Wrl+WrE9wcM1DiOQIJ6+\neGkAH7zgqcNznrTsIsRKM6beLlcIHYo2e66VaJq9MWrBbkpzQzOA4z80Sdmk\nahe1uWwr11MZE7wR6+b2bMz62L0hQxjubyTGlf3ZHog9ppT+ukaaq+NzJZmn\nlS1BqsNII/K/uw6+y5vrtbsagDjDVQQO3BKy9xxaUcmHbu66rxo1aqZTeYSo\n+p6Dldyz2qxU+ULMvm6uBh0vGrVlz3ixJAZ+8abaXHRQEq+Mexna6P953r8m\n1UliYkuKwyEOR2FnQDGte1p1iYTpGYzKeA4goyTTrRt640Uml5ZqSAiopAQK\n1sskXXS54ALmbsvAZM9Nur9tHt9zSpNgm8TIzn5yWrUeDRtpsMH22XJcDuLa\nCky316ndESqIwtY0Fc6vuzeUgwOUpeBp6Jw5KarShMhUAbP49EWKRaZNi50v\nTKoZMetRGrxU6GuqsCHDMVhaTupAB3JzNQo/JSrrrPcLR9U2P2A0xPKkXrSu\nH/ercv5z9wYFp/K516yJMn1oYDeyYuvHnlHqi/f/aNF/Al+ny/5VuGMqTPXX\nkNIr\r\n=0pX8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDsfl2MYi8eef9Q6DozrNYTdP7vTURdzqaGk/M1bJFdwAIhAPSYlyfhPS/WbFgEh3ewlQfhyPhtMPE61/kMmiuF6Dta"}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.2.0-alpha--dev-build-1639114159_1639114198406_0.35447627526460224"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0-alpha--dev-build-1639121114":{"name":"@agogpixel/phaser3-ts-utils","version":"0.2.0-alpha--dev-build-1639121114","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.60.0-beta.3","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:/home/runner/work/phaser3-ts-utils/phaser3-ts-utils/agogpixel-phaser3-ts-utils-0.2.0-alpha--dev-build-1639121114.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[![Build & Test](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml)\n[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/kidthales/8783260504aa23bb1c4dd36f0ba3be01/raw/phaser3-ts-utils__heads_main.json)](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml)\n[![Version](https://img.shields.io/npm/v/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![Downloads/week](https://img.shields.io/npm/dw/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![License](https://img.shields.io/npm/l/@agogpixel/phaser3-ts-utils.svg)](https://github.com/agogpixel/phaser3-ts-utils/blob/master/LICENSE)\n\n<hr>\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n##### CustomGameObject\n\nTo help streamline the [components](#components) example, a [CustomGameObject](./src/mixins/gameobjects/custom-gameobject.ts) factory function is now available:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyGameObject extends PhaserTSUtils.Mixins.GameObjects.CustomGameObject(\n    Alpha,\n    BlendMode,\n    Texture,\n    Transform,\n    Visible\n) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-tarball               # Development stream.\nnpm run create-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-tarball -- NPM\nnpm run publish-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.2.0-alpha--dev-build-1639121114","_nodeVersion":"14.18.1","_npmVersion":"6.14.15","dist":{"integrity":"sha512-OAHAuNqgnCdC5TzD9goBa0w6diWV+oyCpPLhMdR9085ABeBvY/RlsmDsbHXeXs18MKCq4uRIIXt3oL/Nrh5Qaw==","shasum":"30b9d860580108c79da4175ca1e471592037f240","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.2.0-alpha--dev-build-1639121114.tgz","fileCount":119,"unpackedSize":634702,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhswEFCRA9TVsSAnZWagAAYGAP/2pBJhKwb4lL7nyJdxQC\n1xqbX+2CbVWUUtU09dmkCWLdRe7kGDa4/GMJQv0q23lWHHQwU2CVJAsjnT66\n/RFiBZsakgHpnfKRFs8PS2iF3irdxYYIK1sL8SZtNA71uAbEKkowYla0Vddr\nNBaf3AuqDNpZz/FVrLAOzbPN61FqoJcJuHNBTz9tJnADnCW8TuSfrm8gP2NO\n+VuDgt5qPIX58RDStxA/+tJZKg0MH59/QxzMFU6PxmjMGUGzg37Z5oXltFVl\n0LtqmEZ8GUkLcqynka0JtEb2p8mh57z5ozZHYGQrJRilzESZcm8vNRE2thJ3\nksHiH4vPyjSvRDHIahUy3h9c26m/dd17WKHDmH86Fxu7eGPfHR0TvR/FDGTp\nyS09y8nECIp9SryB/GNRr7VkwHOxfoMRhZvxOQyOK3Qr2r6V/do0x1mYb6ah\nTo+PjZRoKiQ1MbJNdV1d/yM27aRz0IJBTqbGBFDGKbdPcVV9qr0I/aJ30tX7\nhxS1f9lGl8Pzv8culd+CRWaFeMwZEZV/AaPnCN2Dn0vMMsn6x1i5w8RjJYF3\nvkJ8cp1OfsEbNOWqOIpSVqTJRlwdm6nSJgq9FMpviq0Al4u31D3AhdfBXsiQ\n8+/xabHFyNLzbJ+qiPAnRypnGfswmFdp07tlsSfyh5bg+193jFDpLXmzRrqa\nHudv\r\n=76v+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBBOtDeLh93LGZbU8sze4nDqK4MI/fOSDeCZmG1mRnjwAiEA1ifegPrhIMSzEfSlQfVcCQvGoTLc/JJAjHVy01mT0jo="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.2.0-alpha--dev-build-1639121114_1639121157359_0.9147064334758204"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0-alpha--dev-build-1639454098":{"name":"@agogpixel/phaser3-ts-utils","version":"0.2.0-alpha--dev-build-1639454098","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.60.0-beta.3","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:/home/runner/work/phaser3-ts-utils/phaser3-ts-utils/agogpixel-phaser3-ts-utils-0.2.0-alpha--dev-build-1639454098.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[![Build & Test](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml)\n[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/kidthales/8783260504aa23bb1c4dd36f0ba3be01/raw/phaser3-ts-utils__heads_main.json)](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml)\n[![Version](https://img.shields.io/npm/v/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![Downloads/week](https://img.shields.io/npm/dw/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![License](https://img.shields.io/npm/l/@agogpixel/phaser3-ts-utils.svg)](https://github.com/agogpixel/phaser3-ts-utils/blob/master/LICENSE)\n\n<hr>\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n##### CustomGameObject\n\nTo help streamline the [components](#components) example, a [CustomGameObject](./src/mixins/gameobjects/custom-gameobject.ts) factory function is now available:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyGameObject extends PhaserTSUtils.Mixins.GameObjects.CustomGameObject(\n    Alpha,\n    BlendMode,\n    Texture,\n    Transform,\n    Visible\n) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-tarball               # Development stream.\nnpm run create-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-tarball -- NPM\nnpm run publish-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.2.0-alpha--dev-build-1639454098","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-9YduGFZzA2VQgzegW2Xc1TdBav+Fp12grZfbFNHoVipm8VShyMJobr33AZ9gGpQ5qPsNYIdT3OHKYpLdsrlHVA==","shasum":"d2810aa3e9f210a886c8267fab3ee26d17d28e6b","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.2.0-alpha--dev-build-1639454098.tgz","fileCount":119,"unpackedSize":633105,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuBW3CRA9TVsSAnZWagAAleoQAKIwODSGxgsVQ9/PayPT\ntY62+dZYPX7mHkXt3dfxhQ+jZevjfLrA+mFZvSsJdDgry+LVzgqmcPPW8kld\nbzBby9o+8nAeCFMxQHtVOz1DAOMPxcTQsh4Nvla+dQd1PhK517ot0nsf9ArP\nhElvaRzFuS1yRbQoRj5YifuZzeVMSPBAUjSVEAANdTYyByhKkEF9eNfQkv/7\nI6D6xsMkeRQIUe6D9f5CqQlywwYBZLedRQYzhdDyeI7sQ9HJ/f9tFHMT6VD5\n/i2hEs2bf47+gbx24J9gIyXPoSSrDUdnKjOolcqF7RAmJpPY8PNiMjrtEIQu\nQA7vATyvThkt5Qtm68mjnoUmU2lRDwscySLtMKidUqmGEzEEeRGw9e9F9Nfq\nfkyznxg5fkNYXIgKCkMMIrFu/RnwZfrwkI4pk6z5eF+8TaaEbV+0O98zGmDz\nVZhA1rveklOlJZZpl/+2ifgJ5kmrNTm7cU9Asl3qv3LQraJsDeH56SJIRjgn\nGUBWJpKsYuG1vzXeLy+txSUkdWy8hTO4m7Dsou1991D08rQ5ImgYut95aiOb\nKxu43jXaZz4kYscwXT4q0e6Xc5uvNexiccpNXgeLddEARJNW752z5kzK9WqU\nPUUpEqI508tsbhjsb6O3cDlZnnd7OnyB+yjYVl+f40ySz8+QfTso1tSFJ254\nEK9h\r\n=BrSp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDhzHnvAnXamPwltejnmqCPtDuBsGLUcZGlzMT9AbCQQQIhAP7HgwqNRhZwwAUG3VKuXi0yqdQHV50XBiUMpsIgNpIy"}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.2.0-alpha--dev-build-1639454098_1639454135705_0.12587739448770763"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0--dev-build-1641771218":{"name":"@agogpixel/phaser3-ts-utils","version":"0.2.0--dev-build-1641771218","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.60.0-beta.3","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:/home/runner/work/phaser3-ts-utils/phaser3-ts-utils/agogpixel-phaser3-ts-utils-0.2.0--dev-build-1641771218.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[![Build & Test](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml)\n[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/kidthales/8783260504aa23bb1c4dd36f0ba3be01/raw/phaser3-ts-utils__heads_main.json)](https://agogpixel.github.io/phaser3-ts-utils/coverage)\n[![Version](https://img.shields.io/npm/v/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![Downloads/week](https://img.shields.io/npm/dw/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![License](https://img.shields.io/npm/l/@agogpixel/phaser3-ts-utils.svg)](https://github.com/agogpixel/phaser3-ts-utils/blob/master/LICENSE)\n\n<hr>\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n##### CustomGameObject\n\nTo help streamline the [components](#components) example, a [CustomGameObject](./src/mixins/gameobjects/custom-gameobject.ts) factory function is now available:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Size, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyGameObject extends PhaserTSUtils.Mixins.GameObjects.CustomGameObject(\n    true, // Checks component mixin dependencies...\n    Alpha,\n    BlendMode,\n    Size,\n    Texture, // Size needs Crop, Texture, or TextureCrop...\n    Transform,\n    Visible\n) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-tarball               # Development stream.\nnpm run create-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-tarball -- NPM\nnpm run publish-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.2.0--dev-build-1641771218","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-CyShYWk82rkyPuzkIWAdXeYZNiXiuoRSNkCbon7IEO5aM6YRKdxypcfjrPqAZMTbj5mDr3ft+uy6yJ/1HMekDA==","shasum":"c836f11c15dea963a5527d0d8b336cd4908b9ad5","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.2.0--dev-build-1641771218.tgz","fileCount":94,"unpackedSize":142170,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh23D+CRA9TVsSAnZWagAA/4YP/ivmGXxR7y/munNI6cma\nCWgdWuOpXIRe8CSWnQ4rKS8jy2bPmxOnHLZyZsXAhzgTjS5G1ptuaE0pSuF/\nyr2QPJU3839qGdsG0+1pnKSVvYO4vUe+xoxBsYHWdT0EQxDrRG4mRLg8jHAU\nxNHw7PbzrEt8Q++/i8Bd/q9OLw7udk6u8tM/6kBRT4ZkQRO882X9vwSWDMnE\nKOjQiTakMlDhqDn0ZRtf1Zw7xs98LUMAu0+B9oz4fxAEb6/bmeVhXRWZhVBp\n6an5/VHXVyiOMK6NzYYrMNH9fRPufpu+ZZGEWgxLX4SClaZpa+yy8hDyjXOo\nZDT7RxahLUwLGpbvxyENulgnnB0ZLY3SnR5c5xcJqWZd5Lcmk2Cy6C4BKdf3\nkHSL76ptlRmVt0HlJUV5baigmFJTQfrazDe1F8D8vMju0nB72gvBOrNdSIJg\nLtfG5gGHnxhQ6v0Ta8edTONtzPTbJfMqzgPWBL3OSrhOItL3kzK2nBI4OtnY\nSmfY4CHVmQCAuRtsiOylNtftk+SjTHdIGcwaEVoZ0jua0LHTLYXXX4yd6eRX\niTq9gl5SmOs8MUzQE65+KHR4QhyW+W0jU2HTt9cEpc0n25ZqtR2VG3QFERtj\nlEfLAP1lPjdCNWq1DrwEQEN9/4J+1bC+rhmyWpjVbTWP5lQxq9TOogpbENNi\neRvZ\r\n=i2Oz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCi/kfWjrxCOQh7NnZb+Fu96lwbsgZqNlorqq9lyTDpVwIgaGqoPAH5nBNqiF2UFtTV3XmruVo1hJEeLydeQYo0/Fs="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.2.0--dev-build-1641771218_1641771262408_0.14809092403664925"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0--dev-build-1641885423":{"name":"@agogpixel/phaser3-ts-utils","version":"0.2.0--dev-build-1641885423","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.22.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:/home/runner/work/phaser3-ts-utils/phaser3-ts-utils/agogpixel-phaser3-ts-utils-0.2.0--dev-build-1641885423.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[![Build & Test](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml)\n[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/kidthales/8783260504aa23bb1c4dd36f0ba3be01/raw/phaser3-ts-utils__heads_main.json)](https://agogpixel.github.io/phaser3-ts-utils/coverage)\n[![Version](https://img.shields.io/npm/v/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![Downloads/week](https://img.shields.io/npm/dw/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![License](https://img.shields.io/npm/l/@agogpixel/phaser3-ts-utils.svg)](https://github.com/agogpixel/phaser3-ts-utils/blob/master/LICENSE)\n\n<hr>\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities. Requires Phaser `v3.22+` as a peer dependency.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n4. If using Phaser `v3.60+` and need the `FX` component mixin, import & use directly:\n\n    ```typescript\n    import { FX } from '@agogpixel/phaser3-ts-utils/src/mixins/gameobjects/components/fx';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n##### CustomGameObject\n\nTo help streamline the [components](#components) example, a [CustomGameObject](./src/mixins/gameobjects/custom-gameobject.ts) factory function is now available:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Size, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyGameObject extends PhaserTSUtils.Mixins.GameObjects.CustomGameObject(\n    true, // Checks component mixin dependencies...\n    Alpha,\n    BlendMode,\n    Size,\n    Texture, // Size needs Crop, Texture, or TextureCrop...\n    Transform,\n    Visible\n) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-tarball               # Development stream.\nnpm run create-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-tarball -- NPM\nnpm run publish-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.2.0--dev-build-1641885423","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-mvQ3exTk4A+8cH0FZn+HhV7H5ZZ64AWFn+qEwM58YliyINFw8pYYHWzZRk2xqih4rP15wqfMH3jwIFClRjUDmA==","shasum":"af709c76c072b12bc65d1db1fb0d4ab13bc5be64","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.2.0--dev-build-1641885423.tgz","fileCount":94,"unpackedSize":141429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3S8dCRA9TVsSAnZWagAA9YgP/1QnMK/gWnzn+6gVw26j\nWdaXVQKGwS3NzJRYg36BRgmp9hbTq5ninTphtDqiCeZu2IEGx/Rf7iky2KAq\nDkLKc0qw/de+XKVEMcyin/GcwTdbnU6fsIDIpcKYDRNd2ToII6okewbsKH9i\nQfGvsA0iwGOt+ffkp5nHH8gTIFL5aabyMLmm1RoyU2N7oxUBcelHoDiiUgD4\nwdfUNoNAWheZZm1k6kuVIbzaPSn4hNBCocRzjSaS0gqUpI7hGCYc8GwcKeWg\nOSlbhp0dCE+VYyMGuG8nN5hjbvv0G+NPmiday2glMv68Tu5AzixoXwrDPSvs\nQS8zGJXwkhW/JYxSUe6GvX1L25HrzM02QiSlo73Vl4+ivzx+Zmxj2mBaVciU\ncFgN6DWDFtDChe+tGTQFJu8GRp9dcvWjw8bdlAthUNzi5XQGyBqBcwHiWv1K\nGj56RIo2HmF87vRPH5ItCrGGC+mGB6iEbqU+YkdxA3sJzmD5A4dpl+uW8eDo\nz0eDeAnC7D0cUvi7gnvOYl8wju8yWZ4g/J1/iPAxsI/+wYQZqcOdnDi2E+cu\npv/FfjZAr98n5VY5na1alw9QlPwjZoh8dqfdaWbfC9nAHe7QFDjeYIWSF4SO\nKyKbtvzxnhfEgB2Bf1uKNMQyi3m1zj9iTm2kU518jtFDjmqv/i+u+jmQV9dR\nq3/y\r\n=wovl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF00XSBjLKEq/6OKqUAxuSE0F1NI7CpIMXwWAhWII8a7AiEAsPpTwFPV9R0HmYoWN4KM7R2FIApGTYPg4w/NwYG9eZA="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.2.0--dev-build-1641885423_1641885469721_0.5417775672652214"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0--dev-build-1641886326":{"name":"@agogpixel/phaser3-ts-utils","version":"0.2.0--dev-build-1641886326","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.22.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:/home/runner/work/phaser3-ts-utils/phaser3-ts-utils/agogpixel-phaser3-ts-utils-0.2.0--dev-build-1641886326.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[![Build & Test](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml)\n[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/kidthales/8783260504aa23bb1c4dd36f0ba3be01/raw/phaser3-ts-utils__heads_main.json)](https://agogpixel.github.io/phaser3-ts-utils/coverage)\n[![Version](https://img.shields.io/npm/v/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![Downloads/week](https://img.shields.io/npm/dw/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![License](https://img.shields.io/npm/l/@agogpixel/phaser3-ts-utils.svg)](https://github.com/agogpixel/phaser3-ts-utils/blob/master/LICENSE)\n\n<hr>\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities. Requires Phaser `v3.22+` as a peer dependency.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n4. If using Phaser `v3.60+` and need the `FX` component mixin, import & use directly:\n\n    ```typescript\n    import { FX } from '@agogpixel/phaser3-ts-utils/src/mixins/gameobjects/components/fx';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n##### CustomGameObject\n\nTo help streamline the [components](#components) example, a [CustomGameObject](./src/mixins/gameobjects/custom-gameobject.ts) factory function is now available:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Size, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyGameObject extends PhaserTSUtils.Mixins.GameObjects.CustomGameObject(\n    true, // Checks component mixin dependencies...\n    Alpha,\n    BlendMode,\n    Size,\n    Texture, // Size needs Crop, Texture, or TextureCrop...\n    Transform,\n    Visible\n) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-tarball               # Development stream.\nnpm run create-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-tarball -- NPM\nnpm run publish-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.2.0--dev-build-1641886326","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-DIp/AWulQT1b9WSy7B4Q45c9s7+4WHpzQBUGj/Twg3PF0doEao3DjjiQUP07wG5nIVIKfM05rA5UhaTsbWQwrg==","shasum":"445b2c56331e0ec34342a324dda25a73f833d5c1","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.2.0--dev-build-1641886326.tgz","fileCount":94,"unpackedSize":141429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3TKfCRA9TVsSAnZWagAAr4oP/2DYx9j0nJhy2aziYrtf\nfBaPPoI/iNC7G+IXaMo+YLg/N/bztl5p24BNlto6pe+mgy7jTDHxBYQXmtZA\nJBS73NjzdIptMZ//ppt4Sl9yVhLnLZmtGgT1qlwx90EZ01mhRpC3FqH8P3WR\n8l2L7/dr1z72ocA0IP26IcNr2ruvPKks0ri0BrJW4wLyPlQsVhs0EV7AkiBq\n5+vfYfg3StpRgt2lN/fYOYdBq33x8wYeyKZIfYQOUFmcZADy4ZgsOaHb8ynz\nE1BsYo7JFaO5FCVfnZBC9gccnbWqm4q1WdqQtXxHHI2cuaOM7VNhQVW2DGQN\nfhU1EaXhz58V0gXcyjN50aB+HTC24fsdnqB4ZXxNz0Ym+v0f6IinVy+A4S6/\njTeDJ7qAYlgkWob5Cjdy+A0S69lCXrxKlyabsiKMydsseAQD9hbTH9xiy0bB\n7Mh/VrSZcTZ4dkXzrBYyUqoj0jW/zffuLoo3xkb1WOTZPtWqbZecWENXt38x\nCPMIEdlC8/gN6vEkjuxkgUkPmfmIQ5K0CLzV4QnHeqOx8nGhcrSW/nU6T0yD\n2RqylUT7hozkecEDG19nL9zouunHP+krMZrxByhB1jEvsvNQROSaPugUN5Ad\n/rseufxF8x16UUxcAZzCINGc3Pop03nJ1FTBafv+3bSocwJSOtYBgkGx0q3u\nk5zj\r\n=m8Ih\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEcPnvcnz1V+graFuAKSYnc4Sqxhsf4yo852HXjRgqWYAiEA1EMkFB5xwBwMqgqMZJJvlIyNa7nqa7dP8tpJSQWHL1A="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.2.0--dev-build-1641886326_1641886367834_0.3681426678009505"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0":{"name":"@agogpixel/phaser3-ts-utils","version":"0.2.0","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.22.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:/home/runner/work/phaser3-ts-utils/phaser3-ts-utils/agogpixel-phaser3-ts-utils-0.2.0.tgz","_id":"@agogpixel/phaser3-ts-utils@0.2.0","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-8fLbQN87t7wiZ+aEE+3pFKtiXyz5awYL8/HpHDuZBa0TLYPov6OkoeSDvqPh1euqlvpfFRvaTWFTaFenQjaydQ==","shasum":"ca6de2a99af36100f64b39c13acb4a84abaf146a","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.2.0.tgz","fileCount":94,"unpackedSize":141407,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3TStCRA9TVsSAnZWagAASIQP/RiQGu1Ck6DUOjGG9V2C\nsNgc1fZ58X8QdkvgMNV5g3Nrxr7USp1TESW1FyaYjwkZAZqKFSd6IpSfk8+i\ngIRZ4JEdkmMixFI6foF5mUpS/0nsX4cmcqzMODPT4X6to3z6e/Stova3K5iF\nT7JmZ3FaPqRC1FQrZGII3QqjjdbEbKFZcpPd6CiTpX9HGfk4d+7ejQqngltx\nUUvRWpihKEIAUUQb0yMFIlWAL93zzz34cBFiqS9BuXwIlAQlYoIA6mLDWueY\nn/vVbtQMz9Rn4cGgCKOCMbcDprx/m3FhzbgqVX0fEKIcbSW9B3QywhK0zJgb\nOWd9d9OFwWK9/4Bzrw2Vvsldwub/iSVGgw193VeCxjzBPs8vDQQXMDTM4GAb\nkIxAT1vBDZyuk0m0cnQVba5BxtFxBn7qOEh5XCrzdi68zXD1x89bzU4MUAXe\nTYUXaQ4nHYVevF0wnpS4US1HvnKhQc/5PIiOsOZEJabxfJh6SJOGHUZFDYCq\nx3ShziRJ8wRyCGHxgJFKdxEeagZ/TXCKV5uPBqJWS5bSfEKBW9Q+OQtYp/DN\nWfh74AbkFVpihpOw/kTMZPOwdySiGe7U8F6A2Q7XBLkOIP9qIC1ysEFKhlgT\nOuaktyoLEUYVpCeT1EuYDAdOjGbCFUB6t3lrQgP2xh/6bofmfFYWuPxxy6cb\nW8w/\r\n=Fv2g\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDHDby+PHhkUW+P8JXzSv+BjMFKeGeizCqeXa8Q7Jk+cgIgJFDqk2sy+jA9tnRd1z9k8jN5Wf6mY1WVYib3CW7pkIA="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.2.0_1641886892975_0.2887408598108403"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.3.0--dev-build-1641887104":{"name":"@agogpixel/phaser3-ts-utils","version":"0.3.0--dev-build-1641887104","description":"Phaser 3 TypeScript utilities.","main":"./phaser-ts-utils.js","types":"./phaser-ts-utils.d.ts","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"license":"MIT","bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"homepage":"https://agogpixel.github.io/phaser3-ts-utils","peerDependencies":{"phaser":">=3.22.0","typescript":">=2.1.0"},"_resolved":"","_integrity":"","_from":"file:/home/runner/work/phaser3-ts-utils/phaser3-ts-utils/agogpixel-phaser3-ts-utils-0.3.0--dev-build-1641887104.tgz","readme":"# agogpixel/phaser3-ts-utils\n\n[![Build & Test](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/agogpixel/phaser3-ts-utils/actions/workflows/build-and-test.yml)\n[![Coverage](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/kidthales/8783260504aa23bb1c4dd36f0ba3be01/raw/phaser3-ts-utils__heads_main.json)](https://agogpixel.github.io/phaser3-ts-utils/coverage)\n[![Version](https://img.shields.io/npm/v/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![Downloads/week](https://img.shields.io/npm/dw/@agogpixel/phaser3-ts-utils.svg)](https://npmjs.org/package/@agogpixel/phaser3-ts-utils)\n[![License](https://img.shields.io/npm/l/@agogpixel/phaser3-ts-utils.svg)](https://github.com/agogpixel/phaser3-ts-utils/blob/master/LICENSE)\n\n<hr>\n\n[Phaser 3](https://github.com/photonstorm/phaser) [TypeScript](https://www.typescriptlang.org/) utilities. Requires Phaser `v3.22+` as a peer dependency.\n\n## Getting Started\n\n1. Install the package:\n\n    ```shell\n    npm install --save @agogpixel/phaser3-ts-utils\n    ```\n\n2. Add `@agogpixel/phaser3-ts-utils` to the [types entry](https://www.typescriptlang.org/tsconfig#types) in the appropriate `tsconfig` file.\n\n    ```json\n    {\n        \"compilerOptions\": {\n            \"types\": [\"@agogpixel/phaser3-ts-utils\"]\n        }\n    }\n    ```\n\n3. Import the library with global scope **once** (usually in an entry file):\n\n    ```typescript\n    import '@agogpixel/phaser3-ts-utils';\n    ```\n\n4. If using Phaser `v3.60+` and need the `FX` component mixin, import & use directly:\n\n    ```typescript\n    import { FX } from '@agogpixel/phaser3-ts-utils/src/mixins/gameobjects/components/fx';\n    ```\n\n## Usage\n\nThis library is intended to ease some use cases when developing with Phaser 3 & TypeScript.\n\n### Mixins\n\nSome Phaser functionality is leveraged by this library in the form of mixins that follow the [Mixins section](https://www.typescriptlang.org/docs/handbook/mixins.html) of the TypeScript handbook.\n\n#### Game Objects\n\nThe [Phaser Game Object](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObject.html) is the base class upon which various sprite & graphic classes a built; thus, they are one of the main API sufaces used in development.\n\n##### Components\n\nPhaser offers its own es5 compatible class extensions system that ties into how Game Objects mixin various [components](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.Components.html). The available namespace typings do not expose some of the core functions & variables that are used to accomplish this; while these are still available for use in implementing Game Objects 'from scratch', doing so with TypeScript can be awkward (ie. a lot of boilerplate to get the typing to correctly reflect the component properties available on the Game Object).\n\nUtilizing class mixins, we can continue to use the Game Object components provided by Phaser and get the appropriate typing on our resulting Game Object class:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\n// Make our own base game object type so we don't\n// accidentally pollute Phaser.GameObjects.GameObject prototype.\nclass MyBaseGameObject extends Phaser.GameObjects.GameObject {}\n\nclass MyGameObject extends Alpha(BlendMode(Texture(Transform(Visible(MyBaseGameObject))))) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n##### CustomGameObject\n\nTo help streamline the [components](#components) example, a [CustomGameObject](./src/mixins/gameobjects/custom-gameobject.ts) factory function is now available:\n\n```typescript\nconst { Alpha, BlendMode, Texture, Transform, Size, Visible } = PhaserTSUtils.Mixins.GameObjects.Components;\n\nclass MyGameObject extends PhaserTSUtils.Mixins.GameObjects.CustomGameObject(\n    true, // Checks component mixin dependencies...\n    Alpha,\n    BlendMode,\n    Size,\n    Texture, // Size needs Crop, Texture, or TextureCrop...\n    Transform,\n    Visible\n) {\n    // Custom Game Object implementation\n    // with mixed in component properties\n    // available in TypeScript...\n    doFoo() {\n        this.setAlpha(0.75);\n        // ...\n    }\n}\n```\n\n#### Scenes\n\nA [Phaser Scene](https://photonstorm.github.io/phaser3-docs/Phaser.Scene.html) is the main controller for managing game resources; thus, they are one of the main API sufaces used in development.\n\n##### Plugin API Mixin Factory\n\nPhaser provides a [plugin system](https://rexrainbow.github.io/phaser3-rex-notes/docs/site/pluginsystem/) that allows for extended functionality that can be optionally accessed through a scene. In addition to a plugin being available via a _mapping_, it can extend the Game Object [factory](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectFactory.html) (`add`) & [creator](https://photonstorm.github.io/phaser3-docs/Phaser.GameObjects.GameObjectCreator.html) (`make`) scene properties as well as the [loader plugin](https://photonstorm.github.io/phaser3-docs/Phaser.Loader.LoaderPlugin.html) (`load`) scene property.\n\nUtilizing a class mixin factory, we can create a mixin that coerces a given Scene class such that a plugin's injected API is available on the resulting Scene type:\n\n```typescript\n////////////////////\n// Plugins\n////////////////////\n\nclass GlobalPlugin extends Phaser.Plugins.BasePlugin {\n    constructor(pluginManager: Phaser.Plugins.PluginManager) {\n        super(pluginManager);\n\n        pluginManager.registerGameObject(\n            'globalA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'globalB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType('globalA', function (/* Args... */) {\n            /* Implementation... */\n        });\n\n        pluginManager.registerFileType('globalB', function (/* Args... */) {\n            /* Implementation... */\n        });\n    }\n\n    globalA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    globalB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\nclass ScenePlugin extends Phaser.Plugins.ScenePlugin {\n    constructor(scene: Phaser.Scene, pluginManager: Phaser.Plugins.PluginManager, pluginKey: string) {\n        super(scene, pluginManager, pluginKey);\n\n        pluginManager.registerGameObject(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerGameObject(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            function (/* Args... */) {\n                /* Implementation... */\n            }\n        );\n\n        pluginManager.registerFileType(\n            'sceneA',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n\n        pluginManager.registerFileType(\n            'sceneB',\n            function (/* Args... */) {\n                /* Implementation... */\n            },\n            scene\n        );\n    }\n\n    sceneA(/* Args... */) {\n        /* Implementation... */\n    }\n\n    sceneB(/* Args... */) {\n        /* Implementation... */\n    }\n}\n\n////////////////////\n// Mixins\n////////////////////\n\nconst createMixin = PhaserTSUtils.Mixins.Scenes.createPluginApiMixin;\n\nconst GlobalPluginMixin = createMixin<\n    GlobalPlugin,\n    'globalA' | 'globalB',\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        globalA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        globalB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { globalA: (/* Args... */) => Phaser.Loader.LoaderPlugin; globalB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\nconst ScenePluginMixin = createMixin<\n    ScenePlugin,\n    'sceneA' | 'sceneB',\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    {\n        sceneA: (/* Args... */) => Phaser.GameObjects.GameObject;\n        sceneB: (/* Args... */) => Phaser.GameObjects.GameObject;\n    },\n    { sceneA: (/* Args... */) => Phaser.Loader.LoaderPlugin; sceneB: (/* Args... */) => Phaser.Loader.LoaderPlugin }\n>();\n\n////////////////////\n// Scenes\n////////////////////\n\n// Make our own base scene type so we don't\n// accidentally pollute Phaser.Scene prototype.\nclass MyBaseScene extends Phaser.Scene {}\n\n// Apply our mixins with with corresponding plugin\n// scene mappings (see below).\nclass MyScene extends GlobalPluginMixin('myGlobalPlugin', ScenePluginMixin('myScenePlugin', MyBaseScene)) {\n    preload() {\n        // Custom loader file type callbacks...\n        this.load.globalA(/* Args... */);\n        this.load.globalB(/* Args... */);\n        this.load.sceneA(/* Args... */);\n        this.load.sceneB(/* Args... */);\n    }\n\n    create() {\n        // Global plugin API...\n        this.myGlobalPlugin.globalA(/* Args... */);\n        this.myGlobalPlugin.globalB(/* Args... */);\n\n        // Scene plugin API...\n        this.myScenePlugin.sceneA(/* Args... */);\n        this.myScenePlugin.sceneB(/* Args... */);\n\n        // Fully exposed scene plugin API...\n        this.sys.myScenePlugin.sceneA(/* Args... */);\n        this.sys.myScenePlugin.sceneB(/* Args... */);\n        this.sys.myScenePlugin.destroy();\n\n        // Game Object factory...\n        this.add.globalA(/* Args... */);\n        this.add.globalB(/* Args... */);\n        this.add.sceneA(/* Args... */);\n        this.add.sceneB(/* Args... */);\n\n        // Game Object creator...\n        this.make.globalA(/* Args... */);\n        this.make.globalB(/* Args... */);\n        this.make.sceneA(/* Args... */);\n        this.make.sceneB(/* Args... */);\n    }\n}\n\nnew Phaser.Game({\n    // ...\n    plugins: {\n        // Register our plugins with scene mappings\n        // (used with mixins in scene definition, see above).\n        global: [{ key: 'globalPlugin', plugin: GlobalPlugin, mapping: 'myGlobalPlugin', start: true }],\n        scene: [{ key: 'scenePlugin', plugin: ScenePlugin, mapping: 'myScenePlugin', start: true }]\n    },\n    scene: [MyScene]\n    // ...\n});\n```\n\n## Development\n\nLive development with `jest` watch mode:\n\n```shell\nnpm start\n```\n\nLint files:\n\n```shell\nnpm run lint      # Report issues.\nnpm run lint:fix  # Fix issues.\n```\n\nUnit test & create coverage report in `coverage`:\n\n```shell\nnpm test\n```\n\nBuild consumable `.js`, `.js.map`, & `.d.ts` files to `dist`; prepare for further packaging:\n\n```shell\nnpm run build\n```\n\nSmoke test build:\n\n```shell\nnpm run smoke-test\n```\n\nCreate package tarball from `dist`:\n\n```shell\nnpm run create-tarball               # Development stream.\nnpm run create-tarball -- --release  # Release stream.\n```\n\nPublish package tarball to registry (some assembly required):\n\n```shell\nnpm run publish-tarball -- NPM\nnpm run publish-tarball -- GitHub\n```\n\n## Package Distribution\n\nTag for stable release with highest version: `latest`\n\nDevelopment release tag (tracks `main` branch): `next`\n\nAdditional distribution tags include:\n\n|                                       Distribution                                       |       Release       |  Pre-Release  |\n| :--------------------------------------------------------------------------------------: | :-----------------: | :-----------: |\n|       Major versions with highest minor, patch (and possibly pre-release) version.       |     `vX~latest`     |   `vX~next`   |\n|       Major, minor versions with highest patch (and possibly pre-release) version.       |    `vX.Y~latest`    |  `vX.Y~next`  |\n| Major, minor, patch versions - catch all for releases that don't match any of the above. | ~~`vX.Y.Z~latest`~~ | `vX.Y.Z~next` |\n\n## License\n\nLicensed under the [MIT License](./LICENSE).\n","readmeFilename":"README.md","_id":"@agogpixel/phaser3-ts-utils@0.3.0--dev-build-1641887104","_nodeVersion":"14.18.2","_npmVersion":"6.14.15","dist":{"integrity":"sha512-Xl8zSFyzuGdWXTsV0iONEgGbTA/tQs6xMmjzXQtXgkZ2F8Yk2veNGKaIwbFCbYwLOSuY0TcAp3SiiIjj/W/i2g==","shasum":"6fc9eab6d61b2f0502031637cceb0f2629e2c22e","tarball":"https://registry.npmjs.org/@agogpixel/phaser3-ts-utils/-/phaser3-ts-utils-0.3.0--dev-build-1641887104.tgz","fileCount":94,"unpackedSize":141429,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3TWlCRA9TVsSAnZWagAAt6gQAJ+aKQbw62GE6eeteQBi\n5c4E2IgU43lfZI1hcG+zWzvIseBgdgiU0of7S9u0/r9bVagdidYb4UeGSKk1\nOoWwphN9lsiDc2hk2c0Xxe/9EqsvzKUHH4wAAUWysTY+ERor+TmaGbwzkv+X\n6xqOG+TlIJCsO1YmRWqocSxuNT8MsH+t0pJNB/kLPXUSAI8WFeFOBjdv+/lF\nQVz1e89iiRpg+Daiy9gHg9jaFJRPoIUPXXX/a5gvPbDzAM81EIinvyIQGn48\nhGWSx1Jzewm1J2wTkUMMj0Erfu8l2S3PmNOprxo7zHaK1634U/89Rd9DWIBd\nCf86MZn1juFk316mqL+COfQpHgr4YaY1skpb7w1tdUgKTLlHy+ECdxilcYl2\nJEEwN9vqn6jrAkieO8498/e1q18v5vqSWplWtm5zzj7GULqJT7YoGD/PHAuC\nYXnBGbHxiu71EyfpcVvez2YXwxWPqvsGktciKC9KxNV/+8v3vFwtoTLpk3ap\nnhdVF9qr8BPdBq2xkbNVdOEkon++izheFB1afl8AKA782zNCLsOVYTuLXj4p\nZpeabNajXwtsYQyaPzB1n8QgXjlzrVhFnP97FVc3eNm2EHvGubrDMiD/4ALA\nD/vKl5QVehRzmj/bTZnj0UiuRnfYkCmR7o+Y30U7L1Bc1nzEQS7mbeILlNNM\nB1cA\r\n=C0d+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEYNQK3CQbphJhXIPc4sedLECXT4i4oQNHkBggvWa9ClAiAj/VI/l7BmVAIxrlyze/Cg0xKA+0A7KlwlectHSZTT2A=="}]},"_npmUser":{"name":"kidthales","email":"tristan@agogpixel.com"},"directories":{},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/phaser3-ts-utils_0.3.0--dev-build-1641887104_1641887141687_0.33961802754634296"},"_hasShrinkwrap":false,"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"time":{"created":"2021-10-29T01:17:47.408Z","0.0.0-dev.1635470216":"2021-10-29T01:17:47.651Z","modified":"2024-04-28T06:34:57.243Z","0.0.0-dev.1635470967":"2021-10-29T01:30:11.491Z","0.0.0-dev.1635472119":"2021-10-29T01:49:23.239Z","0.0.0-dev.1635473332":"2021-10-29T02:09:31.364Z","0.0.0-dev.1635474186":"2021-10-29T02:23:49.587Z","0.0.0-dev.1635478436":"2021-10-29T03:34:36.258Z","0.0.0-dev.1635478860":"2021-10-29T03:41:48.714Z","0.0.0-dev.1635530738":"2021-10-29T18:06:25.001Z","0.0.0-dev.1635784565":"2021-11-01T16:36:56.364Z","0.1.0-alpha-dev.1635784994":"2021-11-01T16:43:52.514Z","0.1.0-alpha-dev.1635785319":"2021-11-01T16:49:49.499Z","0.1.0-alpha.1-dev.1635786189":"2021-11-01T17:04:02.142Z","0.1.0-alpha.1-dev.1635786290":"2021-11-01T17:05:39.309Z","0.1.0-alpha.2-dev.1635786636":"2021-11-01T17:11:27.633Z","0.1.0-alpha.2-dev.1635786738":"2021-11-01T17:13:14.594Z","0.1.0-alpha.3-dev.1635787405":"2021-11-01T17:24:11.648Z","0.1.0-alpha.3":"2021-11-01T17:25:27.929Z","0.1.0-alpha.4-dev.1635800373":"2021-11-01T21:00:15.766Z","0.1.0-alpha.4":"2021-11-01T21:01:29.606Z","0.1.0-dev.1635801170":"2021-11-01T21:13:26.766Z","0.1.0":"2021-11-01T21:15:19.475Z","0.2.0-alpha--dev-build-1638731494":"2021-12-05T19:12:13.290Z","0.2.0-alpha--dev-build-1638731929":"2021-12-05T19:19:33.918Z","0.2.0-alpha--dev-build-1638952932":"2021-12-08T08:42:54.282Z","0.2.0-alpha--dev-build-1639114159":"2021-12-10T05:29:58.580Z","0.2.0-alpha--dev-build-1639121114":"2021-12-10T07:25:57.551Z","0.2.0-alpha--dev-build-1639454098":"2021-12-14T03:55:35.913Z","0.2.0--dev-build-1641771218":"2022-01-09T23:34:22.611Z","0.2.0--dev-build-1641885423":"2022-01-11T07:17:49.891Z","0.2.0--dev-build-1641886326":"2022-01-11T07:32:47.979Z","0.2.0":"2022-01-11T07:41:33.134Z","0.3.0--dev-build-1641887104":"2022-01-11T07:45:41.840Z"},"maintainers":[{"name":"kidthales","email":"tristan@agogpixel.com"}],"description":"Phaser 3 TypeScript utilities.","homepage":"https://agogpixel.github.io/phaser3-ts-utils","repository":{"type":"git","url":"git+https://github.com/agogpixel/phaser3-ts-utils.git"},"author":{"name":"kidthales","email":"kidthales@agogpixel.com"},"bugs":{"url":"https://github.com/agogpixel/phaser3-ts-utils/issues"},"license":"MIT","readme":"","readmeFilename":""}