phaser
phaser copied to clipboard
typescript type declaration error
Version
- Phaser Version: 3.52.0+
- Operating system:
- Browser:
Description
I found some problems when customizing the rendering pipeline.
type RenderConfig = {
pipline?: Phaser.Types.Core.PipelineConfig;
}
typescript type declaration error, must be pipeline ?
type PipelineConfig = {
/**
* The name of the pipeline. Must be unique within the Pipeline Manager.
*/
name: string;
/**
* The pipeline class. This should be a constructable object, **not** an instance of a class.
*/
pipeline: Phaser.Renderer.WebGL.WebGLPipeline;
};
type PipelineConfig = { [key:string]: Phaser.Renderer.WebGL.WebGLPipeline }
Maybe use typeof?
Or an array of WebGLPipeline, i.e.
type PipelineConfig = Phaser.Renderer.WebGL.WebGLPipeline[];
seems working, too.
For example, in this demo, line 43.
pipeline: { 'ColorPostFX': ColorPostFX, 'BendPostFX': BendPostFX, 'HueRotate': HueRotate }
and this works too.
pipeline: [ColorPostFX, BendPostFX, HueRotate ]