typescript declare third party modules
How could I declare a third party module which looks like this: in third party module: module.exports = function foo(){ // do somthing } in my code: import * as foo from 'foo-module'; // Can not find a declaration module for ... foo(); Check out the documentation on working with 3rd party modules . How to write the declaration depends a lot on how the module was written and what it exports. The example you've given is a CommonJS module ( module.exports = ... ) which is not really a valid ES6 module, because ES6 cannot export a function as the module (it can only export function members or a