UNPKG

macoolka-type-model

Version:

`macoolka-type-model` is a library for define model in TypeScript. It easily build a type contain field and method to your Application. It provide a generation model for type and validition

58 lines (57 loc) 1.15 kB
/** * @file */ import { MModule } from '../models/Module'; import { ReaderNode } from 'macoolka-app/lib/Node'; /** * Provide a option at build a TS. * @desczh * 建立TS的选项 */ export interface TSOptions { /** * remark * @desczh * 注释 */ header?: Array<string>; /** * import statement * @desczh * 导入语句 */ imports?: Array<string>; /** * The field that have defaultvalue is optinal when True * @desczh * 为true时,有缺省值的字段为可选 */ isInput?: boolean; /** * Print description when true * @desczh * 是否打印注释 */ showDesc?: boolean; /** * Ignore Type names when validation. * @desczh * 在校验时忽略给定的类型名字 */ ignoreTypeNames?: Array<string>; /** * Recursion Type names. * @desczh * 递归类型的名称 */ recursionNames?: Array<string>; } /** * Print a Module to ts code text * @desczh * 打印Module到ts代码 * @since 0.2.0 */ export interface TSBuild { (option?: TSOptions): ReaderNode<MModule, string>; }