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'>>, ]