I have a constant of static object info I am exporting. I am trying to change it to a typescript file and export the data as an enum instead of a const :
export const DEFAULT_FONT_LIST = {
'Arial':
{
'Regular': {
'full': 'NimbusSansD-Regular',
'trial': 'Acumin-Pro-Regular'
},
'Bold': {
'full': 'NimbusSansD-Bold',
'trial': 'Acumin-Pro-Bold'
},
'Italic': {
'full': 'NimbusSansD-Italic',
'trial': 'Acumin-Pro-Italic'
},
'Bold Italic': {
'full': 'NimbusSansD-BoldItalic',
'trial': 'Acumin-Pro-Regular'
},
},
'Times New Roman':
{
'Regular': {
'full': 'Nimbus-Roman-Regular',
'trial': 'Nimbus-Roman-Regular'
},
'Bold': {
'full': 'Nimbus-Roman-Bold',
'trial': 'Nimbus-Roman-Bold'
},
'Italic': {
'full': 'Nimbus-Roman-Italic',
'trial': 'Nimbus-Roman-Italic'
},
'Bold Italic': {
'full': 'Nimbus-Roman-BoldItalic',
'trial': 'Nimbus-Roman-Regular'
},
}
}
Can I convert that into a Typescript enum ?
I have interfaces created but don't know how to convert the actual list to support it:
interface DefaultFont {
[key: string]: DefaultFontOptions;
}
interface DefaultFontOptions {
[key: string]: DefaultFontAvailability;
}
interface DefaultFontAvailability {
'full': string;
'trial': string
}