Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.


Yeah, tricky one, that.

At least you have the workaround

    type PublicPart<T> = {[K in keyof T]: T[K]}; //keyof only sees public properties




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: