// Type definitions for ng-command 0.2.0 // Project: https://github.com/stephenlautier/ng-command // Definitions by: Stephen Lautier // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// declare namespace ngCommand { var ModuleName: string; /** * Command proxy object. */ interface ICommand { /** * Determines whether the command is currently executing. */ isExecuting: boolean; /** * Determines whether the command can execute or not. */ canExecute: boolean; /** * Executes the command function. */ execute: () => angular.IPromise; } class Command implements ICommand { static id: string; isExecuting: boolean; canExecute: boolean; constructor($scope: angular.IScope, execute: () => angular.IPromise, canExecute?: () => boolean); execute(): angular.IPromise; } /** * Command factory which creates instances of @see ICommand. */ interface ICommandFactory { /** * Factory instance creator method. * @param $scope Scope which will keep track of the command. * @param execute The execute function when the command is executed. * @param canExecute Additional function which determines whether the command can executes. */ ($scope: angular.IScope, execute: () => angular.IPromise, canExecute?: () => boolean): ICommand; } }