Skip to content

Cannot find name 'KeyboardEvent' #9814

@davegomez

Description

@davegomez

This is my first time with Deno, and I started writing a small library that I usually use in many projects I own.

The problem I have is Deno does not recognize some TypeScript types. This particular case is KeyboardEvent, and I can't find any hint of how I could solve this issue.

This is the error message I'm getting:

error: TS2304 [ERROR]: Cannot find name 'KeyboardEvent'.
const isEnter = ({ code, key, keyCode, type }: KeyboardEvent): boolean =>
                                               ~~~~~~~~~~~~~
    at https://raw.githubusercontent.com/davegomez/is-keyboard-event/main/src/is-enter.ts:3:48

I know the type exists because TypeScript compiles the file correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions