| 
									
										
										
										
											2017-04-22 22:09:51 +02:00
										 |  |  | import * as smartq from 'smartq'; | 
					
						
							| 
									
										
										
										
											2016-12-18 20:53:50 +01:00
										 |  |  | import { Subject } from 'rxjs'; | 
					
						
							| 
									
										
										
										
											2016-10-15 00:56:02 +02:00
										 |  |  | import { Objectmap } from 'lik'; | 
					
						
							| 
									
										
										
										
											2016-12-18 20:53:50 +01:00
										 |  |  | export interface ICommandPromiseObject { | 
					
						
							| 
									
										
										
										
											2016-08-26 11:52:09 +02:00
										 |  |  |     commandName: string; | 
					
						
							| 
									
										
										
										
											2017-04-22 21:03:28 +02:00
										 |  |  |     promise: Promise<void>; | 
					
						
							| 
									
										
										
										
											2016-12-18 20:53:50 +01:00
										 |  |  | } | 
					
						
							|  |  |  | export interface ITriggerObservableObject { | 
					
						
							|  |  |  |     triggerName: string; | 
					
						
							| 
									
										
										
										
											2016-12-18 20:58:37 +01:00
										 |  |  |     subject: Subject<any>; | 
					
						
							| 
									
										
										
										
											2016-08-26 11:52:09 +02:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2016-06-10 03:10:21 +02:00
										 |  |  | export declare class Smartcli { | 
					
						
							| 
									
										
										
										
											2016-06-10 03:48:01 +02:00
										 |  |  |     argv: any; | 
					
						
							| 
									
										
										
										
											2016-06-10 03:10:21 +02:00
										 |  |  |     questionsDone: any; | 
					
						
							| 
									
										
										
										
											2017-04-22 22:09:51 +02:00
										 |  |  |     parseStarted: smartq.Deferred<any>; | 
					
						
							| 
									
										
										
										
											2016-06-10 03:48:01 +02:00
										 |  |  |     commands: any; | 
					
						
							| 
									
										
										
										
											2016-06-10 03:10:21 +02:00
										 |  |  |     questions: any; | 
					
						
							| 
									
										
										
										
											2016-06-10 03:48:01 +02:00
										 |  |  |     version: string; | 
					
						
							| 
									
										
										
										
											2016-12-18 01:36:19 +01:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * map of all Command/Promise objects to keep track | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-12-18 20:53:50 +01:00
										 |  |  |     allCommandPromisesMap: Objectmap<ICommandPromiseObject>; | 
					
						
							|  |  |  |     /** | 
					
						
							|  |  |  |      * map of all Trigger/Observable objects to keep track | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     allTriggerObservablesMap: Objectmap<ITriggerObservableObject>; | 
					
						
							| 
									
										
										
										
											2016-06-10 03:10:21 +02:00
										 |  |  |     constructor(); | 
					
						
							| 
									
										
										
										
											2016-08-26 09:21:42 +02:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2016-12-18 20:53:50 +01:00
										 |  |  |      * adds an alias, meaning one equals the other in terms of command execution. | 
					
						
							| 
									
										
										
										
											2016-08-26 09:21:42 +02:00
										 |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-12-18 20:53:50 +01:00
										 |  |  |     addCommandAlias(keyArg: any, aliasArg: any): void; | 
					
						
							| 
									
										
										
										
											2016-08-26 09:21:42 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * adds a Command by returning a Promise that reacts to the specific commandString given. | 
					
						
							|  |  |  |      * Note: in e.g. "npm install something" the "install" is considered the command. | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2017-04-22 21:03:28 +02:00
										 |  |  |     addCommand(commandNameArg: string): Promise<any>; | 
					
						
							| 
									
										
										
										
											2016-08-26 09:21:42 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * gets a Promise for a command word | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2017-04-22 21:03:28 +02:00
										 |  |  |     getCommandPromiseByName(commandNameArg: string): Promise<void>; | 
					
						
							| 
									
										
										
										
											2016-12-18 01:36:19 +01:00
										 |  |  |     /** | 
					
						
							| 
									
										
										
										
											2016-12-18 20:53:50 +01:00
										 |  |  |      * adds a Trigger. Like addCommand(), but returns an subscribable observable | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-12-18 20:58:37 +01:00
										 |  |  |     addTrigger(triggerNameArg: string): Subject<any>; | 
					
						
							| 
									
										
										
										
											2016-12-18 20:53:50 +01:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * execute trigger by name | 
					
						
							| 
									
										
										
										
											2016-12-18 01:36:19 +01:00
										 |  |  |      * @param commandNameArg - the name of the command to trigger | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-12-18 20:58:37 +01:00
										 |  |  |     trigger(triggerName: string): Subject<any>; | 
					
						
							| 
									
										
										
										
											2016-08-26 11:52:09 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * allows to specify help text to be printed above the rest of the help text | 
					
						
							|  |  |  |      */ | 
					
						
							|  |  |  |     addHelp(optionsArg: { | 
					
						
							|  |  |  |         helpText: string; | 
					
						
							| 
									
										
										
										
											2016-06-10 03:10:21 +02:00
										 |  |  |     }): void; | 
					
						
							| 
									
										
										
										
											2016-08-26 11:52:09 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * specify version to be printed for -v --version | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-06-10 03:10:21 +02:00
										 |  |  |     addVersion(versionArg: string): void; | 
					
						
							| 
									
										
										
										
											2016-08-26 11:52:09 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * returns promise that is resolved when no commands are specified | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2017-04-22 21:03:28 +02:00
										 |  |  |     standardTask(): Promise<any>; | 
					
						
							| 
									
										
										
										
											2016-09-04 17:32:12 +02:00
										 |  |  |     /** | 
					
						
							|  |  |  |      * start the process of evaluating commands | 
					
						
							|  |  |  |      */ | 
					
						
							| 
									
										
										
										
											2016-06-10 03:10:21 +02:00
										 |  |  |     startParse(): void; | 
					
						
							| 
									
										
										
										
											2016-06-09 14:03:18 +02:00
										 |  |  | } |