davidjerleke / embla-carousel

A lightweight carousel library with fluid motion and great swipe precision.
https://www.embla-carousel.com
MIT License
5.4k stars 166 forks source link

Fix scrollTo signature on exported type #586

Closed hill closed 8 months ago

hill commented 9 months ago

Hello!

The signature of scrollTo includes an optional direction parameter, however the type exposed by EmblaCarouselType excludes this parameter, leading me to extend the type definition in my own project in order to make use of it. It would be more convenient if it was exposed here in this type.

scrollTo signature:

scrollTo(index: number, jump?: boolean, direction?: number): void

Let me know if you have concerns about this and thanks for your work on Embla :)

davidjerleke commented 9 months ago

Hi @hill,

Thanks for noticing 🙂. I left that out on purpose because it's used internally and I figured that devs will get confused about how it works:

We can add your type fix but if you also want to add it to the scrollTo() reference, please also take some time to explain how it works here. Let me know if you want to do that.

Thank you for your contribution!

Best, David

davidjerleke commented 9 months ago

@hill let me know if you're interested in pursuing this when you've read my response.

davidjerleke commented 9 months ago

@hill last call. I will delete this PR if you don't respond soon.