Open kubukoz opened 1 month ago
Hey @kubukoz!
Here’s what I’m thinking:
Type Mapping: Create a mapping system that associates input types with their respective TypeScript types, allowing for seamless type inference in onChange events.
Documentation Enhancements: I could also add examples in the documentation to demonstrate how to utilize this feature effectively, making it easier for developers to adopt.
Let me know if you’d like to discuss this further or if there are any specific requirements you have in mind!
100% a bot response.
Haha, I can see why it feels like a bot response! But honestly, what specific input types do you think we should focus on first?
I think getting this to work with the generic syntax type := "file"
may be more challenging ... but maybe we could add a custom builder to the DSL e.g. input["file"](...)
. I think we'd also need something like the changes I suggested https://github.com/armanbilge/calico/issues/180, where attributes and events can be typed specifically according to the element type. This will help us better support Web Components.
It would be amazing to have typed events for inputs. This is the tweet.
like, maybe
type := "file"
can carry a singleton type of"file"
and this can somehow be used to derive a more specific type inonChange
, like in typescript?