title: How do I use the typesVersions field in package.json to ship stricter types for newer typescript versions?
body: <p>According to <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-1.html#version-selection-with-typesversions" rel="nofollow noreferrer">the TypeScript 3.1 release notes</a>, typescript provides a way to ship stricter types in npm packages by setting the <code>typesVersions</code> field in <code>package.json</code> like so:</p>
  
  <pre><code>{
    "name": "package-name",
    "version": "1.0",
    "types": "./index.d.ts",
    "typesVersions": {
      "&gt;=3.1": { "*": ["ts3.1/*"] }
    }
  }
  </code></pre>
  
  <p>However, the docs do not indicate how the specified <code>ts3.1/index.d.ts</code> file is created. Do I have to manually write an <code>index.d.ts</code> file at this location? Is there a way with typescript or a related build tool to conditionally generate stricter types?</p>