Skip to content

window.PointerEvent is undefined #18756

Closed
@appsforartists

Description

@appsforartists

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

No one assigned

    Labels

    Working as IntendedThe behavior described is the intended behavior; this is not a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions