import { Answers , Question } from 'inquirer' ; export interface IQuestions { value : any [ ] ; addQuestion ( question ) : void ; addQuestions ( questions ) : void ; insertQuestion ( index , question ) : void ; } export class Questions implements IQuestions { private _questions : Question [ ] = [ ] ; public get value ( ) : Question [ ] { return this . _questions ; } public addQuestion ( question ) { this . _questions . push ( question ) ; } public addQuestions ( questions ) { questions . forEach ( ( question ) => { this . addQuestion ( question ) ; } ) ; } public insertQuestion ( index , question ) { this . _questions . splice ( index , 0 , question ) ; } } export default Questions ;