TS4063

error TS4063: Parameter ‘config‘ of constructor from exported class has or is using private name ‘DoubleMovingAverageConfig‘.

Bad Code ❌

1
2
3
4
5
6
7
8
9
type DoubleMovingAverageConfig = {
lastBuyPrice: string,
lastSellPrice: string,
warmUpCandles: number,
}

class DoubleMovingAverage extends Strategy {
constructor(private setup: StrategySetup, private config?: DoubleMovingAverageConfig) {}
}

Fixed Code ✔️

1
2
3
4
5
6
7
8
9
export type DoubleMovingAverageConfig = {
lastBuyPrice: string,
lastSellPrice: string,
warmUpCandles: number,
}

class DoubleMovingAverage extends Strategy {
constructor(private setup: StrategySetup, private config?: DoubleMovingAverageConfig) {}
}