-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
Description
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?
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug