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

fix: nullable return types of HTMLElement #257

Merged
merged 1 commit into from Dec 21, 2023
Merged

fix: nullable return types of HTMLElement #257

merged 1 commit into from Dec 21, 2023

Conversation

wdzeng
Copy link

@wdzeng wdzeng commented Nov 18, 2023

Hi,

This is the greatest tool I've ever found. But some types flaw with TypeScript.

Following methods in HTMLElement can return null, but do not declare correct return types.

  • getElementById
  • querySelector (in README only)
  • nextSibling
  • nextElementSibling
  • previousSibling
  • previousElementSibling

Following methods in HTMLElement can return undefined, but do not declare correct return types. Actually these should follow the web API and return null, but I did not change them to prevent breaking the backward compability.

  • getAttribute (in README and jsdocs only)
  • firstChild
  • lastChild

Fix that some methods of HTMLElement can return `null` or `undefined`.
@taoqf taoqf merged commit 0313608 into taoqf:main Dec 21, 2023
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.

None yet

2 participants