i'm pretty new in typescript and can't figure out how i can modify deep nested interfaces.
I have interface ( which generated from graphql schema ) and i want to transform it to new model
it looks like so
interface SeatMap{
// other fields
segments: {
// other fields
rows: { // <-- i want to add one more field to row type
// other fields
seats: { // <-- i want to add few new fields to seat type
isAvailable: boolean;
isAisle: boolean;
// etc.
}
}
}
}
Than, i'm create two new functions
addServiceFieldToSeats which receive SeatMap and return SeatMap with modified seat type
and addRowPartsToRows which receive SeatMap and return SeatMap with modified row type
then via compose function from redux to create new function seatMapAdapter but can't figure out how to solve typescript errors
i know that my function transform seatmap rows type to new type RowWithParts
but addServiceFieldToSeats receive old SeatMap type
How i can describe every SeatMap transformation?
