Is there a way to define the type for object keys without individually defining types for each value?
const sizes: Record<string, CSSObject>= {
md: {
padding: [10, 24],
fontSize: 'medium',
},
xs: {
padding: [6, 12],
fontSize: 'small',
},
sm: {
padding: [8, 16],
fontSize: 'small',
},
lg: {
padding: [14, 30],
fontSize: 'large',
},
} as const;
// Expecting 'md' | 'xs' | 'sm' | 'lg'
type Sizes = keyof typeof sizes;
// However, it is currently returning a string