Hello,
Currently I am upgrading a project from version 4.2 to latest version (5.17 at this moment).
I am noticing a mismatch between type definition that wasn’t happening on 4.2 version.
I am using a PointerInfo object to get info related to which resource did the user used (mouse, touch, pen). We have different approaches depending upon the action. Below is just a simplified function to show here the situation happens
// simplified code
function example(pointerInfo: PointerInfo) {
if (pointerInfo.event.pointerType !== 'touch') {
return;
}
}
On version 4.2, that works properly (even thought it has a incorrectly inference to type any).
At the latest version, I receive this compilation error:
Property ‘pointerType’ does not exist on type ‘IMouseEvent’.
On latest version, event is a IMouseEvent:
But as it is a PointerEvent it should be IPointerEvent.
It is also stated on the class description about its purpose
Native friendly interface for PointerEvent Object
Also, as some answers from the forum, it is the proper way to get the type of the pointer, like this answer: Is there any way to know whether an onPointerObservable is touch input or mouse input?