Open
Description
Describe the problem
As explained in #14810 and #9241, using $props rune is inconvenient with TypeScript.
Describe the proposed solution
There is already a typed $bindable
rune that can be used for inline types. We could introduce a $typed
(non-bindable) rune to be able to specify fallback value and type at the declaration site of the prop, not separately:
let {
size = $typed<'sm' | 'md' | 'lg'>('md'), // optional
color = $typed<Color>(), // required
value = $bindable<string>()
} = $props()
instead of
let {
size = 'md',
color,
value = $bindable()
}: {
size?: 'sm' | 'md' | 'lg',
color: Color,
value: string
} = $props()
Importance
would make my life easier