ko.plus: Replaced Callback type with Function

This commit is contained in:
Pavel Bakshy
2015-09-10 17:47:36 +03:00
parent 76ed26e95e
commit 02f03824f1
2 changed files with 6 additions and 6 deletions
+2
View File
@@ -43,6 +43,8 @@ function CommandTests() {
action: () => { return "Hello cmd4"; }
});
// initialize command with action with typed argument
var cmd5 = ko.command((message: string) => { return message; });
// test execute the command
cmd1();
+4 -6
View File
@@ -23,7 +23,7 @@
//
interface KnockoutStatic {
// create a command - two overloads
command: (param: KoPlus.Callback | KoPlus.CommandOptions) => KoPlus.Command;
command: (param: Function | KoPlus.CommandOptions) => KoPlus.Command;
editable: KoPlus.EditableStatic;
editableArray: KoPlus.EditableArrayStatic;
@@ -60,8 +60,6 @@ interface KnockoutBindingHandlers {
// namespace for ko.plus types
//
declare module KoPlus {
// predefine a callback type
export type Callback = () => void;
//#region Command types
@@ -91,9 +89,9 @@ declare module KoPlus {
fail: (callback: (error: string) => void) => Command;
always: (callback: Callback) => Command;
always: (callback: Function) => Command;
then: (resolve: Callback, reject: Callback) => Command;
then: (resolve: Function, reject: Function) => Command;
}
//
@@ -102,7 +100,7 @@ declare module KoPlus {
//
export interface CommandOptions {
// [required] sets the command action method
action: Callback;
action: Function;
// [optional] function to determine if command can be executed
canExecute?: () => boolean;