mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Update sweetalert definitions to 1.1.0
This commit is contained in:
parent
855569dbc8
commit
9616e043e6
@ -91,8 +91,27 @@ swal({
|
||||
}
|
||||
);
|
||||
|
||||
// With a loader (for AJAX request for example)
|
||||
swal({
|
||||
title: "Ajax request example",
|
||||
text: "Submit to run ajax request",
|
||||
type: "info",
|
||||
showCancelButton: true,
|
||||
closeOnConfirm: false,
|
||||
showLoaderOnConfirm: true
|
||||
},
|
||||
function () {
|
||||
setTimeout(function () {
|
||||
swal("Ajax request finished!");
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
swal.setDefaults({ confirmButtonColor: "#000000" });
|
||||
|
||||
swal.close();
|
||||
|
||||
swal.showInputError("Invalid email!");
|
||||
swal.showInputError("Invalid email!");
|
||||
|
||||
swal.disableButtons();
|
||||
|
||||
swal.enableButtons();
|
||||
20
sweetalert/sweetalert.d.ts
vendored
20
sweetalert/sweetalert.d.ts
vendored
@ -1,4 +1,4 @@
|
||||
// Type definitions for SweetAlert 1.0.1
|
||||
// Type definitions for SweetAlert 1.1.0
|
||||
// Project: https://github.com/t4t5/sweetalert/
|
||||
// Definitions by: Markus Peloso <https://github.com/ToastHawaii/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
@ -62,7 +62,7 @@ declare module SweetAlert {
|
||||
|
||||
/**
|
||||
* Use this to change the background color of the "Confirm"-button (must be a HEX value).
|
||||
* Default: "#AEDEF4"
|
||||
* Default: "#8CD4F5"
|
||||
*/
|
||||
confirmButtonColor?: string;
|
||||
|
||||
@ -131,6 +131,12 @@ declare module SweetAlert {
|
||||
* Default: null
|
||||
*/
|
||||
inputValue?: string;
|
||||
|
||||
/**
|
||||
* Set to true to disable the buttons and show that something is loading.
|
||||
* Default: false
|
||||
*/
|
||||
showLoaderOnConfirm?: boolean;
|
||||
}
|
||||
|
||||
interface Settings extends SettingsBase {
|
||||
@ -195,5 +201,15 @@ declare module SweetAlert {
|
||||
* Show an error message after validating the input field, if the user's data is bad.
|
||||
*/
|
||||
showInputError(errorMessage: string): void;
|
||||
|
||||
/**
|
||||
* Enable the user to click on the cancel and confirm buttons.
|
||||
*/
|
||||
enableButtons(): void;
|
||||
|
||||
/**
|
||||
* Disable the user to click on the cancel and confirm buttons.
|
||||
*/
|
||||
disableButtons(): void;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user