title: Creating and importing private package of hand-written type definitions
body: <p>I need to create a private npm package containing (only) custom type definitions (typedefs). These are hand-written d.ts files that were not generated by TypeScript. As these are proprietary, I can't add them to DefinitelyTyped.</p>
  <p>Folder structure: typings / mymodule / index.d.ts<br/>
  index.d.ts contains: <code>declare module mymodule { ... }</code></p>
  <p>The package preserves the structure, so after installing in another project I have:<br/>
  node_modules / @mycompany / mytypes / typings / mymodule / index.d.ts</p>
  <p>Unfortunately now I have to edit tsconfig.json in the other project to add:</p>
  <pre><code>    &quot;include&quot;: [
        &quot;node_modules/@mycompany/mytypes/typings&quot;
      ],
  </code></pre>
  <p>or optionally (and more correctly?) add under <code>compilerOptions</code>:</p>
  <pre><code>      &quot;typeRoots&quot;: [
          &quot;node_modules/@types&quot;,
          &quot;node_modules/@mycompany/mytypes/typings&quot;
        ]
  </code></pre>
  <p>After that, it works - I can reference <code>mymodule.SomeType</code> in the other project.</p>
  <p>Is there a way I can make this work automatically on npm install without having to edit tsconfig includes (that is, have it behave like a DefinitelyTyped package)?</p>
  <p>If there is a more correct way to do this, that's a valid answer.</p>
  <p>I'm using TypeScript 3.6 or 3.7, depending on the importing project.</p>