The docs suggest that it should be possible to create a RandomZone from a shape, e.g.
const emitZone = new RandomZone(new Ellipse(0, 0, 40, 30))
However typescript 6 doesn’t like it, giving the error
Argument of type 'Ellipse' is not assignable to parameter of type 'RandomZoneSource'.
Types of property 'getRandomPoint' are incompatible.
Type '<O extends Phaser.Math.Vector2>(vec?: Vector2 | undefined) => O' is not assignable to type 'RandomZoneSourceCallback'.
Types of parameters 'vec' and 'point' are incompatible.
Type 'Vector2Like' is missing the following properties from type 'Vector2': clone, copy, setFromObject, set, and 35 more.
which is a long winded way of saying that Ellipse has getRandomPoint<O extends Phaser.Math.Vector2>(vec?: Phaser.Math.Vector2): O; and RandomZoneSourceCallback is effectively getRandomPoint(point: Phaser.Types.Math.Vector2Like): void. It seems that Vector2Like and Vector2 aren’t interchangeable here.
Is there any way to write this so that typescript doesn’t complain - or should the type signature of one or other of those functions be changed?