mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
ko.plus: Replaced Callback type with Function
This commit is contained in:
@@ -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();
|
||||
|
||||
Vendored
+4
-6
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user