import type inquirer from 'inquirer' import type { ProjectMetaData } from './userDialog/PerformUserDialog' import type { Command } from 'commander' import type { OverrideProperties } from '../types/UtilityTypes' import type PromptUI from 'inquirer/lib/ui/prompt' export enum ExtensionCategory { ONLY_FOR_TESTING, JAVASCRIPT_FLAVOR, FRONTEND_FRAMEWORK, CSS_PREPROCESSOR, JAVASCRIPT_LIBRARY, LINTER_OR_FORMATTER, } export type AdditionalInformationForExtensions = { projectMetadata: ProjectMetaData chosenExtensions: Array } export type Extension = { name: string index: number description: string linkToDocumentation: URL category: ExtensionCategory dependsOn?: Array exclusiveTo?: Array promptOptions?: ( prompt: ( questions: Array, ) => Promise & { ui: PromptUI }, cliOptions: Record, ) => Promise> declareCliOptions?: (program: Command) => void options?: Record canBeSkipped?: ( options: Record | undefined, otherInformation: AdditionalInformationForExtensions, ) => boolean run: ( options: Record | undefined, otherInformation: AdditionalInformationForExtensions, ) => Promise printUsefulInformation?: ( options: Record | undefined, otherInformation: AdditionalInformationForExtensions, ) => void } export type ExtensionWithSpecificOptions< Options extends Record, > = OverrideProperties