const user = { id: 1, name: 'kim' } as const
type User = typeof user; // { id: number, name: string }type User = { id: number, name: string };
type UserKey = keyof User; // 꼭 keyof는 타입으로 선언된 타입 선언문에만 사용
// result : 'id' | 'name'const STATUS = {
READY: 'ready',
DONE: 'done'.
} as const
type STATUS_KEY = keyof typeof STATUS;
// result : 'READY' | 'DONE'