Is there a way to create a new interface that contains only the optional fields of another interface?
declare interface TestInterface {
mandatory: string,
optional?: string,
}
declare interface OnlyOptional {
optional: string
}
type OnlyOptionalExtended = GetOptional<TestInterface>;
I need my OnlyOptional
and OnlyOptionalExtended
interfaces to be exactly the same.