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
38 lines (37 loc) • 1.41 kB
TypeScript
import { MModule, MField, MInterface, MMethod, MParam, MTypeAlias, MScalars } from './models/Module';
/**
* Foreach on MModule
* @desczh
* 遍历MModule
* @since 0.2.0
*/
export declare const foreach: (schema: MModule, option: {
schema?: ((schema: MModule) => void) | undefined;
model?: ((model: MInterface, schema: MModule) => void) | undefined;
field?: ((field: MField, model: MInterface, schema: MModule) => void) | undefined;
type?: ((type: MField['type'], field: MField, model: MInterface, schema: MModule) => void) | undefined;
typealiases?: ((e: MTypeAlias, schema: MModule) => void) | undefined;
method?: ((method: MMethod, model: MInterface, schema: MModule) => void) | undefined;
param?: ((param: MParam, method: MMethod, model: MInterface, schema: MModule) => void) | undefined;
implement?: ((name: string, model: MInterface, schema: MModule) => void) | undefined;
}) => void;
export declare type ScalarTypeName = MScalars['_kind'];
/**
* Get a scalar type name
* @desczh
* 得到标量类型名称
* @since 0.2.0
*/
export declare const getScalarTypeName: (type: MField['type']) => ScalarTypeName;
/**
* Map table about Modle Type and Compare Type
* @desczh
* ScalarTypeName到BasicCompareType映射表
* @since 0.2.0
*/
/**
* Get CompareObjectModelDefinition with MInterface
* @desczh
* MInterface到CompareObjectModelDefinition
* @since 0.2.0
*/