i Would like to know if there is a way to add parameters to a interface of an already created object... Let me explain
I have a Product Class with these properties product.id product.name, now i want to add a quantity property to it...
I´m making an sql query that will give me the product object and the quantity and I want to add it to the product interface only to this const so I can do something like console.log(products[0].quantity)
I was tring to do something like this but obviously doesn't work
const products:Array<{...Product, quantity: number}> = (some sql query code with joins xd)
I found a way and is declaring all from scracth but I want to know if there is a better way to do this because this is a little cumbersome specially if the object has more properties
const products:Array<{id: number, name: string, quantity:number}>
Edit: Just found a way but I'm still all ears
const products:Array<Product & {quantity: number}>