I am looking to extend a generic list of Array that has been previously extended from my class. How can I accomplish this in the correct way?
export interface DeliveryMethod {
readonly id: string;
readonly company: string;
readonly cost: number;
readonly threshold: number;
readonly intervals: Array<Interval>;
readonly paymentMethods: Array<PaymentMethod>;
}
export interface Delivery {
selected: SelectedDelivery;
available: { [key : string] : Array<T extends DeliveryMethod>;};
}
The error 'Cannot find name 'T'.ts(2304)' is showing up.
available: { [key : string] : Array<T extends DeliveryMethod>; };
One solution could look like this:
const Delivery = {
selected :{/*data inside*/},
available:{
pickup: [<Pickup>{},<Pickup>{}],
courier: [<Courier>{},<Courier>{}]
}
}