From c8715b50b9069deca0fd1f8597882a76342b44ac Mon Sep 17 00:00:00 2001 From: Russell Bicknell Date: Mon, 27 Apr 2020 18:35:14 -0700 Subject: [PATCH 1/2] Fix TypeScript breakages by specifying types for overridden `setAttribute` and `getAttribute`. --- lib/legacy/legacy-element-mixin.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/legacy/legacy-element-mixin.js b/lib/legacy/legacy-element-mixin.js index 8e38e62940..e2e136cba3 100644 --- a/lib/legacy/legacy-element-mixin.js +++ b/lib/legacy/legacy-element-mixin.js @@ -143,7 +143,11 @@ export const LegacyElementMixin = dedupingMixin((base) => { } } - /** @override */ + /** + * @override + * @param {string} name + * @param {string} value + */ setAttribute(name, value) { if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) { const oldValue = this.getAttribute(name); @@ -155,7 +159,10 @@ export const LegacyElementMixin = dedupingMixin((base) => { } } - /** @override */ + /** + * @override + * @param {string} name + */ removeAttribute(name) { if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) { const oldValue = this.getAttribute(name); From 370ae5ebabb3cd52fb084a00a94f2454312cfb98 Mon Sep 17 00:00:00 2001 From: Russell Bicknell Date: Mon, 27 Apr 2020 18:43:35 -0700 Subject: [PATCH 2/2] Add method / parameter descriptions. --- lib/legacy/legacy-element-mixin.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/legacy/legacy-element-mixin.js b/lib/legacy/legacy-element-mixin.js index e2e136cba3..cfa17c6f0d 100644 --- a/lib/legacy/legacy-element-mixin.js +++ b/lib/legacy/legacy-element-mixin.js @@ -144,9 +144,10 @@ export const LegacyElementMixin = dedupingMixin((base) => { } /** + * Sets the value of an attribute. * @override - * @param {string} name - * @param {string} value + * @param {string} name The name of the attribute to change. + * @param {string} value The new attribute value. */ setAttribute(name, value) { if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) { @@ -160,8 +161,9 @@ export const LegacyElementMixin = dedupingMixin((base) => { } /** + * Removes an attribute. * @override - * @param {string} name + * @param {string} name The name of the attribute to remove. */ removeAttribute(name) { if (legacyNoObservedAttributes && !this._legacyForceObservedAttributes) {