Skip to content

Commit 86d2eeb

Browse files
author
Steven Orvell
committed
Fix jsdoc issues.
1 parent 8a11c8c commit 86d2eeb

11 files changed

Lines changed: 86 additions & 27 deletions

lib/elements/dom-module.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@
5454
static get observedAttributes() { return ['id'] }
5555

5656
/**
57-
* Retrieves the dom specified by `selector` in the module specified by
58-
* `id`. For example, this.import('foo', 'img');
59-
* @method register
60-
* @param {string} id
61-
* @param {string=} selector
62-
* @return {Element} Returns the dom which matches `selector` in the module
63-
* at the specified `id`.
57+
* Retrieves the element specified by the css `selector` in the module
58+
* registered by `id`. For example, this.import('foo', 'img');
59+
* @method import
60+
* @param {string} id The id of the dom-module in which to search.
61+
* @param {string=} selector The css selector by which to find the element.
62+
* @return {Element} Returns the element which matches `selector` in the
63+
* module registered at the specified `id`.
6464
*/
6565
static import(id, selector) {
6666
if (id) {

lib/elements/dom-repeat.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,8 +448,8 @@
448448
}
449449

450450
/**
451-
* @param {function()} fn
452-
* @param {number=} delay
451+
* @param {function()} fn Function to debounce.
452+
* @param {number=} delay Delay in ms to debounce by.
453453
*/
454454
__debounceRender(fn, delay) {
455455
this.__renderDebouncer = Polymer.Debouncer.debounce(

lib/legacy/class.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@
3535
* to ensure that any legacy behaviors can rely on legacy Polymer API on
3636
* the underlying element.
3737
*
38-
* @param {Object|Array} behaviors Behavior object or array of behaviors
39-
* @param {HTMLElement} klass Element class
38+
* @param {Object|Array} behaviors Behavior object or array of behaviors.
39+
* @param {HTMLElement} klass Element class.
40+
* @returns {HTMLElement} Returns a new Element class extended by the
41+
* passed in `behaviors` and also by `Polymer.LegacyElementMixin`.
4042
* @memberof Polymer
4143
*/
4244
function mixinBehaviors(behaviors, klass) {
@@ -105,9 +107,10 @@
105107
}
106108

107109
/**
108-
* @param {Array} behaviors
109-
* @param {Array=} list
110-
* @param {Array=} exclude
110+
* @param {Array} behaviors List of behaviors to flatten.
111+
* @param {Array=} list Target list to flatten behaviors into.
112+
* @param {Array=} exclude List of behaviors to exclude from the list.
113+
* @returns {Array} Returns the list of flattened behaviors.
111114
*/
112115
function flattenBehaviors(behaviors, list, exclude) {
113116
list = list || [];

lib/legacy/legacy-element-mixin.html

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@
192192
*
193193
* @param {string} value String to deserialize
194194
* @param {*} type Type to deserialize the string to
195+
* @returns {*} Returns the deserialized value in the `type` given.
195196
*/
196197
deserialize(value, type) {
197198
return this._deserializeValue(value, type);
@@ -272,10 +273,15 @@
272273
*
273274
* Note this method is provided as backward-compatible legacy API
274275
* only. It is not directly called by any Polymer features.
275-
*/
276-
chainObject(object, inherited) {
277-
if (object && inherited && object !== inherited) {
278-
object.__proto__ = inherited;
276+
* @param {Object} object The object on which to set the prototype.
277+
* @param {Object} prototype The prototype that will be set on the given
278+
* `object`.
279+
* @returns {Object} Returns the given `object` with its prototype set
280+
* to the given `prototype` object.
281+
*/
282+
chainObject(object, prototype) {
283+
if (object && prototype && object !== prototype) {
284+
object.__proto__ = prototype;
279285
}
280286
return object;
281287
}
@@ -582,8 +588,9 @@
582588

583589
/**
584590
* Returns the computed style value for the given property.
585-
* @param {String} property
586-
* @return {String} the computed value
591+
* @param {String} property The css property name.
592+
* @returns {String} Returns the computed css property value for the given
593+
* `property`.
587594
*/
588595
getComputedStyleValue(property) {
589596
return styleInterface.getComputedStyleValue(this, property);
@@ -610,6 +617,11 @@
610617
* context) when the wait time elapses.
611618
* @param {number} wait Optional wait time in milliseconds (ms) after the
612619
* last signal that must elapse before invoking `callback`
620+
* @returns {Object} Returns a debouncer object on which exists the
621+
* following methods: `isActive()` returns true if the debouncer is
622+
* active; `cancel()` cancels the debouncer if it is active;
623+
* `flush()` immediately invokes the debounced callback if the debouncer
624+
* is active.
613625
*/
614626
debounce(jobName, callback, wait) {
615627
this._debouncers = this._debouncers || {};

lib/legacy/templatizer-behavior.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
* @param {Boolean=} mutableData When `true`, the generated class will skip
8888
* strict dirty-checking for objects and arrays (always consider them to
8989
* be "dirty"). Defaults to false.
90-
* @return {TemplateInstance} Description
9190
*/
9291
templatize(template, mutableData) {
9392
this._templatizerTemplate = template;
@@ -109,6 +108,8 @@
109108
*
110109
* @param {Object=} model Object containing initial property values to
111110
* populate into the template bindings.
111+
* @return {TemplateInstanceBase} Returns the created instance of
112+
* the template prepared by `templatize`.
112113
*/
113114
stamp(model) {
114115
return new this.ctor(model);

lib/utils/array-splice.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,23 @@
147147
* Complexity: O(l * p)
148148
* l: The length of the current array
149149
* p: The length of the old array
150+
*
151+
* @param {Array} current The current "changed" array for which to
152+
* calculate splices.
153+
* @param {Integer} currentStart Starting index in the `current` array for
154+
* which splices are calculated.
155+
* @param {Integer} currentEnd Ending index in the `current` array for
156+
* which splices are calculated.
157+
* @param {Array} old The original "unchanged" array to compare `current`
158+
* against to determine splices.
159+
* @param {Integer} oldStart Starting index in the `old` array for
160+
* which splices are calculated.
161+
* @param {Integer} oldEnd Ending index in the `old` array for
162+
* which splices are calculated.
163+
* @return {Array} Returns an array of splice record objects. Each of these
164+
* contains: `index` the location where the splice occurred; `removed`
165+
* the array of removed items from this location; `addedCount` the number
166+
* of items added at this location.
150167
*/
151168
calcSplices(current, currentStart, currentEnd,
152169
old, oldStart, oldEnd) {
@@ -286,6 +303,14 @@
286303
* non-shared portions of the arrays.
287304
*
288305
* @memberof Polymer.ArraySplice
306+
* @param {Array} current The "changed" array for which splices will be
307+
* calculated.
308+
* @param {Array} previous The "unchanged" original array to compare
309+
* `current` against to determine the splices.
310+
* @return {Array} Returns an array of splice record objects. Each of these
311+
* contains: `index` the location where the splice occurred; `removed`
312+
* the array of removed items from this location; `addedCount` the number
313+
* of items added at this location.
289314
*/
290315
calculateSplices(current, previous) {
291316
return ArraySplice.calculateSplices(current, previous);

lib/utils/mixin.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
/**
2323
* Given a mixin producing function, memoize applications of mixin to base
2424
* @private
25+
* @param {Object} mixin Mixin for which to create a caching mixin.
26+
* @returns {Object} Returns a mixin which when applied multiple times to the
27+
* same base will always return the same extended class.
2528
*/
2629
function cachingMixin(mixin) {
2730
return function(base) {

lib/utils/path.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,9 @@
7676
* ```
7777
*
7878
* @memberof Polymer.Path
79-
* @param {string} path Path string
80-
* @return {boolean} True if `path` is an ancestor of `base`
79+
* @param {string} base Path string to test against.
80+
* @param {string} path Path string to test.
81+
* @return {boolean} True if `path` is an ancestor of `base`.
8182
*/
8283
isAncestor: function(base, path) {
8384
// base.startsWith(path + '.');
@@ -96,6 +97,9 @@
9697
* ```
9798
*
9899
* @memberof Polymer.Path
100+
* @param {string} base Path string to test against.
101+
* @param {string} path Path string to test.
102+
* @return {boolean} True if `path` is a descendant of `base`.
99103
*/
100104
isDescendant: function(base, path) {
101105
// path.startsWith(base + '.');

lib/utils/style-gather.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
* Returns CSS text of styles in a space-separated list of `dom-module`s.
3737
*
3838
* @memberof Polymer.StyleGather
39-
* @param {string} moduleIds
39+
* @param {string} moduleIds List of dom-module id's within which to
40+
* search for css.
4041
* @return {string} Concatenated CSS content from specified `dom-module`s
4142
*/
4243
cssFromModules(moduleIds) {

lib/utils/templatize.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@
6262
}
6363
}
6464
/**
65+
* Configure the given `props` by calling `_setPendingProperty`. Also
66+
* sets any properties stored in `__hostProps`.
6567
* @private
68+
* @param {Object} props Object of property name-value pairs to set.
6669
*/
6770
_configureProperties(props) {
6871
let options = this.__templatizeOptions;
@@ -113,6 +116,11 @@
113116
}
114117
}
115118
/**
119+
* Shows or hides the template instance top level child elements. For
120+
* text nodes, `textContent` is removed while "hidden" and replaced when
121+
* "shown."
122+
* @param {boolean} hide Set to true to hide the children;
123+
* set to false to show them.
116124
* @protected
117125
*/
118126
_showHideChildren(hide) {
@@ -411,8 +419,9 @@
411419
/**
412420
* Returns the template "model" associated with a given element, which
413421
* serves as the binding scope for the template instance the element is
414-
* contained in. A template model is an instance of `Polymer.Base`, and
415-
* should be used to manipulate data associated with this template instance.
422+
* contained in. A template model is an instance of
423+
* `TemplateInstanceBase`, and should be used to manipulate data
424+
* associated with this template instance.
416425
*
417426
* Example:
418427
*
@@ -423,6 +432,7 @@
423432
*
424433
* @memberof Polymer.Templatize
425434
* @method modelForElement
435+
* @param {HTMLElement} host
426436
* @param {HTMLElement} el Element for which to return a template model.
427437
* @return {TemplateInstanceBase} Template instance representing the
428438
* binding scope for the element

0 commit comments

Comments
 (0)