/* * Copyright (C) Sapphirecode - All Rights Reserved * This file is part of console-app which is released under MIT. * See file 'LICENSE' for full license details. * Created by Timo Hocker , May 2020 */ import { Persistent } from '@sapphirecode/modelling'; import { TypeValidation } from './Types/TypeValidation'; import { PathType } from './Types/PathType'; import { OptionType } from './OptionType'; import { OptionSource } from './Sources/OptionSource'; import { EnvSource } from './Sources/EnvSource'; import { ArgSource } from './Sources/ArgSource'; import { InteractiveSource } from './Sources/InteractiveSource'; import { Option, OptionProcess } from './Option'; const types: Record = { string: new TypeValidation ('string'), number: new TypeValidation ('number'), boolean: new TypeValidation ('boolean'), file: new PathType ('file'), folder: new PathType ('folder'), path: new PathType ('path'), array: new TypeValidation ('array') }; interface SourceConfig { env: boolean; args: boolean; interactive: boolean; } export class InteractiveOptions extends Persistent { protected options: Array; protected quiet = false; protected sources: OptionSource[] = []; public constructor ( options: Array