Normal Tags @event - | TheYOSH.nl

[Pages:60]JSDoc3 Cheat Sheet

Normal Tags

@event

@global

@abstract | @virtual @alias

@alias

@author

@event #[event:]

/** * Throw a snowball. * @fires Hurl#snowball */

Hurl.prototype.snowball = function() { //code };

@ignore

Remove this from the final output.

@inner

@instance

@author []

@borrows

This object uses something from

/**

@lends

* Snowball event. * @event Hurl#snowball * @type {Object} * @property {Boolean} isPacked

Document properties on an object literal as if they belonged to a symbol with a given name.

another object.

- Indicates packed snowball. */

@lends

@borrows as

@callback

@example

/**

@license

@license

@callback

/** * Send a request. * @param {requestCallback} cb

- Callback handling responses. */

MyClass.send = function(cb) { //code };

/** * This callback is displayed

* Solves equations. * @example Example

@member | @var

usage of method1. * // returns 2

@member [{type}] []

* globalNS.method1(5, 10);

* @returns {Number} value of x @memberof

*/ @memberof

@exports

/** @memberof Class.static */

Identify the member that is exported. /** @memberof Class#instance */

as a global member. * @callback requestCallback

@exports

/** @memberof Class~inner */

* @param {Number} responseCode */

@extends | @augments

@mixes

@class | @constructor

@extends

This object mixes in all the members from another object.

@class [{type} ]

@const | @constant

@external | @host

Document an external namespace / module.

class

@mixes /

@mixin

@constant [{type} ]

@constructs

This function member will be the constructor for the previous class. @constructs []

@copyright

@copyright

@external

/** * Provided by the browser. * @external XMLHttpRequest */

@mixin []

@module

@module [[{}] ]

/** * Extends the XMLHttpRequest. * @class EncryptedRequest * @extends

external:XMLHttpRequest */

@name

@name

@namespace

@default | @defaultvalue

@default []

@deprecated

@deprecated []

@enum

@fires | @emits

@fires #[event:]

@function | @method

@function []

@namespace [[{}] ]

@param | @argument

@param {type} @param {type} [=]

@enum [{type}]

JSDoc3 Cheat Sheet (V1.0) by Petrogale (based on )

@private

@since

@type

@property | @prop

@property {type}

@protected

@public

@readonly

@requires

@requires

@return | @returns

@returns {type}

@see

@see @see

@since

@type {type}

@static

@summary

@summary

@this

What does 'this' refer to here? @this

@throws | @exception

@typedef

Document a custom type.

@typedef [{type}]

/** * @typedef PropHash * @type {Object} * @property {String} id * @property {String} name */

/** @type {PropHash} */ var props;

@throws @throws {type} []

@todo

@todo

@variation

Distinguish different objects with the same name.

@variation

@tutorial

@version

Insert a link to an included tutorial file. @version

@tutorial

Inline tags

{@link}

Link to a JSDoc namepath or an external URL. By default, links are rendered in plain text. If you prefer links to be rendered in a monospace font, you can use the configuration options template.monospaceLinks and templates.cleverLinks to change this behavior.

{@linkcode}

Insert a link that should be rendered in a monospace font.

{@linkplain}

Insert a link that should not be rendered in a monospace font.

{@tutorial}

Link to a tutorial.

{@link someNamepathOrURL} [link text here]{@link someNamepathOrURL} {@link someNamepathOrURL|link text here} {@link someNamepathOrURL Link text here (after the first space)}

/** * A module. Refer to it using

{@link module:foo/bar}. * @module foo/bar */

/** * The built-in string object. Refer to it with {@link

external:String}. * @external String */

/** * An event. Refer to with {@link module:foo/bar.event:MyEvent}. * @event module:foo/bar.event:MyEvent */

Types

Symbol name (name expression) Multiple types (type union) Arrays and objects (type applications and record types)

Nullable type Non-nullable type Variable number of that type Optional parameter

{Boolean} {myNamespace.MyClass}

{(Number|Boolean)}

{Array.} or {MyClass[]} {Object.} {{a: Number, b: String, c}} myObj or {Object} myObj {Number} myObj.a {String} myObj.b {*} myObj.c

{?Number}

{!Number}

@param {...Number} num

@param {Number} [foo] or @param {Number=} foo @param {Number} [foo=1]

JSDoc3 Cheat Sheet (V1.0) by Petrogale (based on )

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download