carbon-design-system / sveld

Generate TypeScript definitions for your Svelte components
https://sveld.onrender.com
Apache License 2.0
404 stars 21 forks source link

fix(component-parser): dispatched event type without detail should default to `null` #86

Closed metonym closed 2 years ago

metonym commented 2 years ago

Currently, a dispatched event without a second argument will produce the type CustomEvent<any>.

dispatch("event");

It can be more specific; the actual type is null.

- event: CustomEvent<any>;
+ event: CustomEvent<null>;