Skip to content

Commit

Permalink
fix: add types to Timer.js (#2482)
Browse files Browse the repository at this point in the history
  • Loading branch information
limonte committed Sep 5, 2022
1 parent 0ed2d23 commit b785030
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
38 changes: 19 additions & 19 deletions src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,27 @@

/**
* @typedef GlobalState
* @prop {SweetAlert2} [currentInstance]
* @prop {Element} [previousActiveElement]
* @prop {Timer} [timeout]
* @prop {NodeJS.Timeout} [restoreFocusTimeout]
* @prop {(this: HTMLElement, event: KeyboardEvent) => any} [keydownHandler]
* @prop {HTMLElement | (Window & typeof globalThis)} [keydownTarget]
* @prop {boolean} [keydownHandlerAdded]
* @prop {boolean} [keydownListenerCapture]
* @prop {function} [swalCloseEventFinishedCallback]
* @property {SweetAlert2} [currentInstance]
* @property {Element} [previousActiveElement]
* @property {Timer} [timeout]
* @property {NodeJS.Timeout} [restoreFocusTimeout]
* @property {(this: HTMLElement, event: KeyboardEvent) => any} [keydownHandler]
* @property {HTMLElement | (Window & typeof globalThis)} [keydownTarget]
* @property {boolean} [keydownHandlerAdded]
* @property {boolean} [keydownListenerCapture]
* @property {Function} [swalCloseEventFinishedCallback]
*/

/**
* @typedef DomCache
* @prop {HTMLElement} popup
* @prop {HTMLElement} container
* @prop {HTMLElement} actions
* @prop {HTMLElement} confirmButton
* @prop {HTMLElement} denyButton
* @prop {HTMLElement} cancelButton
* @prop {HTMLElement} loader
* @prop {HTMLElement} closeButton
* @prop {HTMLElement} validationMessage
* @prop {HTMLElement} progressSteps
* @property {HTMLElement} popup
* @property {HTMLElement} container
* @property {HTMLElement} actions
* @property {HTMLElement} confirmButton
* @property {HTMLElement} denyButton
* @property {HTMLElement} cancelButton
* @property {HTMLElement} loader
* @property {HTMLElement} closeButton
* @property {HTMLElement} validationMessage
* @property {HTMLElement} progressSteps
*/
4 changes: 4 additions & 0 deletions src/utils/Timer.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
export default class Timer {
/**
* @param {Function} callback
* @param {number} delay
*/
constructor(callback, delay) {
this.callback = callback
this.remaining = delay
Expand Down

0 comments on commit b785030

Please sign in to comment.