Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript: PipelineConfig should accept constructors #6999

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sjml
Copy link

@sjml sjml commented Jan 8, 2025

This PR (delete as applicable)

  • Fixes a bug

Describe the changes below:

According to the documentation, the pipeline field of the Config object is:

/**
 * An object mapping WebGL names to WebGLPipeline classes. These should be class constructors, not instances.
 */

At some point the type definition of PipelineConfig was updated to Phaser.Renderer.WebGL.WebGLPipeline[] | {[key: string]: typeof Phaser.Renderer.WebGL.WebGLPipeline}, allowing it to also take an array, but that's an array of instances, not constructors. I'm not sure if allowing instances was intentional, but either way, it should also allow constructors. This PR preserves the old typing but adds an additional option for constructors.

(It looks like passing the constructor works fine, so this is just an omission in the typing.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant