const myObject = {
first: 'apple',
second: 'banana',
third: 'carrot'
}
type KeyType = keyof typeof myObject;
type ValueType = (typeof myObject)[keyof typeof myObject];
// 결과
// KeyType = "first" | "second" | "third"
// ValueType = "apple" | "banana" | "carrot"