title: When writing webpack configuration in TypeScript, what typings to use when module.exports is a function?
body: <p>I have this in my <code>webpack.config.ts</code>:</p>
  <pre class="lang-js prettyprint-override"><code>import * as webpack from 'webpack'
  
  module.exports = (env, argv): webpack.Configuration =&gt; {
    return {};
  }
  </code></pre>
  <p>But it’s unclear to me what types I should use for <code>env</code> and <code>argv</code>.</p>
  <p>I couldn’t find the answer in Webpack documentation, anywhere on the web or in my code editor suggestion, and I couldn’t make sense of the webpack typing files. The closer I have is the description in <a href="https://webpack.js.org/configuration/configuration-types/#exporting-a-function" rel="nofollow noreferrer">the Configuration Types of the webpack documentation</a>, but it’s unclear what the exact type is.</p>