@public
Syntax
@public
Overview
@public marks a symbol as public. Because symbols are public by default in JSDoc, this tag is mainly useful to explicitly restore the public status after a parent scope or configuration has changed it, or to make the intent explicit for readers.
TSTypeScript Supported
TypeScript recognises @public and uses it to set the visibility of class members in JavaScript files.
Example
class EventEmitter {
/**
* Register an event listener.
* @public
* @param {string} event
* @param {Function} listener
*/
on(event, listener) {}
/**
* @private
*/
_dispatch(event, data) {}
}
See also
Official reference: jsdoc.app/tags-public