TS2511
Cannot create an instance of an abstract class.
Broken Code ❌
myFunction = (strategyConstructor: typeof Strategy, config: StrategyConfig): Promise<Big> => {
// ....
};Fixed Code ✔️
export interface Type<T> extends Function {
new (...args: any[]): T;
}
myFunction = (strategyConstructor: StrategyType<Strategy<StrategyConfig>>, config: StrategyConfig): Promise<Big> => {
// ....
};Read more: Passing a class constructor as parameter to a function.
