How to create a type excluding instance methods from a class in typescript?
I’ve found a way to exclude all properties that match a given type, thanks to this article: https://medium.com/dailyjs/typescript-create-a-condition-based-subset-types-9d902cea5b8c I made a few adaptations, but here is the details: // 1 Transform the type to flag all the undesired keys as ‘never’ type FlagExcludedType<Base, Type> = { [Key in keyof Base]: Base[Key] extends Type ? never … Read more