I'm attempting to generate a type by extracting properties from a class.
ts-essential
makes it easy with the use of OmitProperties
!
The issue I'm facing is that
OmitProperties<T, Function>
not only eliminates the class methods but also removes any properties typed as any
.
type GetProperties<T> = OmitProperties<T, Function>
class Foo {
foo: string = '';
bar: any | null = null;
}
export type FooProperties = GetProperties<Foo>; // results in { foo: string; } only =(
Any suggestions on how to enhance this to include all properties, even those typed as any?