fix: refactor missing type EventHandlerNonNull

This commit is contained in:
jorenbroekema 2021-10-06 22:36:32 +02:00
parent 0fc9edfbc2
commit d963e74e1b
5 changed files with 18 additions and 10 deletions

View file

@ -0,0 +1,8 @@
---
'@lion/accordion': patch
'@lion/core': patch
'@lion/form-core': patch
'@lion/tabs': patch
---
Fix type error, EventHandlerNonNull got removed it seems. (event: Event) => unknown; instead is fine.

View file

@ -7,8 +7,8 @@ import { LitElement, css, html } from '@lion/core';
* @property {number} index index of the node * @property {number} index index of the node
* @property {HTMLElement} invoker invoker node * @property {HTMLElement} invoker invoker node
* @property {HTMLElement} content content node * @property {HTMLElement} content content node
* @property {EventHandlerNonNull} clickHandler executed on click event * @property {(event: Event) => unknown} clickHandler executed on click event
* @property {EventHandlerNonNull} keydownHandler executed on keydown event * @property {(event: Event) => unknown} keydownHandler executed on keydown event
*/ */
const uuid = () => Math.random().toString(36).substr(2, 10); const uuid = () => Math.random().toString(36).substr(2, 10);

View file

@ -8,7 +8,7 @@ import { dedupeMixin } from '@open-wc/dedupe-mixin';
/** /**
* @typedef DelegateEvent * @typedef DelegateEvent
* @property {string} type - Type of event * @property {string} type - Type of event
* @property {EventHandlerNonNull} handler - Event arguments * @property {(event: Event) => unknown} handler - Event arguments
* @property {boolean | AddEventListenerOptions} [opts] * @property {boolean | AddEventListenerOptions} [opts]
*/ */
@ -63,7 +63,7 @@ const DelegateMixinImplementation = superclass =>
/** /**
* @param {string} type * @param {string} type
* @param {EventHandlerNonNull} handler * @param {(event: Event) => unknown} handler
* @param {boolean | AddEventListenerOptions} [opts] * @param {boolean | AddEventListenerOptions} [opts]
*/ */
addEventListener(type, handler, opts) { addEventListener(type, handler, opts) {

View file

@ -104,13 +104,13 @@ const InteractionStateMixinImplementation = superclass =>
this._valueChangedEvent = 'model-value-changed'; this._valueChangedEvent = 'model-value-changed';
/** /**
* @type {EventHandlerNonNull} * @type {(event: Event) => unknown}
* @protected * @protected
*/ */
this._iStateOnLeave = this._iStateOnLeave.bind(this); this._iStateOnLeave = this._iStateOnLeave.bind(this);
/** /**
* @type {EventHandlerNonNull} * @type {(event: Event) => unknown}
* @protected * @protected
*/ */
this._iStateOnValueChange = this._iStateOnValueChange.bind(this); this._iStateOnValueChange = this._iStateOnValueChange.bind(this);

View file

@ -6,9 +6,9 @@ import { css, html, LitElement } from '@lion/core';
* @property {string} uid Unique ID for the entry * @property {string} uid Unique ID for the entry
* @property {HTMLElement} button Button HTMLElement for the entry * @property {HTMLElement} button Button HTMLElement for the entry
* @property {HTMLElement} panel Panel HTMLElement for the entry * @property {HTMLElement} panel Panel HTMLElement for the entry
* @property {EventHandlerNonNull} clickHandler executed on click event * @property {(event: Event) => unknown} clickHandler executed on click event
* @property {EventHandlerNonNull} keydownHandler executed on keydown event * @property {(event: Event) => unknown} keydownHandler executed on keydown event
* @property {EventHandlerNonNull} keyupHandler executed on keyup event * @property {(event: Event) => unknown} keyupHandler executed on keyup event
*/ */
function uuid() { function uuid() {
@ -237,7 +237,7 @@ export class LionTabs extends LitElement {
/** /**
* @param {number} index * @param {number} index
* @returns {EventHandlerNonNull} * @returns {(event: Event) => unknown}
* @private * @private
*/ */
__createButtonClickHandler(index) { __createButtonClickHandler(index) {