0

I want to import sails-redis, modelling, clean-obj and other 3rd party modules in Node, but I'm using typescript. so it is showing me an error: Can not find a declaration module for clean-obj

I'm doing this:

import * as cleanObj from 'clean-obj';

It is not working, showing an error. But if do as below it works, but I don't think is it a proper way in typescript or not.

const cleanObj-obj = require('clean-obj');

I want to import 3rd party module which does not have typings in npm. Kindly suggest me a proper way to add typings for them.

ATUL SHARMA
  • 184
  • 2
  • 12
  • 1
    Possible duplicate of [typescript declare third party modules](https://stackoverflow.com/questions/44058101/typescript-declare-third-party-modules) – undefined May 17 '19 at 12:07
  • That question is exporting own created module foo, not a third party module. And in its answer, he is recommending module which has typings, but my case it does not have typings. But I want to import 3rd party module which does not have typings in npm. – ATUL SHARMA May 17 '19 at 12:15

0 Answers0