UNPKG

@lcap/asl

Version:

NetEase Application Specific Language

149 lines (148 loc) 3.4 kB
import { Vertex, LEVEL_ENUM, Interface, Param, Return, Variable, ProcessComponent, ProcessInterface, Process, ActionOptions } from '..'; import View from '../page/View'; import { LogicItem } from './LogicItem'; /** * 逻辑类 */ export declare class Logic extends Vertex { /** * 概念类型 */ readonly level: LEVEL_ENUM; /** * Id */ readonly id: string; /** * 名称 */ readonly name: string; /** * 描述 */ readonly description: string; /** * serviceId 或者 viewId */ readonly moduleId: string; /** * 值为 view 或者 microService 或者 processComponent */ readonly moduleType: 'view' | 'microService' | 'process'; /** * serviceId 或者 viewId */ readonly serviceId: string; /** * 值为 view 或者 microService */ readonly serviceType: 'view' | 'entity' | 'microService'; /** * 所属实体 Id */ readonly entityId: string; /** * 输入参数列表 */ readonly params: Array<Param>; /** * 输出参数列表 */ readonly returns: Array<Return>; /** * 局部变量列表 */ readonly variables: Array<Variable>; /** * 逻辑体 */ readonly body: Array<LogicItem>; /** * 画布 */ readonly playgroundId: string; /** * 画布 */ readonly playground: Array<LogicItem>; /** * 接口 */ readonly interface: Interface; /** * 视图 */ readonly view: View; /** * 流程组件 */ readonly processComponent: ProcessComponent; /** * 流程组件 */ readonly process: Process; /** * 正在请求的 Promise * 前端 UI 状态 */ contentPromise: Promise<any>; /** * 树组件的子节点字段 */ readonly moreChildrenFields: Array<string>; /** * @param source 需要合并的部分参数 */ constructor(source?: Partial<Logic>); /** * 添加逻辑 */ create(none?: void, actionOptions?: ActionOptions): Promise<this>; /** * 删除逻辑 */ delete(none?: void, actionOptions?: ActionOptions): Promise<void>; /** * 修改逻辑 */ update(none?: void, actionOptions?: ActionOptions, then?: () => Promise<any>): Promise<this>; /** * 设置逻辑名称 */ setName(name: string): Promise<this>; /** * 设置逻辑描述 */ setDescription(description: string): Promise<this>; _onChange(): void; /** * 按当前 id 加载逻辑数据 */ load(): Promise<any>; isContentLoaded(): boolean; /** * 批量添加参数 */ addParamList(params: Array<Param>): Promise<void>; /** * 添加逻辑节点 * @param item */ addItem(item: LogicItem, actionOptions?: ActionOptions): Promise<void>; /** * 删除逻辑节点 * @param item */ removeItem(item: LogicItem, actionOptions?: ActionOptions): Promise<void>; /** * * @param type * @returns */ findLogicItemByType(type: string): LogicItem; /** * 从后端 JSON 生成规范的 Logic 对象 */ static from(source: any, parent: Interface | View | ProcessComponent | ProcessInterface, currentLogic?: Logic): Logic; } export default Logic;