title: Converting typescript to javascript
body: <p>Is there currently any converters online that could convert ts to js? I would like to use the components from <a href="https://github.com/stimulus-components/stimulus-components" rel="nofollow noreferrer">here</a>, but they're all written in ts and my rails app doesn't support it.</p>
  <p>for example this file</p>
  <pre><code>import { Controller } from &quot;@hotwired/stimulus&quot;
  import { useTransition } from 'stimulus-use/dist/use-transition'
  
  export default class extends Controller {
    menuTarget: HTMLElement
    toggleTransition: (event?: Event) =&gt; void
    leave: (event?: Event) =&gt; void
    transitioned: false
  
    static targets = ['menu']
  
    connect (): void {
      useTransition(this, {
        element: this.menuTarget
      })
    }
  
    toggle (): void {
      this.toggleTransition()
    }
  
    hide (event: Event): void {
      // @ts-ignore
      if (!this.element.contains(event.target) &amp;&amp; !this.menuTarget.classList.contains('hidden')) {
        this.leave()
      }
    }
  }
  </code></pre>
  <p>what kind of steps should I do in order to convert this to js? Bear in mind that I know nothing about typescript so I'm getting little confused here.</p>
  <p>What I've currently done is the following</p>
  <pre><code>import { Controller } from &quot;@hotwired/stimulus&quot;
  import { useTransition } from 'stimulus-use/dist/use-transition'
  
  export default class extends Controller {
    menuTarget: HTMLElement
    toggleTransition: (event?: Event) =&gt; void
    leave: (event?: Event) =&gt; void
    transitioned: false
  
    static targets = ['menu']
  
    connect() {
      useTransition(this, {
        element: this.menuTarget
      })
    }
  
    toggle() {
      this.toggleTransition()
    }
  
    hide(event) {
      // @ts-ignore
      if (!this.element.contains(event.target) &amp;&amp; !this.menuTarget.classList.contains('hidden')) {
        this.leave()
      }
    }
  }
  </code></pre>
  <p>but I don't quite know what to do with the hide function since it depends on the lines</p>
  <pre><code>menuTarget: HTMLElement
  toggleTransition: (event?: Event) =&gt; void
  leave: (event?: Event) =&gt; void
  transitioned: false
  </code></pre>