mirror of
https://github.com/type-challenges/type-challenges.git
synced 2026-02-01 15:47:22 +00:00
ClassPublicKeys

by jiangshan @jiangshanmeta
Implement the generic ClassPublicKeys<T> which returns all public keys of a class.
For example:
class A {
public str: string
protected num: number
private bool: boolean
getNum() {
return Math.random()
}
}
type publicKyes = ClassPublicKeys<A> // 'str' | 'getNum'