Skip to content

Commit 1400e07

Browse files
committed
Merge pull request DefinitelyTyped#4247 from ToastHawaii/master
Update sweetalert type definition to 1.0.0-beta
2 parents 1c18e97 + 7d7eea8 commit 1400e07

File tree

2 files changed

+17
-4
lines changed

2 files changed

+17
-4
lines changed

sweetalert/sweetalert-tests.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ swal({
7272
type: "input",
7373
showCancelButton: true,
7474
closeOnConfirm: false,
75-
animation: "slide-from-top"
75+
animation: "slide-from-top",
76+
inputPlaceholder: "Write something"
7677
},
7778
function (inputValue) {
7879
if (inputValue === false) return false;

sweetalert/sweetalert.d.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Type definitions for SweetAlert 0.5.0
1+
// Type definitions for SweetAlert 1.0.0-beta
22
// Project: https://github.com/t4t5/sweetalert/
33
// Definitions by: Markus Peloso <https://github.com/ToastHawaii/>
44
// Definitions: https://github.com/borisyankov/DefinitelyTyped
@@ -28,7 +28,7 @@ declare module SweetAlert {
2828
* If set to true, the user can dismiss the modal by pressing the Escape key.
2929
* Default: true
3030
*/
31-
allowEsxcapeKey?: boolean;
31+
allowEscapeKey?: boolean;
3232

3333
/**
3434
* A custom CSS class for the modal.
@@ -78,6 +78,12 @@ declare module SweetAlert {
7878
*/
7979
closeOnConfirm?: boolean;
8080

81+
/**
82+
* Set to false if you want the modal to stay open even if the user presses the "Cancel"-button. This is especially useful if the function attached to the "Cancel"-button is another SweetAlert.
83+
* Default: true
84+
*/
85+
closeOnCancel?: boolean;
86+
8187
/**
8288
* Add a customized icon for the modal.Should contain a string with the path to the image.
8389
* Default: null
@@ -104,7 +110,7 @@ declare module SweetAlert {
104110

105111
/**
106112
* If set to false, the modal's animation will be disabled. Possible animations: "slide-from-top", "slide-from-bottom", "pop" (use true instead) and "none" (use false instead).
107-
* Default: true, "pop"
113+
* Default: true
108114
*/
109115
animation?: boolean | string;
110116

@@ -113,6 +119,12 @@ declare module SweetAlert {
113119
* Default: "text"
114120
*/
115121
inputType?: string;
122+
123+
/**
124+
* When using the input-type, you can specify a placeholder to help the user.
125+
* Default: null
126+
*/
127+
inputPlaceholder?: string;
116128
}
117129

118130
interface Settings extends SettingsBase {

0 commit comments

Comments
 (0)