Type Challenges Judge

ClassPublicKeys

提出詳細

type ClassPublicKeys<T> = keyof T
提出日時2024-09-12 15:14:50
問題ClassPublicKeys
ユーザーookkoouu
ステータスAccepted
テストケース
import type { Equal, Expect } from '@type-challenges/utils' class A { public str: string protected num: number private bool: boolean constructor() { this.str = 'naive' this.num = 19260917 this.bool = true } getNum() { return Math.random() } } type cases = [ Expect<Equal<ClassPublicKeys<A>, 'str' | 'getNum'>>, ]