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

Wrong type defitiion #108

Open
satoshionoda opened this issue Oct 7, 2022 · 0 comments
Open

Wrong type defitiion #108

satoshionoda opened this issue Oct 7, 2022 · 0 comments

Comments

@satoshionoda
Copy link

https://github.com/geosigno/simpleParallax.js/blob/master/index.d.ts#L15

constructor(images: Element | Element[] | HTMLCollectionOf<Element>, settings?: IParallaxSettings);

Although the type definition indicates the constructor accepts Element[], when we implement actual code, runtime error occurs.
https://stackblitz.com/edit/typescript-uum318?file=index.ts

Besides, the document tells the constructor accepts a return value of document.querySelectorAll but the type is actually NodeListOf<Element> and type error occurs.
https://stackblitz.com/edit/typescript-uyqfmc?file=index.ts

A quick fix will be removing Element[] and adding NodeListOf<Element> at the constructor definition but it would be great if the constructor actually accepts Element[].

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

No branches or pull requests

1 participant