0
我最近正在编写node.js模块“mongoose-bird”的定义文件。该模块导出一个返回模块的函数。随着互联网上的导游,我写了这个:模块的写入定义文件导出返回模块的函数
declare module "mongoose-bird" {
export =() => MongooseAsync;
module MongooseAsync {
...
但是我发现,用下面的代码,类型系统无法正常工作:
import mongoose_bird = require('mongoose-bird');
var mongoose = mongoose_bird();
...
export interface IUser extends mongoose.Document {
由于tsc
报告错误TS2503
error TS2503: Cannot find namespace 'mongoose'.