Is it possible for Typescript to support type or interface "destructuring" (if that's the right term)?
I am attempting to achieve something similar to the code snippet below:
type SomeRandomType = {
propertyOne: string;
propertyTwo: number;
...
};
type SomeRandomORType = "propertyOne" | "propertyTwo" | ...;
Can we create SomeRandomORType
without manually typing properties from SomeRandomType
? Something like this:
type SomeRandomORType = Destruct<SomeRandomType>;