Jetpack/SDK/Writing Documentation: Difference between revisions

Line 171: Line 171:
=== <code>class</code> ===
=== <code>class</code> ===


<code>class</code> components don't have any special syntax, except that you can nest <code>constructor</code>, <code>method</code>, <code>property</code>, or <code>event</code> components inside them.
<code>class</code> components don't have any special syntax, except that you can nest <code>constructor</code>, <code>method</code>, <code>property</code>, or <code>event</code> components inside them:
 
<api-name="Widget">
@class
Represents a widget object.
    <api name="Widget">
    @constructor
      Creates a new widget.  The widget is immediately added to the add-on bar.
    </api>
    <api name="destroy">
    @method
      Removes the widget from the add-on bar.
    </api>
    <api name="width">
    @property {number}
      The widget's width in pixels.  Setting it updates the widget's appearance
      immediately.
    </api>
    <api name="mouseover">
    @event
    This event is emitted when the user moves the mouse over the widget.
    </api>
</api>


=== <code>property</code> ===
=== <code>property</code> ===
canmove, Confirmed users
737

edits