type EventMap = { [event: string]: Event; }; type EventsToReactProps = { [K in keyof ElementEvents as `on${string & K}`]?: (event: ElementEvents[K]) => void; }; /** * Utility type to define props for custom elements (and React components wrapping them). */ export type CustomElementProps = React.DetailedHTMLProps, Element> & ElementHTMLAttributes & EventsToReactProps; export {};