0

I have the following code:

/**
 * @interface an interface for Foo
 */
interface IFoo {
  init: () => void;
}

class Foo implements IFoo {
  public init(): void {}
}

I want to describe init method with a type like I would for any other param @param {type} name - description, but @param doesn't seem to be a good thing for the method description and the @method can not properly display the type, after trying

 * @method {() => void} init - method for initialization

I get this kind of description:

enter image description here

Is there a proper way for describing interface methods with a type?

1 Answer 1

1

You can omit @ tags and place description in the comment above method or/and interface

/**
 * An interface for Foo
 */
interface IFoo {
  /**
   * method for initialization
   */
  init: () => void;
}

enter image description here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.