Skip to content

Commit

Permalink
add return jsdoc to void functions
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j authored and 43081j committed Nov 28, 2017
1 parent 2762760 commit a8105e5
Show file tree
Hide file tree
Showing 20 changed files with 194 additions and 35 deletions.
4 changes: 4 additions & 0 deletions lib/elements/array-selector.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,7 @@
* Deselects the given item if it is already selected.
*
* @param {*} item Item from `items` array to deselect
* @return {void}
*/
deselect(item) {
let idx = this.__selectedMap.get(item);
Expand All @@ -291,6 +292,7 @@
* Deselects the given index if it is already selected.
*
* @param {number} idx Index from `items` array to deselect
* @return {void}
*/
deselectIndex(idx) {
this.deselect(this.items[idx]);
Expand All @@ -301,6 +303,7 @@
* deselect the item if already selected.
*
* @param {*} item Item from `items` array to select
* @return {void}
*/
select(item) {
this.selectIndex(this.items.indexOf(item));
Expand All @@ -311,6 +314,7 @@
* deselect the item if already selected.
*
* @param {number} idx Index from `items` array to select
* @return {void}
*/
selectIndex(idx) {
let item = this.items[idx];
Expand Down
1 change: 1 addition & 0 deletions lib/elements/dom-bind.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@
/**
* Forces the element to render its content. This is typically only
* necessary to call if HTMLImports with the async attribute are used.
* @return {void}
*/
render() {
let template;
Expand Down
1 change: 1 addition & 0 deletions lib/elements/dom-if.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@
* that multiple changes trigger only a single render. The render method
* should be called if, for example, template rendering is required to
* validate application state.
* @return {void}
*/
render() {
Polymer.flush();
Expand Down
1 change: 1 addition & 0 deletions lib/elements/dom-module.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
* when a dom-module is imperatively created. For
* example, `document.createElement('dom-module').register('foo')`.
* @param {string=} id The id at which to register the dom-module.
* @return {void}
*/
register(id) {
id = id || this.id;
Expand Down
1 change: 1 addition & 0 deletions lib/elements/dom-repeat.html
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@
* that multiple changes trigger only a single render. The render method
* should be called if, for example, template rendering is required to
* validate application state.
* @return {void}
*/
render() {
// Queue this repeater, then flush all in order
Expand Down
11 changes: 11 additions & 0 deletions lib/legacy/legacy-element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@
* @param {string} property Property name to reflect.
* @param {string=} attribute Attribute name to reflect.
* @param {*=} value Property value to reflect.
* @return {void}
*/
reflectPropertyToAttribute(property, attribute, value) {
this._propertyToAttribute(property, attribute, value);
Expand All @@ -264,6 +265,7 @@
* @param {*} value Value to serialize.
* @param {string} attribute Attribute name to serialize to.
* @param {Element} node Element to set attribute to.
* @return {void}
*/
serializeValueToAttribute(value, attribute, node) {
this._valueToNodeAttribute(/** @type {Element} */ (node || this), value, attribute);
Expand Down Expand Up @@ -382,6 +384,7 @@
* @param {Element} node Element to add event listener to.
* @param {string} eventName Name of event to listen for.
* @param {string} methodName Name of handler method on `this` to call.
* @return {void}
*/
listen(node, eventName, methodName) {
node = /** @type {!Element} */ (node || this);
Expand All @@ -407,6 +410,7 @@
* @param {string} eventName Name of event to stop listening to.
* @param {string} methodName Name of handler method on `this` to not call
anymore.
* @return {void}
*/
unlisten(node, eventName, methodName) {
node = /** @type {!Element} */ (node || this);
Expand All @@ -432,6 +436,7 @@
* Defaults to `all`.
* @param {Element=} node Element to apply scroll direction setting.
* Defaults to `this`.
* @return {void}
*/
setScrollDirection(direction, node) {
Polymer.Gestures.setTouchAction(/** @type {Element} */ (node || this), DIRECTION_MAP[direction] || 'auto');
Expand Down Expand Up @@ -465,6 +470,7 @@
* Force this element to distribute its children to its local dom.
* This should not be necessary as of Polymer 2.0.2 and is provided only
* for backwards compatibility.
* @return {void}
*/
distributeContent() {
if (window.ShadyDOM && this.shadowRoot) {
Expand Down Expand Up @@ -677,6 +683,7 @@
* Immediately calls the debouncer `callback` and inactivates it.
*
* @param {string} jobName The name of the debouncer started with `debounce`
* @return {void}
*/
flushDebouncer(jobName) {
this._debouncers = this._debouncers || {};
Expand All @@ -690,6 +697,7 @@
* Cancels an active debouncer. The `callback` will not be called.
*
* @param {string} jobName The name of the debouncer started with `debounce`
* @return {void}
*/
cancelDebouncer(jobName) {
this._debouncers = this._debouncers || {};
Expand Down Expand Up @@ -721,6 +729,7 @@
*
* @param {number} handle Handle returned from original `async` call to
* cancel.
* @return {void}
*/
cancelAsync(handle) {
handle < 0 ? Polymer.Async.microTask.cancel(~handle) :
Expand Down Expand Up @@ -833,6 +842,7 @@
* @param {string} transformText Transform setting.
* @param {Element=} node Element to apply the transform to.
* Defaults to `this`
* @return {void}
*/
transform(transformText, node) {
node = /** @type {Element} */ (node || this);
Expand All @@ -849,6 +859,7 @@
* @param {number} z Z offset.
* @param {Element=} node Element to apply the transform to.
* Defaults to `this`.
* @return {void}
*/
translate3d(x, y, z, node) {
node = /** @type {Element} */ (node || this);
Expand Down
2 changes: 2 additions & 0 deletions lib/legacy/polymer.dom.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,15 @@
*
* @param {Polymer.FlattenedNodesObserver} observerHandle Observer instance
* to disconnect.
* @return {void}
*/
unobserveNodes(observerHandle) {
observerHandle.disconnect();
}

/**
* Provided as a backwards-compatible API only. This method does nothing.
* @return {void}
*/
notifyObserver() {}

Expand Down
1 change: 1 addition & 0 deletions lib/legacy/templatizer-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
* @param {boolean=} mutableData When `true`, the generated class will skip
* strict dirty-checking for objects and arrays (always consider them to
* be "dirty"). Defaults to false.
* @return {void}
* @this {TemplatizerUser}
*/
templatize(template, mutableData) {
Expand Down
9 changes: 9 additions & 0 deletions lib/mixins/element-mixin.html
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@
* and calling `klass.finalize()`.
*
* @param {PolymerElementConstructor} klass Element class
* @return {void}
* @private
*/
function finalizeClassAndSuper(klass) {
Expand All @@ -247,6 +248,7 @@
* `template` for stamping.
*
* @param {PolymerElementConstructor} klass Element class
* @return {void}
* @private
*/
function finalizeClass(klass) {
Expand Down Expand Up @@ -287,6 +289,7 @@
* and effects to
* @param {Object} properties Flattened bag of property descriptors for
* this class
* @return {void}
* @private
*/
function finalizeProperties(proto, properties) {
Expand All @@ -305,6 +308,7 @@
* @param {Object} dynamicFns Object containing keys for any properties
* that are functions and should trigger the effect when the function
* reference is changed
* @return {void}
* @private
*/
function finalizeObservers(proto, observers, dynamicFns) {
Expand Down Expand Up @@ -369,6 +373,7 @@
* Supported keys:
* @param {Object} allProps Flattened map of all properties defined in this
* element (including inherited properties)
* @return {void}
* @private
*/
function createPropertyFromConfig(proto, name, info, allProps) {
Expand Down Expand Up @@ -468,6 +473,7 @@
* creating property accessors and any property effect metadata needed for
* the features used.
*
* @return {void}
* @public
*/
static finalize() {
Expand Down Expand Up @@ -626,6 +632,7 @@
* style scoping.
*
* @param {string} is Tag name (or type extension name) for this element
* @return {void}
* @protected
*/
static _finalizeTemplate(is) {
Expand Down Expand Up @@ -766,6 +773,7 @@
*
* @param {Object=} properties Bag of custom property key/values to
* apply to this element.
* @return {void}
* @suppress {invalidCasts}
*/
updateStyles(properties) {
Expand Down Expand Up @@ -873,6 +881,7 @@
*
* @param {Object=} props Bag of custom property key/values to
* apply to the document.
* @return {void}
*/
Polymer.updateStyles = function(props) {
if (window.ShadyCSS) {
Expand Down
16 changes: 15 additions & 1 deletion lib/mixins/property-accessors.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
*
* @param {Object} model Prototype or instance
* @param {string} property Name of property
* @return {void}
* @private
*/
function saveAccessorValue(model, property) {
Expand Down Expand Up @@ -110,6 +111,7 @@
* Attribute names are mapped to property names using the `dash-case` to
* `camelCase` convention
*
* @return {void}
*/
static createPropertiesForAttributes() {
let a$ = this.observedAttributes;
Expand Down Expand Up @@ -165,6 +167,7 @@
* Provided as an override point for performing any setup work prior
* to initializing the property accessor system.
*
* @return {void}
* @protected
*/
_initializeProperties() {
Expand Down Expand Up @@ -202,6 +205,7 @@
*
* @param {Object} props Bag of property values that were overwritten
* when creating property accessors.
* @return {void}
* @protected
*/
_initializeProtoProperties(props) {
Expand All @@ -220,6 +224,7 @@
*
* @param {Object} props Bag of property values that were overwritten
* when creating property accessors.
* @return {void}
* @protected
*/
_initializeInstanceProperties(props) {
Expand All @@ -233,6 +238,7 @@
*
* @param {string} attribute Name of attribute to ensure is set.
* @param {string} value of the attribute.
* @return {void}
*/
_ensureAttribute(attribute, value) {
if (!this.hasAttribute(attribute)) {
Expand All @@ -249,6 +255,7 @@
* @param {string} attribute Name of attribute to deserialize.
* @param {?string} value of the attribute.
* @param {*=} type type to deserialize to.
* @return {void}
*/
_attributeToProperty(attribute, value, type) {
// Don't deserialize back to property if currently reflecting
Expand All @@ -264,6 +271,7 @@
* @param {string} property Property name to reflect.
* @param {string=} attribute Attribute name to reflect.
* @param {*=} value Property value to refect.
* @return {void}
*/
_propertyToAttribute(property, attribute, value) {
this.__serializing = true;
Expand All @@ -284,6 +292,7 @@
* @param {Element} node Element to set attribute to.
* @param {*} value Value to serialize.
* @param {string} attribute Attribute name to serialize to.
* @return {void}
*/
_valueToNodeAttribute(node, value, attribute) {
let str = this._serializeValue(value);
Expand Down Expand Up @@ -407,6 +416,7 @@
* @param {string} property Name of the property
* @param {boolean=} readOnly When true, no setter is created; the
* protected `_setProperty` function must be used to set the property
* @return {void}
* @protected
*/
_createPropertyAccessor(property, readOnly) {
Expand Down Expand Up @@ -447,6 +457,7 @@
*
* @param {string} property Name of the property
* @param {*} value Value to set
* @return {void}
* @protected
*/
_setProperty(property, value) {
Expand Down Expand Up @@ -499,6 +510,7 @@
* Marks the properties as invalid, and enqueues an async
* `_propertiesChanged` callback.
*
* @return {void}
* @protected
*/
_invalidateProperties() {
Expand All @@ -520,6 +532,8 @@
* For elements, generally `connectedCallback` is a normal spot to do so.
* It is safe to call this method multiple times as it only turns on
* property accessors once.
*
* @return {void}
*/
_enableProperties() {
if (!this.__dataEnabled) {
Expand All @@ -538,7 +552,7 @@
* set), and resets the pending set of changes. Generally, this method
* should not be called in user code.
*
*
* @return {void}
* @protected
*/
_flushProperties() {
Expand Down
Loading

0 comments on commit a8105e5

Please sign in to comment.