@cuba-platform/front-generator
Version:
CUBA Platform front-end clients generator
44 lines (43 loc) • 1.72 kB
TypeScript
import * as Base from "yeoman-generator";
import { CommonGenerationOptions, OptionsConfig } from "./cli-options";
import { StudioTemplateProperty } from "./studio/studio-model";
import { ProjectModel } from "./model/cuba-model";
/**
* @alpha
*/
export declare abstract class BaseGenerator<A, M, O extends CommonGenerationOptions> extends Base {
options: O;
answers?: A;
model?: M;
conflicter: {
force: boolean;
};
protected cubaProjectModel?: ProjectModel;
protected modelFilePath?: string;
protected constructor(args: string | string[], options: CommonGenerationOptions);
protected _composeModelFilePath(options: O, executionDir: string): string | undefined;
protected _obtainCubaProjectModel(): Promise<void>;
protected _readProjectModel(): ProjectModel;
protected _obtainAnswers(): Promise<void>;
protected _promptOrParse(): Promise<void>;
protected _populateOptions(availableOption: OptionsConfig): void;
protected _getDestRoot(): string;
_getAvailableOptions(): OptionsConfig;
_getParams(): StudioTemplateProperty[];
/**
* Additional dynamic prompts where questions depend on answers to initial prompt
*
* @param answers
* @private
*/
protected _additionalPrompts(answers: A): Promise<A>;
abstract writing(): void;
}
export interface GeneratorExports {
generator: typeof BaseGenerator;
options?: OptionsConfig;
params?: StudioTemplateProperty[];
description?: string;
}
export declare function readProjectModel(modelFilePath?: string): ProjectModel;
export declare function refineAnswers<T>(projectModel: ProjectModel, generatorParams: StudioTemplateProperty[], answers: any): T;