import { Context } from '../context'; export interface Dictionary { [key: string]: T; } export type ScaffolderTransformer = (parameterValue: any, context: Context) => any; export type ScaffolderFunction = (context: Context) => any; export interface ParametersOptionsChoices { values: string } export interface ParameterOptions { question?: string; validation?: (parameterValue: any) => string | boolean; choices?: ParametersOptionsChoices } export interface Hooks { preTemplateGeneration?: (context: Context) => any | Promise; postTemplateGeneration?: (context: Context) => any | Promise; preAskingQuestions?: (context: Omit) => any | Promise; } // this interface should extend a common options interface with transformers. function and parameters options export interface TemplateOptions { hooks?: Hooks } export interface CommonConfig { transformers: Dictionary; functions: Dictionary; parametersOptions: Dictionary>; } export interface Config extends CommonConfig { templatesOptions: Dictionary>; }