Describe the problem
How can I create a function that takes a Component that has at least the foo prop?
/*
* @param modal: any Component that has at least the `foo` prop
*/
function showModal(modal: Component<{foo: string; [key: string]: any}>) {
// do some things and use `mount`
}
// gives errors if SimpleDialog has any more props than `foo`:
showModal(SimpleDialog)
Repl (doesn't show ts-errors)
REPL
I have also tried attempts at using extends for the type, to no avail.
Importance
i cannot use svelte without it