Skip to content

Conversation

voxpelli
Copy link

Adds TypeScript overloads for the matches method.

The overloads leverages the HTMLElementTagNameMap similar to how overloads are handled for methods like querySelector, but here for type narrowing by making it eg. this is HTMLElementTagNameMap[K].

Tests have been run locally and are passing.

Changes:

  • Added a new function emitMatchesOverloads to generate overload signatures for the matches method.
  • Updated the main emitter logic to call emitMatchesOverloads when processing the matches method.

Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged.

@voxpelli
Copy link
Author

@microsoft-github-policy-service agree company="040 Internet AB"

@saschanaz
Copy link
Contributor

LGTM for now, but I think this should ultimately move to a patch rather than in the emitter itself.\

Copy link
Contributor

There was an issue merging, maybe try again saschanaz. Details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants