Skip to content

Conversation

voxpelli
Copy link
Contributor

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
Contributor 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

@voxpelli
Copy link
Contributor Author

@saschanaz Weird error: "HttpError: Repository rule violations found New changes require approval from someone other than the last pusher. "

@jakebailey
Copy link
Member

It's unfortunately normal, the infra was written before new rules required approval from someone with merge perms (defeating the purpose more or less).

I wasn't sure if the comment was an actual ask to merge or not, but I can just approve it.

@saschanaz
Copy link
Contributor

LGTM

@github-actions github-actions bot merged commit c059d14 into microsoft:main Sep 17, 2025
7 checks passed
Copy link
Contributor

Merging because @saschanaz is a code-owner of all the changes - thanks!

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.

3 participants