-
Notifications
You must be signed in to change notification settings - Fork 2k
Documentation
We are currently in the process of switching from JSDoc to YUI Doc for documentation generation.
- Official Yui Documentation
- Building Documentation with YUI Doc Slides
- Building Documentation Yui Doc Video and Transcript
In addition to support for built in types:
- Object
- Array
- String
- Boolean
- Number
You can also specify custom types, such as {Point}.
You can specify that an Array expects a specific type like so:
Array[TYPE]
This block should be at the top (under the license) of every JavaScript file:
/**
* The Easel Javascript library provides a retained graphics mode for canvas
* including a full, hierarchical display list, a core interaction model, and
* helper classes to make working with Canvas much easier.
* @module EaselJS
**/
/**
* DESCRIPTION
* @class CLASS_NAME
* @extends SUBCLASS
* @static REQUIRED IF CLASS SHOULD NOT BE INSTANTIATED
**/
/**
* DESCRIPTION
* @constructor
* @param {TYPE} PARAM_NAME DESCRIPTION
**/
/**
* DESCRIPTION
* @method METHOD_NAME
* @static REQUIRED IF METHOD IS STATIC
* @param {TYPE} PARAM_NAME DESCRIPTION
* @return {TYPE} DESCRIPTION
**/
/**
* DESCRIPTION
* @property NAME
* @static REQUIRED IF PROPERTY IS STATIC
* @final REQUIRED IF PROPERTY IS READ-ONLY
* @type TYPE
**/
Note, events must be declared after the class declaration for the class they are associated with.
/**
* DESCRIPTION
* @event EVENT_NAME
* @param {TYPE} NAME DESCRIPTION
**/
In general, all internal implimentation properties and methods should be marked as protected and not as private. Members should only be marked as private if they should not be accessed by subclasses.
It is not necessary to completely document protected APIs, although you should include the primary information:
/**
* DESCRIPTION_OPTIONAL
* @property NAME
* @type TYPE
* @protected
**/
or for a method:
/**
* DESCRIPTION_OPTIONAL
* @method NAME
* @param {TYPE} NAME DESCRIPTION_OPTIONAL
* @protected
**/