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

163
Vistas
How do I document objects referring to a type in an object literal?

I have the following scenario:

var myNamespace = {
    /**
     * @type {myNamespace.MyClass|undefined}
     */
    myObject: undefined,

    MyClass: class MyClass {
    },

    MyOtherClass: class MyOtherClass {
        /**
         * @type {myNamespace.MyClass}
         */
        myProperty
    }
}

Is it possible to document this in a way to make visual studio code can give me suggestions, without using @typedef, and if so, how would I go about it?

I have tried various different formats, but every time the result is the same where I get "Type = /*unresolved*/ any". Both inside and outside of the namespace the result seems to be the same.

I would be ok with documenting the object ("myNamespace") in complex detail, but it would still refer to types inside of itself, which I doubt is possible?

about 4 years ago · Juan Pablo Isaza
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