improve typings
This commit is contained in:
parent
e102203422
commit
b98e2a1a62
4
dist/smartcli.classes.smartcli.d.ts
vendored
4
dist/smartcli.classes.smartcli.d.ts
vendored
@ -26,7 +26,7 @@ export declare class Smartcli {
|
|||||||
*/
|
*/
|
||||||
addCommand(definitionArg: {
|
addCommand(definitionArg: {
|
||||||
commandName: string;
|
commandName: string;
|
||||||
}): plugins.q.Promise<{}>;
|
}): plugins.q.Promise<any>;
|
||||||
/**
|
/**
|
||||||
* gets a Promise for a command word
|
* gets a Promise for a command word
|
||||||
*/
|
*/
|
||||||
@ -44,7 +44,7 @@ export declare class Smartcli {
|
|||||||
/**
|
/**
|
||||||
* returns promise that is resolved when no commands are specified
|
* returns promise that is resolved when no commands are specified
|
||||||
*/
|
*/
|
||||||
standardTask(): plugins.q.Promise<{}>;
|
standardTask(): plugins.q.Promise<any>;
|
||||||
/**
|
/**
|
||||||
* start the process of evaluating commands
|
* start the process of evaluating commands
|
||||||
*/
|
*/
|
||||||
|
4
dist/smartcli.classes.smartcli.js
vendored
4
dist/smartcli.classes.smartcli.js
vendored
@ -18,6 +18,7 @@ class Smartcli {
|
|||||||
*/
|
*/
|
||||||
addAlias(keyArg, aliasArg) {
|
addAlias(keyArg, aliasArg) {
|
||||||
this.argv = this.argv.alias(keyArg, aliasArg);
|
this.argv = this.argv.alias(keyArg, aliasArg);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
/**
|
/**
|
||||||
@ -96,7 +97,8 @@ class Smartcli {
|
|||||||
startParse() {
|
startParse() {
|
||||||
this.argv = this.argv.argv;
|
this.argv = this.argv.argv;
|
||||||
this.parseStarted.resolve();
|
this.parseStarted.resolve();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
exports.Smartcli = Smartcli;
|
exports.Smartcli = Smartcli;
|
||||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRjbGkuY2xhc3Nlcy5zbWFydGN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UFJLENBQUMsWUFBWSxDQUFDLE9BQU8sRUFBRSxDQUFDO1FBQzVCLE1BQU0sQ0FBQztJQUNYLENBQUM7QUFFTCxDQUFDO0FBdkdZLGdCQUFRLFdBdUdwQixDQUFBIn0=
|
@ -31,8 +31,9 @@ export class Smartcli {
|
|||||||
/**
|
/**
|
||||||
* adds an alias, meaning one equals the other in terms of triggering associated commands
|
* adds an alias, meaning one equals the other in terms of triggering associated commands
|
||||||
*/
|
*/
|
||||||
addAlias(keyArg,aliasArg){
|
addAlias(keyArg,aliasArg):void {
|
||||||
this.argv = this.argv.alias(keyArg,aliasArg);
|
this.argv = this.argv.alias(keyArg,aliasArg);
|
||||||
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -40,8 +41,8 @@ export class Smartcli {
|
|||||||
*
|
*
|
||||||
* Note: in e.g. "npm install something" the "install" is considered the command.
|
* Note: in e.g. "npm install something" the "install" is considered the command.
|
||||||
*/
|
*/
|
||||||
addCommand(definitionArg:{commandName:string}){
|
addCommand(definitionArg:{commandName:string}):plugins.q.Promise<any>{
|
||||||
let done = plugins.q.defer();
|
let done = plugins.q.defer<any>();
|
||||||
this.parseStarted.promise
|
this.parseStarted.promise
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (this.argv._.indexOf(definitionArg.commandName) == 0) {
|
if (this.argv._.indexOf(definitionArg.commandName) == 0) {
|
||||||
@ -92,8 +93,8 @@ export class Smartcli {
|
|||||||
/**
|
/**
|
||||||
* returns promise that is resolved when no commands are specified
|
* returns promise that is resolved when no commands are specified
|
||||||
*/
|
*/
|
||||||
standardTask(){
|
standardTask():plugins.q.Promise<any>{
|
||||||
let done = plugins.q.defer();
|
let done = plugins.q.defer<any>();
|
||||||
this.parseStarted.promise
|
this.parseStarted.promise
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if(this.argv._.length == 0 && !this.argv.v){
|
if(this.argv._.length == 0 && !this.argv.v){
|
||||||
@ -108,9 +109,10 @@ export class Smartcli {
|
|||||||
/**
|
/**
|
||||||
* start the process of evaluating commands
|
* start the process of evaluating commands
|
||||||
*/
|
*/
|
||||||
startParse(){
|
startParse():void{
|
||||||
this.argv = this.argv.argv;
|
this.argv = this.argv.argv;
|
||||||
this.parseStarted.resolve();
|
this.parseStarted.resolve();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user