this has an error:
interface TypeA {
prop1: string
}
interface TypeB extends TypeA {
prop2: string
}
const ArrA: TypeA[] = [{ prop1: "foo" }]
const ArrB: TypeB[] = ArrA.map(a => {
a.prop2 = "bar"
return a
})
this gets an error: [ts] Property 'prop2' does not exist on type 'TypeA'.
and i want to do this without using any in my interface definitions (like in this Stackoverflow question from 5 years ago). I can't find any other solution on Stackoverflow so I am posing this question here.