TS2314

error TS2314: Generic type ‘Omit’ requires 2 type argument(s).

Broken Code ❌

1
2
3
4
export interface SerializedBatchedCandle extends Omit<BatchedCandle, 'close', 'open'> {
open: string;
close: string;
}

Fixed Code ✔️

When using the Omit utility type, you have to list property overwrites with a pipe (|):

1
2
3
4
export interface SerializedBatchedCandle extends Omit<BatchedCandle, 'close' | 'closeAsk'> {
close: string;
closeAsk: string;
}