TS2351
This expression is not constructable. Type 'EMA' has no construct signatures.
Broken Code ❌
export class RSI {
private readonly avgGain: MovingAverage;
constructor(
private readonly interval: number,
Indicator: EMA
) {
this.avgGain = new Indicator(this.interval);
}
}export class EMA {}Fixed Code ✔️
export class RSI {
private readonly avgGain: MovingAverage;
constructor(
private readonly interval: number,
Indicator: typeof EMA
) {
this.avgGain = new Indicator(this.interval);
}
}