Closed
Description
I'm trying to write a function that takes a model class and calls .findAll({})
, but TypeScript is giving me an error. This reproduces it:
async function createResource(model: typeof Model) {
const results = await model.findAll({})
}
gives:
The 'this' context of type 'typeof Model' is not assignable to method's 'this' of type 'new () => Model<any>'.
Cannot assign an abstract constructor type to a non-abstract constructor type.
Metadata
Metadata
Assignees
Labels
No labels