title: How do I resove this Typescript assigning error?
body: <pre><code>const widgett = {};
  class Widget {
    constructor() {
      console.log('wi');
    }
  }
  function Widget2() {
    console.log('wi');
  }
  // const w = new Widget();
  
  function logDec(factory: () =&gt; widgett):(() =&gt; widgett) {
    return () =&gt; {
      console.log(123);
      factory();
    };
  }
  </code></pre>
  <p>The factory is a function that returns a Widget object, but it tells me to put a type instead of a value. But a function return a value not a type right?</p>
  <p>FYI error message:
  'widgett' refers to a value, but is being used as a type here. Did you mean 'typeof widgett'?(2749)</p>