carbon-design-system / carbon-components-svelte

Svelte implementation of the Carbon Design System
https://svelte.carbondesignsystem.com
Apache License 2.0
2.71k stars 261 forks source link

fix(types): improve `e.detail` type for dispatched events #1907

Closed metonym closed 9 months ago

metonym commented 9 months ago

Some dispatched events do not have an explicit type annotation, and thus default to CustomEvent<any>.

This PR enhances the DX by explicitly annotating the type.

<Slider
  on:change="{(e) => {
    console.log(e.detail); // number
  }}"
/>
metonym commented 9 months ago

Fixed in v0.82.9