3 ms·
TypeScript, having a purely structural type system, means any class has an interface. Unfortunately, if the class has any private or protected members, its inte
by seanmcdirmid 9y ago
TypeScript, having a purely structural type system, means any class has an interface. Unfortunately, if the class has any private or protected members, its interface becomes unimplementable.
- dahauns 9y agoYeah, tricky one, that. At least you have the workaround type PublicPart<T> = {[K in keyof T]: T[K]}; //keyof only sees public properties