Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#308@minor: Implement NamedNodeMap and use it for Element.attributes #626

Merged
merged 6 commits into from Oct 18, 2022

Conversation

jledentu
Copy link
Contributor

@jledentu jledentu commented Oct 18, 2022

Hi,

This PR implements the NamedNodeMap interface and makes it available in Window. Element.attributes now returns a NamedNodeMap.

Closes #308

capricorn86
capricorn86 previously approved these changes Oct 18, 2022
Copy link
Owner

@capricorn86 capricorn86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution @jledentu! It looks really nice ⭐

I have made some adjustment, so that the interface looks more like the built in Typescript DOM interface. Unfortunately Typescirpt dosn't handle both [k: string] and other properties and methods at the same time, but it also makes sense in a way and this is how they have done it.

I also added some tests.

@capricorn86 capricorn86 merged commit 42c92a6 into capricorn86:master Oct 18, 2022
@jledentu jledentu deleted the namednodemap branch October 19, 2022 07:32
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.

Elment.attributes does not implement the NamedNodeMap interface
3 participants