title: Typescript: Accessing declare module types
body: <p>For knexjs with <a href="https://knexjs.org/#typescript-support" rel="nofollow noreferrer">typescript support</a>, I've setup the following:</p>
  <pre><code>declare module &quot;knex/types/tables&quot; {
      interface Tables {
          // base tables
          groups: Knex.CompositeTableType&lt;
              // Table
              typeof GroupDB.type,
              // Insert
              typeof GroupDBInsert.type,
              // Update
              typeof GroupDBUpdate.type
          &gt;;
      }
  }
  </code></pre>
  <p>It works. I would like to reuse the types found in the interface.</p>
  <pre><code>import { Tables } from &quot;knex/types/tables&quot;;
  
  let tableName: keyof Tables = &quot;groups&quot;
  </code></pre>
  <p>but <code>knex/types/tables</code> would fail with error</p>
  <pre><code>Unable to resolve path to module 'knex/types/tables'.eslintimport/no-unresolved
  </code></pre>
  <p>What should I do to be able to access the declared module's types?</p>