cleanup
This commit is contained in:
@ -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() {
|
||||
|
||||
}
|
||||
}
|
@ -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
|
||||
|
Reference in New Issue
Block a user