microsoft / microsoft/TypeScript

Request to change currentTarget in Event interface for lib.d.ts

Open
#299 39 comments 89 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Domain: lib.d.ts Help Wanted Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

When using the Event interface from lib.d.ts, and attaching a listener, the callback will get an object of type Event. However, the Event's currentTarget property is of type EventTarget (whereas it's should be of type Element/HTMLElement).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin with the Event interface in lib.d.ts and inspect the currentTarget declaration and related DOM typings. Determine whether the requested Element/HTMLElement type is compatible with the existing interface design, then verify the declaration change with the repository's type-checking tests. Done means currentTarget has the intended type without breaking related Event usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.