I am recently writing definition files for node.js module "mongoose-bird". This module exports a function returning a module. With guides on the internet, I wrote this:
declare module "mongoose-bird" {
export = () => MongooseAsync;
module MongooseAsync {
...
But I found that with the following code, the type system cannot work properly:
import mongoose_bird = require('mongoose-bird');
var mongoose = mongoose_bird();
...
export interface IUser extends mongoose.Document {
Since tsc
reports error TS2503
error TS2503: Cannot find namespace 'mongoose'.