From bfd0d56369fa87381e9051c2ea391cb0ede0744f Mon Sep 17 00:00:00 2001 From: Anastasios Chatzialexiou <16361161+tasxatzial@users.noreply.github.com> Date: Thu, 18 Apr 2024 23:50:44 +0300 Subject: [PATCH] update docstrings --- src/js/animationFrame.js | 2 +- src/js/transition.js | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/js/animationFrame.js b/src/js/animationFrame.js index 1dafed4..8bf2672 100644 --- a/src/js/animationFrame.js +++ b/src/js/animationFrame.js @@ -51,7 +51,7 @@ import KeyboardUtils from './keyboardUtils.js'; * @param {Function} onHoldComplete * Runs when the hold phase is completed or cancelled. * @param {number} duration - * Time in ms needed for a completed (not cancelled) hold phase. + * Required duration (ms) for a completed (not cancelled) hold phase. * @return {ClickAndHoldAPI} * @throws {Error} * If the element already has click-and-hold functionality. diff --git a/src/js/transition.js b/src/js/transition.js index 8dcb048..b01abc2 100644 --- a/src/js/transition.js +++ b/src/js/transition.js @@ -1,5 +1,11 @@ import KeyboardUtils from './keyboardUtils.js'; +/** + * Runs when the hold phase is completed or cancelled. + * @callback onHoldComplete + * @param {boolean} isComplete + * True only if the hold phase has been completed, else false. + */ /** * The returned object of {@link ClickAndHold}. @@ -30,9 +36,9 @@ import KeyboardUtils from './keyboardUtils.js'; * @param {HTMLElement} element * The target click-and-hold element. * @param {Function} onHoldComplete - * Runs when the hold phase is completed (not cancelled). + * Runs when the hold phase is completed or cancelled. * @param {number} duration - * Time in ms needed to trigger onHoldCompleted. + * Required duration (ms) for a completed (not cancelled) hold phase. * @return {ClickAndHoldAPI} * @throws {Error} * If the element already has click-and-hold functionality.