Skip to content

fix: getElements* methods return LiveNodeList<Element>#734

Merged
karfau merged 2 commits into
masterfrom
fix-731
Sep 15, 2024
Merged

fix: getElements* methods return LiveNodeList<Element>#734
karfau merged 2 commits into
masterfrom
fix-731

Conversation

@karfau

@karfau karfau commented Sep 15, 2024

Copy link
Copy Markdown
Member
  • NodeList and LiveNodeList are now generic, with a default of Node when no type argument is passed.
  • Node.getElements* and Document.getElements* return LiveNodeList<Element>
  • NodeList[number] is now typed as T instead of T | undefined, which of course only works for indexes < length

Fixes #731

- NodeList and LiveNodeList are now generic, with a default of `Node` when no type argument is passed.
- `Node.getElements*` and `Document.getElements*` return `LiveNodeList<Element>`
- `NodeList[number]` is now typed as `T` instead of `T | undefined`,
  which of course only works for indexes < `length`

Fixes #731
@karfau karfau added the types Anything regarding Typescript label Sep 15, 2024
@karfau karfau added this to the 0.9.3 milestone Sep 15, 2024
@karfau karfau requested a review from Ponynjaa September 15, 2024 04:18
@codecov

codecov Bot commented Sep 15, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.36%. Comparing base (7f506e7) to head (eacdd16).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #734   +/-   ##
=======================================
  Coverage   94.36%   94.36%           
=======================================
  Files           8        8           
  Lines        2094     2094           
  Branches      538      538           
=======================================
  Hits         1976     1976           
  Misses        118      118           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@karfau karfau enabled auto-merge (squash) September 15, 2024 05:51
@karfau karfau disabled auto-merge September 15, 2024 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

types Anything regarding Typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getElementsByTagName returns wrong type in 0.9.2

1 participant