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

161
Views
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
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!