TypeScript Version: 2.4.1
Code
if (window.PointerEvent) {
Expected behavior:
This should work. It is a valid feature detection test.
Actual behavior:
error TS2339: Property 'PointerEvent' does not exist on type 'Window'.
Notes
It appears that PointerEvent is defined on dom.generated.d.ts with declare var PointerEvent. Should Window be augmented with that type, or is there a more idiomatic way to check for the presence of a global definition in TypeScript?
TypeScript Version: 2.4.1
Code
Expected behavior:
This should work. It is a valid feature detection test.
Actual behavior:
Notes
It appears that
PointerEventis defined ondom.generated.d.tswithdeclare var PointerEvent. ShouldWindowbe augmented with that type, or is there a more idiomatic way to check for the presence of a global definition in TypeScript?