title: Exported variable has or is using private type TypeScript error
body: <p>The following gets a rather cryptic TypeScript build error: <code>Exported variable 'res' has or is using private type 'Result'</code>.</p>
  
  <pre><code>interface Result {
      status: string;
      comment: string;
  }
  
  function runTest(st: any) {
      try {
  
      } catch (err) {
          console.log('Failed test task: ' + err);
          console.log('Failed test task: ' + st.name);
          console.log(err.stack);
          var res: Result = {
              status: 'bad',
              comment: 'Nodejs exception: ' + err,
          };
          //saveTestResult(st, res);
      }
  };
  
  export function what() {};
  </code></pre>
  
  <p>It's all ok if either:</p>
  
  <ul>
  <li>Remove the try/catch</li>
  <li>Don't export the function <code>what</code></li>
  </ul>
  
  <p>What's going on here?</p>