I want to allow an arrays of objects of any shape, as long as they have id: number
present.
So whether it is an array of OrderModel
or UserModel
(both of which have id: number
), how can I define such an array?
export interface Item { id: number; // whatever else, doesn't matter }