import type { SvelteComponentDev } from "svelte/internal"; export interface DynamicSvelteComponent< T extends typeof SvelteComponentDev = typeof SvelteComponentDev > { component: T; [k: string]: unknown; } export const dynamicComponent = < Comp extends typeof SvelteComponentDev, DefaultProps = NonNullable[0]["props"]> >( component: Comp ) => (props: Props): DynamicSvelteComponent & Props => { return { component, ...props }; };