-
Notifications
You must be signed in to change notification settings - Fork 240
@cfg
(Updated for JSDuck 4)
Synopsis:
@cfg
Documentation for the config option.
@cfg name
Documentation for the config option.
@cfg {Type} name
Documentation for the config option.
@cfg {Type} name (required)
Documentation for the config option.
@cfg {Type} [name="default value"]
Documentation for the config option.
@cfg {Type} name.subproperty
Documentation for the config option subproperty.
Documents the config option: its name, type and default value.
Example:
/**
* @cfg {Boolean} [hidden=false]
* True to hide panel initially.
*/
See the auto-detection documentation for @property. The only difference with config options is that you need to always include @cfg
tag - otherwise it will be treated as a property.
The syntax is the same as used for @param
tag:
/**
* @cfg user A user record
* @cfg user.name The name of the user.
* @cfg user.email The email of the user.
*/
user: {},
See @param for more details. Configs of Function type are an odd case, but if you really want to, you can have them and even document the parameters.
All config options (as the name tells) are optional by default. To document them as required add (required)
after the name:
/**
* @cfg {Ext.data.Store} store (required)
*/
Ext4 generates get/set accessor methods for the configs defined inside config: {}
block. JSDuck 4 will recognize this automatically, but when it doesn't an @accessor and @evented tags can be used.