title: Svelte Components as Object Properties
body: <p>I want to accept a component as a prop.</p>
  <pre class="lang-js prettyprint-override"><code>import AComponent from './AComponent.svelte';
  
  type MyType = {
    [key: string]: any; // just an example
  }
  
  type IWantToAcceptAComponent&lt;T&gt; = {
    component: SvelteComponentTyped&lt;{ record: T }&gt;;
  }
  
  const componentPropObject: IWantToAcceptAComponent&lt;MyType&gt; = {
    component: AComponent // error here
  }
  </code></pre>
  <pre><code>Error: Type 'typeof AComponent__SvelteComponent_' is missing the following properties from type 
  'SvelteComponentTyped&lt;{ record: MyType; }&gt;': $set, $on, $destroy, $$prop_def, and 5 
  more.ts(2740)
  </code></pre>
  <p>I figured it might be that the typedef should be:</p>
  <pre class="lang-js prettyprint-override"><code>type IWantToAcceptAComponent&lt;T&gt; = {
    component: typeof SvelteComponentTyped&lt;{ record: T }&gt;;
  }
  </code></pre>
  <p>But that causes even weirder errors.</p>
  <p>It's fairly important that this typing is explicit, as it's supposed to be part of an exported interface for users.</p>