diff --git a/src/WebComponent.js b/src/WebComponent.js index f9a661b..44d9480 100644 --- a/src/WebComponent.js +++ b/src/WebComponent.js @@ -22,6 +22,7 @@ export class WebComponent extends HTMLElement { /** * Read-only property containing camelCase counterparts of observed attributes. + * @typedef {{[name: string]: any}} PropStringMap * @see https://www.npmjs.com/package/web-component-base#prop-access * @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset * @type {PropStringMap} @@ -52,6 +53,11 @@ export class WebComponent extends HTMLElement { /** * Triggered when an attribute value changes + * @typedef {{ + * property: string, + * previousValue: any, + * currentValue: any + * }} Changes * @param {Changes} changes */ onChanges(changes) {} @@ -173,12 +179,3 @@ export class WebComponent extends HTMLElement { } export default WebComponent; - -/** - * @typedef {{ - * property: string, - * previousValue: any, - * currentValue: any - * }} Changes - * @typedef {{[name: string]: any}} PropStringMap - */ diff --git a/src/attach-effect.js b/src/attach-effect.js index 94cab43..28165c6 100644 --- a/src/attach-effect.js +++ b/src/attach-effect.js @@ -1,7 +1,5 @@ /** - * - * @typedef { import('./WebComponent.js').Changes} Changes - * @typedef { import('./WebComponent.js').PropStringMap} PropStringMap + * Attach a "side effect" function that gets triggered on property value changes * @param {Object} obj * @param {(newValue: any) => void} callback */