[Bug Report] egg-mongoose config 缺少类型定义
What happens?
egg-mongoose 插件 config 缺少某些字段的类型定义,例如
// config.default.ts
config.mongoose = {
loadModel: false,
}
复现步骤,错误日志以及相关配置
错误日志: config/config.default.ts(35,5): error TS2322: Type '{ loadModel: boolean; }' is not assignable to type 'PowerPartial<{ url?: string | undefined; options?: ConnectionOptions | undefined; client?: MongooseConfig | undefined; clients?: { [key: string]: MongooseConfig; } | undefined; }>'. Object literal may only specify known properties, and 'loadModel' does not exist in type 'PowerPartial<{ url?: string | undefined; options?: ConnectionOptions | undefined; client?: MongooseConfig | undefined; clients?: { [key: string]: MongooseConfig; } | undefined; }>'.
相关环境信息
- 操作系统:macOS Catalina 10.15.4
- Node 版本:v10.19.0
- Egg 版本:v2.26.0
- egg-mongoose 版本: v3.2.0
loadModel 方法同样缺少类型定义
await this.app.mongoose.loadModel()
// Property 'loadModel' does not exist on type 'typeof import("mongoose")'
createInstanceAsync 方法也缺少
const dbInstance = await this.app.mongooseDB.createInstanceAsync(dbConfig)
// Property 'createInstanceAsync' does not exist on type 'Connection | MongooseSingleton'.
建议梳理一下然后加上所有的类型定义,不胜感激