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 · 1 comment
Open

Wrong type defitiion #108

satoshionoda opened this issue Oct 7, 2022 · 1 comment
Assignees

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[].

@geosigno
Copy link
Owner

The types for the vanilla version have been removed with the 6.0.0., React version has its own types.
Will add them back with the fix of the issue you described.

@geosigno geosigno self-assigned this Jun 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants