I am trying to set the return type on a function.
export const getModels = <T extends new () => Model>(): T[] => [UserDetail];
The return is an array of classes extending from the Model class from sequelize-typescript. But I am getting the error:
Type 'typeof UserDetail' is not assignable to type 'T'. 'typeof UserDetail' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'new () => Model<any, any>'