title: How to 'return' outside function definition in typescript
body: <ol>
  <li><p>I need to rewrite my tampermonkey script on typescript.</p></li>
  <li><p>What is correct way to rewrite this javascript on typescript?</p>
  
  <pre><code>if (window.top != window.self ) {
      return;
  }
  </code></pre></li>
  </ol>
  
  <p>Main goal is to stop executing script if it's running not in window.top.</p>
  
  <p>Typescript compiler write ERROR TS1108: A 'return' statement can only be used within a function body.</p>