Skip to content

Conversation

@karfau
Copy link
Member

@karfau karfau commented Sep 15, 2024

  • 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
Copy link

codecov bot commented Sep 15, 2024

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
@karfau karfau merged commit ff15902 into master Sep 15, 2024
38 checks passed
@karfau karfau deleted the fix-731 branch September 15, 2024 16:39
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