title: Declare an external module function
body: <p>I'm trying to declare an external module which has no existing typings, but am missing something.</p>
  
  <p>The library exports a function which takes no arguments and returns a string.</p>
  
  <p>I'm trying to define it using this in a <code>.d.ts</code> file:</p>
  
  <pre><code>declare module "cuid" {
      export function cuid(): string;
  }
  </code></pre>
  
  <p>In my code, I have <code>import * as cuid from 'cuid';</code></p>
  
  <p>Yet on the line where I use it, <code>cuid()</code> I get an error:</p>
  
  <p><code>error TS2349: Cannot invoke an expression whose type lacks a call signature.</code></p>