davidjerleke / embla-carousel

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

Wrong `embla-carousel-svelte` init event types #464

Closed davidjerleke closed 1 year ago

davidjerleke commented 1 year ago

Bug is related to

Embla Carousel version

Describe the bug

Argument of type '{ class: string; "on:init": (event: CustomEvent<EmblaCarouselType>) => void; }' is not assignable to parameter of type 'Omit<Omit<HTMLAttributes<HTMLDivElement>

The problem can be solved by adding the following to a d.ts file:

declare namespace svelteHTML {
  interface HTMLAttributes<T> {
    'on:emblaInit'?: (event: any) => any
  }
}

...which is very hacky and not desired.

Expected behavior

davidjerleke commented 1 year ago

Will be released with v8.0.0-rc02.