web-component-base icon indicating copy to clipboard operation
web-component-base copied to clipboard

feat: infer types for `WebComponent.props` properties

Open ayoayco opened this issue 1 year ago • 0 comments

We know the types from the initialization of static props and use this to populate an internal typeMap that is used to restore the type of properties after a full reactivity loop--when the HTML attribute changes to trigger a render, the props are serialized and needs to be restored before assigning to the proxy props

The current problem is that we statically type WebComponent.props to {[key: string]: any} -- is there a way to infer the type from the initialization too?

ayoayco avatar Dec 12 '23 19:12 ayoayco