How to type either

Quick question. I have an object I'm passing as a parameter. It has the shape
{id: number, name: string, foo: Partial<SomeObject>}
I need either or both id and name, and I require foo. How would I go about typing this?
Was this page helpful?