t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.4k stars 2.84k forks source link

Fix Button Interface Typings #774

Closed alex-osman closed 6 years ago

alex-osman commented 6 years ago

Issue

Fixes #763: Button typings were not full

Solution

Added typings for all valid combinations.

Allows for variations of the following:

swal({
  buttons: [true, true],                              // booleans
  buttons: ['Stay on this page', 'Continue'],         // strings
  buttons: [true, 'Delete'],                          // both

  buttons: {                                          // ButtonList
    cancel: true,                                     // boolean
    confirm: {                                        // ButtonOptions
      ....
    }
  }
})
Klerith commented 6 years ago

Please made this changes I am getting the same issue on TypeScript

screen shot 2017-12-04 at 1 43 49 pm
alex-osman commented 6 years ago

bump @t4t5

t4t5 commented 6 years ago

Thx!