How to document a string type in jsdoc with limited possible values

As of late 2014 in jsdoc3 you have the possibility to write: /** * @param {(‘rect’|’circle’|’ellipse’)} shapeType – The allowed type of the shape */ Shape.prototype.getType = function (shapeType) { return this.type; }; Of course this will not be as reusable as a dedicated enum but in many cases a dummy enum is an overkill … Read more

codestyle; put javadoc before or after annotation?

Before the annotation, since the annotation is code that “belongs” to the class. See examples with javadoc in the official documentation. Here’s a random example I found in another official Java page: /** * Delete multiple items from the list. * * @deprecated Not for public use. * This method is expected to be retained … Read more

JSDoc: Return object structure

Define your structure separately using a @typdef: /** * @typedef {Object} Point * @property {number} x – The X Coordinate * @property {number} y – The Y Coordinate */ And use it as the return type: /** * Returns a coordinate from a given mouse or touch event * @param {TouchEvent|MouseEvent|jQuery.Event} e * A valid … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)