mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
ko.plus - amended signature of .fail method of command
Fail callback can be more than just a text response, added new callback signature to address this.
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
|
||||
Version 1.1 - added test for makeEditable
|
||||
|
||||
Version 1.2 - amended callback on commmand.fail() method - accepts response,
|
||||
status and message values
|
||||
|
||||
Note: Typescript version 1.4 or higher is required for union types
|
||||
and type declarations
|
||||
*/
|
||||
@@ -29,8 +32,13 @@ function CommandTests() {
|
||||
.done((data: any) => {
|
||||
alert("success");
|
||||
})
|
||||
.fail((error: string) => {
|
||||
alert(error);
|
||||
.fail((response) => {
|
||||
// dummy
|
||||
return false;
|
||||
})
|
||||
.fail((response, status, message) => {
|
||||
// fail has response, error and text
|
||||
alert(status + message);
|
||||
});
|
||||
|
||||
// initialize command with options (action only)
|
||||
|
||||
Vendored
+6
-2
@@ -1,8 +1,9 @@
|
||||
// Type definitions for ko.plus v0.0.21
|
||||
// Type definitions for ko.plus v0.0.24
|
||||
// Project: https://github.com/stevegreatrex/ko.plus
|
||||
// Definitions by: Howard Richards <https://github.com/conficient>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
/// <reference path="../knockout/knockout.d.ts" />
|
||||
|
||||
/**
|
||||
@@ -16,6 +17,9 @@
|
||||
*
|
||||
* Version 1.1 - fixed bug - makeEditable is now a function on .editable
|
||||
* also refactored how the Editable classes inherit to simplify
|
||||
*
|
||||
* Version 1.2 - amended callback on commmand.fail() method - accepts response,
|
||||
* status and message values
|
||||
*/
|
||||
|
||||
//
|
||||
@@ -87,7 +91,7 @@ declare module KoPlus {
|
||||
//
|
||||
done: (callback: (data: any) => void) => Command;
|
||||
|
||||
fail: (callback: (error: string) => void) => Command;
|
||||
fail: (callback: (response: any, status?: string, statusText?:string) => void) => Command;
|
||||
|
||||
always: (callback: Function) => Command;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user