Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

154
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda