Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

464
Views
Typescript/JS: Converting a constant to enum?

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
}
about 4 years ago · Santiago Gelvez
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!