import { ArgumentsCamelCase, CommandModule } from "yargs"; import { TemplateManager } from "../TemplateManager"; import { AddTemplateArgs, Template } from "@igniteui/cli-core"; export interface PositionalArgs { /** The framework that the project will target. */ framework?: string; /** The name of the project */ name?: string; /** The type of the project. (eg. igx-ts) */ type?: string; /** Which theme to use when creating a new project. */ theme?: string; template?: string; module?: string; skipRoute?: boolean; /** Port to run the generated app on. */ port?: number; skipConfig?: boolean; /** Property to configure. */ property?: string; /** Specifies if the global configuration should be used. */ global?: boolean; /** The term to search for. */ term?: string; /** Executes end-to-end tests. */ e2e?: boolean; } export interface CommandType extends CommandModule<{}, any> { templateManager?: TemplateManager; /** Handler function that will be called by yargs after the command line has been parsed. */ handler(/** do not use `this` in handler */ this: void, argv: ArgumentsCamelCase): any; } export interface NewCommandType extends CommandType { /** Adds choices to the `builder.framework` option. */ addChoices(choices: string[]): void; } export interface AddCommandType extends CommandType { /** Adds a new template to the project. */ addTemplate(name: string, template: Template, options?: AddTemplateArgs): Promise; /** Checks if the command can be executed. */ check(argv: ArgumentsCamelCase): boolean; } export interface BuildCommandType extends CommandType { /** Builds the project. */ build(argv?: ArgumentsCamelCase): Promise; } export interface StartCommandType extends CommandType { /** Starts the project. */ start(argv: any): Promise; } export interface ConfigCommandType extends CommandType { /** Gets a configuration property. */ getHandler(argv: ArgumentsCamelCase): void; /** Sets a configuration property. */ setHandler(argv: ArgumentsCamelCase): void; /** Adds a value to an existing configuration array. */ addHandler(argv: ArgumentsCamelCase): void; } export interface DocCommandType extends CommandType { /** Uses the `open` package to open a URL, file etc. */ open(string: any): void; } export interface TestCommandType extends CommandType { /** Executes tests. */ test(argv: ArgumentsCamelCase): void; } export interface UpgradeCommandType extends CommandType { /** Upgrades packages for Angular, React & WC projects. */ upgrade(argv: ArgumentsCamelCase): void; }