Skip to content

Wrong type defitiion #108

@satoshionoda

Description

@satoshionoda

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

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions