如何注释javascript-jsDoc

jsDoc toolkit  ( http://code.google.com/p/jsdoc-toolkit/ )   tagRefrence 


  • @augments - Indicate this class uses another class as its "base."
  • @author - Indicate the author of the code being documented.
  • @argument - Deprecated synonym for @param.
  • @borrows that as this - Document that class's member as if it were a member of this class.
  • @class - Provide a description of the class (versus the constructor).
  • @constant - Indicate that a variable's value is a constant.
  • @constructor - Identify a function is a constructor.
  • @constructs - Identicate that a lent function will be used as a constructor.
  • @default - Describe the default value of a variable.
  • @deprecated - Indicate use of a variable is no longer supported.
  • @description - Provide a description (synonym for an untagged first-line).
  • @event - Describe an event handled by a class.
  • @example - Provide a small code example, illustrating usage.
  • @extends - Synonym for @augments.
  • @field - Indicate that the variable refers to a non-function.
  • @fileOverview - Provides information about the entire file.
  • @function - Indicate that the variable refers to a function.
  • @ignore - Indicate JsDoc Toolkit should ignore the variable.
  • @inner - Indicate that the variable refers to an inner function (and so is also @private).
  • @lends - Document that all an object literal's members are members of a given class.
  • {@link ...} - Like @see but can be used within the text of other tags.
  • @memberOf - Document that this variable refers to a member of a given class.
  • @name - Force JsDoc Toolkit to ignore the surrounding code and use the given variable name instead.
  • @namespace - Document an object literal is being used as a "namespace."
  • @param - Describe a function's parameter.
  • @private - Indicate a variable is private (use the -p command line option to include these).
  • @property - Document a property of a class from within the constructor's doclet.
  • @public - Indicate an inner variable is public.
  • @requires - Describe a required resource.
  • @returns - Describe the return value of a function.
  • @see - Describe a related resource.
  • @since - Indicate that a feature has only been available on and after a certain version number.
  • @static - Indicate that accessing the variable does not require instantiation of its parent.
  • @throws - Describe the exception that a function might throw.
  • @type - Describe the expected type of a variable's value or the value returned by a function.
  • @version - Indicate the release version of this code.

jsDoc3 tagReference 


@abstract
[TODO] Document the abstract tag
@access
Explicitly specifiy when something is private, protected, or public.
@alias
Document an item under a different name.
@arg
Document a function parameter.
@argument
Document a function parameter.
@augments
This object adds onto a parent object.
@author
Documents the author of an item.
@borrows
This object uses something from another object.
@class
Identifies a class.
@classdesc
Provides a description for the documented class.
@const
Document a constant.
@constant
Document an object as a constant.
@constructor
This function is intended to be called with the 'new' keyword.
@constructs
This function member will be the constructor for the previous class.
@copyright
Document some copyright information.
@default
Document the default value.
@defaultvalue
Document the default value.
@deprecated
Document that this is no longer the preferred way.
@desc
Provide a description for the documented item.
@description
Provide a description for the documented item.
@enum
Document a collection of related properties.
@event
Document an event.
@example
Provide an example of how to use a documented item.
@exception
Document exceptions thrown by a method or function.
@exports
Document the name of a JavaScript module.
@extends
Document that an object adds onto a parent object.
@external
[TODO] Document the external tag
@file
Document a file description.
@fileoverview
Documetn a file description.
@fires
Describe the events this method may fire.
@func
Document a function.
@function
Document a function.
@global
Document a global object.
@host
TODO: Document the host tag.
@ignore
Specify that the item shold not be documented.
@inner
Document an inner object.
@instance
Document an instance member.
@kind
Document what kind of object is being documented.
@lends
[TODO] Document the lends tag
@license
Document the software license that applies to this code.
@member
Document a member.
@memberof
Document that an item is a member of another.
@memberof!
Force documenting an item as a member of another.
@method
Document a method.
@mixes
Document that the object mixes in all the members from another object.
@mixin
Document a mix-in object.
@module
Document a JavaScript module.
@name
Document the name of an object.
@namespace
Document a namespace object.
@overview
Give a description for a file.
@param
Document a function parameter.
@private
Document a method or property as private.
@prop
Document a property of an object.
@property
Document a property of an object.
@protected
Document a method or property as private.
@public
Document a method or property as public.
@readonly
Document that an item is meant to be readonly.
@requires
Document that a JavaScript module requires another JavaScript module.
@return
Document the return value of a function.
@returns
Document the return value of a function.
@see
Refer to some other documentation for more information.
@since
Document when an item was added to the codebase.
@static
Document a static method or property.
@summary
Document a shorter version of the full description.
@this
Document what the this variable refers to in called or applied code.
@throws
Document exceptions thrown by a method or function.
@todo
Document tasks to be completed.
@tutorial
Insert a link to an included tutorial file.
@type
Document the type of an object.
@typedef
Document a custom type.
@undocumented
[TODO] Document the undocumented tag
@var
Document a member.
@variation
[TODO] Document the variation tag
@version
Documents the version number of an item.
@virtual
TODO: Document the virtual tag.




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值