Let's say I have an interface:
interface FooBar {
foo: string
bar: {
baz: string
}
}
I'd like to construct a type based FooBar's bar property, with only its properties:
interface Bar {
baz: string
}
Trying Pick<Foobar, 'bar'> only yields:
{
bar: {
baz: string
}
}
type Bar = FooBar["bar"]