I'm trying to declare a .d.ts file to use npm uuid in an agular 2 app. What I'm doing seems to be in line with the example I found, yet I get the error : typescript d.ts file has no exported members v1
uuid/v1.d.ts file:
declare var v1: any;
declare module "uuid/v1" {
export = v1;
}
the npm js file is uuid/v1.js:
function v1(options, buf, offset) { //...}
module.exports = v1;
I also tried :
export = uuid;
declare namespace uuid {
function v1(): any;
}
which gives a runtime exception:
ORIGINAL EXCEPTION: __webpack_require__.i(...) is not a function
import { v1 } from 'uuid/v1';