Skip to content

CreateTemplateCommand

@tsed/cli

Usage

typescript
import { CreateTemplateCommand } from "@tsed/cli/src/commands/template/CreateTemplateCommand";

See /packages/cli/src/commands/template/CreateTemplateCommand.ts.

Overview

ts
class CreateTemplateCommand implements CommandProvider<CreateTemplateCmdContext> {
    protected projectPackageJson: ProjectPackageJson;
    protected templates: CliTemplatesService;
    $prompt(data: Partial<CreateTemplateCmdContext>): Promise<PromptQuestion[]>;
    $mapContext(ctx: Partial<any>): any;
    $exec(ctx: CreateTemplateCmdContext & {
        symbolName: string;
        symbolPath: string;
    }): {
        title: string;
        task: () => Promise<void>;
    }[];
}

protected projectPackageJson

ts
protected projectPackageJson: ProjectPackageJson;

protected templates

ts
protected templates: CliTemplatesService;

$prompt

ts
$prompt(data: Partial<CreateTemplateCmdContext>): Promise<PromptQuestion[]>;

$mapContext

ts
$mapContext(ctx: Partial<any>): any;

$exec

ts
$exec(ctx: CreateTemplateCmdContext & {
     symbolName: string;
     symbolPath: string;
 }): {
     title: string;
     task: () => Promise<void>;
 }[];

Released under the MIT License.