0

In jsdoc @param,

  We can write like:
   /**
     * @param {Object} somebody- The employee who is responsible.
     */
   function sayHello(somebody: ABC) {
        alert('Hello ' + somebody);
    }

If I have a class like ABC and somebody is an object of type ABC, can I write it like this,?

   /**
     * @param {ABC} somebody- The employee who is responsible.
     */
   function sayHello(somebody: ABC) {
        alert('Hello ' + somebody);
    }

That is, can I give my own object type inside curly braces of param rather than giving as object? Thanks in advance...

AngularDoubts
  • 459
  • 2
  • 11
  • 30

1 Answers1

1

Looking at your code you are probably using TypeScript. You have 2 options:

  • If ABC is an object or class you can reference it by using a JSDoc namepath (ex: myNamespaceOrModule.ABC};
  • If ABC is not an actual JavaScript object (ex: a TypeScript interface) than you can use JSDoc @typedef tag to document a custom tag.

Please, provide the code where the ABC class is defined for a better answer.