Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

465
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda