davidjerleke / embla-carousel

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

Typing of Embla Plugins #335

Closed xiel closed 2 years ago

xiel commented 2 years ago

Cool side effect, the typescript auto suggestion for e.g. plugins().autoHeight only appears once the plugin was installed & imported by the user.

davidjerleke commented 2 years ago

Amazing @xiel ⭐!

This is exactly what I wanted to achieve and I didn't know it was possible with TypeScript. This approach is great because as you already mention:

...we can keep the embla core independent of all external plugins

With this problem out of the way we're very close to a stable v7 release 🙂. I've released this PR with v7.0.0-rc04.

Massive thanks for this 🙏. Let me know if I can do anything for you.

Cheers, David