Skip to content

Commit

Permalink
fix: add types to fire.js (#2603)
Browse files Browse the repository at this point in the history
  • Loading branch information
limonte committed Feb 28, 2023
1 parent e99984e commit 86a4753
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/instanceMethods/close.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const handleAwaitingPromise = (instance) => {

/**
* @param {any} resolveValue
* @returns {import('sweetalert2').SweetAlertResult}
* @returns {SweetAlertResult}
*/
const prepareResolveValue = (resolveValue) => {
// When user calls Swal.close()
Expand Down
6 changes: 6 additions & 0 deletions src/staticMethods/fire.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* Main method to create a new SweetAlert2 popup
*
* @param {...SweetAlertOptions} args
* @returns {Promise<SweetAlertResult>}
*/
export function fire(...args) {
const Swal = this // eslint-disable-line @typescript-eslint/no-this-alias
return new Swal(...args)
Expand Down
1 change: 1 addition & 0 deletions src/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @typedef { import('sweetalert2').SweetAlertOptions } SweetAlertOptions
* @typedef { import('sweetalert2').SweetAlertIcon } SweetAlertIcon
* @typedef { import('sweetalert2').SweetAlertInput } SweetAlertInput
* @typedef { import('sweetalert2').SweetAlertResult } SweetAlertResult
*/

/**
Expand Down

0 comments on commit 86a4753

Please sign in to comment.