I have a type that's defined in a third party library. Let's say its shape is:
type Foo = {
id: string
results: Array<{ bar: string }>
}
Is there a way to derive the type { bar: string }?
I'd like to use it like so:
type Baz = /* derived type */
const baz: Baz = { bar: 'abc' }
I was looking at utility types... but couldn't figure out how to target that part of the type definition.