@cuba-platform/front-generator
Version:
CUBA Platform front-end clients generator
28 lines (27 loc) • 1.03 kB
TypeScript
import { StudioTemplateProperty } from "./studio/studio-model";
import { Answers, Question as YeomanQuestion } from "yeoman-generator";
import { ProjectModel } from './model/cuba-model';
export declare type ObjectChoice = {
name: string;
value: any;
short?: string;
};
export declare type Choice = string | ObjectChoice;
interface Question extends YeomanQuestion {
choices?: Choice[] | ((previousAnswers: Answers) => Choice[]);
source?: (answers: Answers, input: string) => Promise<Choice[]>;
}
export declare const enum QuestionType {
input = "input",
confirm = "confirm",
list = "list",
rawlist = "rawlist",
expand = "expand",
checkbox = "checkbox",
password = "password",
editor = "editor",
autocomplete = "autocomplete"
}
export declare function fromStudioProperty(prop: StudioTemplateProperty, projectModel?: ProjectModel): Question;
export declare function fromStudioProperties(props: StudioTemplateProperty[], projectModel?: ProjectModel): Question[];
export {};