type ValueOf < T > = T [ keyof T ] ; example export const fontWeights = { regular : 400 , medium : 500 , bold : 700 , } ; export type CanvasFontWeights = { /** regular font-weight (400) */ regular : 400 ; /** medium font-weight (500) */ medium : 500 ; /** bold font-weight (700) */ bold : 700 ; } ; export type CanvasFontWeightValues = ValueOf < CanvasFontWeights > ;