代码
!async function() {
const sequelize = new Sequelize({
dialect: 'sqlite',
storage: path.join(process.cwd(), 'test.sqlite'),
logging: false,
});
class Seq extends Model { }
Seq.init({}, {sequelize, modelName: 'test'});
await Seq.sync();
const result = Seq.findAndCountAll({});
}();
F12 点进去看 findAndCountAll 方法有定义返回值的类型, 为什么 result 的类型变成 any 了?