title: error TS2554: Expected 2-3 arguments, but got 1
body: <p>With given <code>tsconfig.json</code>,</p>
  
  <pre><code>{
  
      "compilerOptions": {
  
        "lib": ["es2015", "dom"]
      },
      "files": [
        "./project1/tstut.ts",
        "./project1/worker.ts"
  
      ]
    }
  </code></pre>
  
  <p>and <a href="https://github.com/shamhub/shamhub.github.io" rel="nofollow noreferrer">folder structure</a></p>
  
  <hr>
  
  <p>1)</p>
  
  <p>For below code(<code>./project1/tstut.ts</code>),</p>
  
  <pre><code>if(window.Worker){
    console.log('Workers are available');
  }
  ....
  let worker: Worker = new Worker('worker.js');
  worker.postMessage('do some work')
  </code></pre>
  
  <p>How to resolve below typescript error?</p>
  
  <pre><code>Property 'Worker' does not exist on type 'Window'
  </code></pre>
  
  <p>2)</p>
  
  <p>For below worker code(<code>./project1/worker.ts</code>), </p>
  
  <pre><code>self.addEventListener('message', (e) =&gt; {
      // console.log(e)
      if(e.data === 'do some work'){
          console.log('Worker is about to start some work');
          let count: number =0;
          for(let i: number=0; i&lt;1000; i++){
              count += i;
          }
          self.postMessage({message:count});
      }
  
  })
  </code></pre>
  
  <p>JS allows syntax <code>self.postMessage({message: count})</code></p>
  
  <p><a href="https://github.com/Microsoft/TypeScript/issues/582" rel="nofollow noreferrer">https://github.com/Microsoft/TypeScript/issues/582</a></p>
  
  <p>Given <a href="https://stackoverflow.com/a/48950463/3317808">scenario</a> does not fit in my case.</p>
  
  <p>How to resolve below error for <code>postMessage()</code>? On running <code>tsc</code></p>
  
  <p><code>Expecting 2-3 arguments, but got 1</code></p>