This commit is contained in:
2016-11-19 13:43:06 +01:00
parent f33c759fa8
commit e7c1c1c45b
11 changed files with 24 additions and 158 deletions

View File

@ -1,59 +0,0 @@
import * as plugins from './smartcli.plugins'
/**
* allows to specify an user interaction during runtime
*/
export type questionType = 'input' | 'confirm' | 'list' | 'rawlist' | 'expand' | 'checkbox' | 'password' | 'editor'
export interface IChoiceObject {
name: string
value: any
}
export interface IValidateFunction {
(any): boolean
}
export class Interaction {
constructor() {
}
askQuestion(optionsArg: {
type: questionType,
message: string
default: any
choices: string[] | IChoiceObject[]
validate: IValidateFunction
}) {
let done = plugins.q.defer()
plugins.inquirer.prompt([{
type: optionsArg.type,
message: optionsArg.message,
default: optionsArg.default,
choices: optionsArg.choices,
validate: optionsArg.validate
}]).then(answers => {
done.resolve(answers)
})
}
askQuestionArray
}
export class QuestionTree {
constructor(questionString: string, optionsArray) {
}
}
export class QuestionTreeNode {
constructor() {
}
}
export class QuestionStorage {
constructor() {
}
}

View File

@ -2,7 +2,6 @@ import 'typings-global';
import * as yargs from 'yargs'
import * as beautylog from 'beautylog'
import * as inquirer from 'inquirer'
import * as lik from 'lik'
import * as path from 'path'
import * as smartparam from 'smartparam'
@ -10,8 +9,6 @@ import * as smartparam from 'smartparam'
export {
yargs,
beautylog,
cliff,
inquirer,
lik,
path,
smartparam