title: Using untyped javascript modules with Typescript: Property does not exist on type 'unknown'
body: <p>I'm working on a new Svelte project using Typescript. I'm also using the svelte-mui component module which was not written in Typescript and does not have a types file. Whenever I try to use a component, VSCode highlights the component with annoying red squiggles because Typescript doesn't know about the svelte properties that are a part of the object. The project builds and runs fine, but I would like to figure out how to tell Typescript what type they are. I know all the components extend <code>SvelteComponent</code> but I don't know how to tell Typescript that.</p>
  <pre><code>&lt;script&gt;
  import Button from 'svelte-mui';
  &lt;/script&gt;
  
  &lt;Button on:click={() =&gt; {console.log('Clicked')}}&gt;My Button&lt;/Button&gt;
  </code></pre>
  <p>The last line will be highlighted as an error in the editor.</p>
  <p>How do I tell Typescript that Button extends SvelteComponent?</p>
  <p>Edit: @tmdesigned</p>
  <p>I followed the instructions in the link provided by tmdesigned below, but no dice. I'm new to Typescript so maybe I'm still doing something wrong. I ended up with a file located at</p>
  <p><code>types\svelte-mui\index.d.ts</code></p>
  <p>that contains</p>
  <pre><code>declare module 'svelte-mui' {
      import { SvelteComponent } from &quot;svelte/internal&quot;;
  
      class Button extends SvelteComponent{}
  
      export { Button }
  }
  </code></pre>
  <p>but the error still persists.</p>