Supposing we have a similar interface:
interface Interface {
foo: string;
bar: number;
baz?: boolean;
}
How can we construct a type with only its optional properties?
With the interface above, I'd be looking to something like:
interface PartialInterface {
baz: boolean;
}
A solution would be of course to use either Omit or Pick; That would work on small interfaces, but it wouldn't really be suitable for bigger scenarios.
Any suggestion is highly appreciated, thank you in advance!