我有一个界面,看起来像这样:
declare global {
namespace Express {
interface Request {
db: {
User: Repository<User>,
Product: Repository<Product>
}
}
}
}有没有可能将db动态地转换成某种东西?和keyof?因此,我不必在每次数据库更改时都更改接口。
https://stackoverflow.com/questions/44523510
复制相似问题