@lcap/asl
Version:
NetEase Application Specific Language
126 lines (125 loc) • 2.94 kB
TypeScript
import { LEVEL_ENUM, EventEmitter } from '..';
/**
* 顶点类
* 属性均为只读,仅在初始化和 load 的情况下可以修改
*/
export declare class Vertex extends EventEmitter {
/**
* 可修改标志,内部属性
* 标记在构造函数结束后是否可修改
*/
protected _mutable: boolean;
/**
* 概念类型
*/
readonly level: LEVEL_ENUM;
/**
* toJSON 时需要去除的键,为了避免出现 CircularJSON
*/
protected readonly JSON_EXCLUDED_KEYS: Set<string>;
/**
* 顶点 id
*/
readonly id: string;
/**
* 唯一 uuid
* 目前主要用于前端 Debug 区分两个实例
*/
readonly _uuid: string;
/**
* 前端记录缓存的时间戳
*/
readonly _cacheTimestamp: string;
/**
* 名称
*/
readonly name: string;
/**
* 创建人
*/
readonly createdBy: string;
/**
* 创建时间
*/
readonly createdTime: string;
/**
* 修改人
*/
readonly updatedBy: string;
/**
* 修改时间
*/
readonly updatedTime: string;
/**
* IDE 版本
*/
readonly ideVersion: string;
/**
* 是否可编辑
*/
editable: boolean;
/**
* 是否正在编辑
* 前端 UI 状态
*/
editing: boolean;
/**
* 是否正在请求
* 前端 UI 状态
*/
loading: boolean;
/**
* 节点是否为展开状态
* 前端 UI 状态
*/
expanded: boolean;
/**
* 是否为叶子节点
* 前端 UI 状态
*/
isLeaf: boolean;
/**
* @param source 需要合并的部分参数
*/
constructor(source?: Partial<Vertex>);
assign(source: any): void;
emitVertexIdToNameChange(): void;
plainAssign(source: any): void;
pick(source: any, keys?: Array<string>): void;
/**
* 从对象中深度获取
* @param source
* @param keys
* @example 比如一般后端返回只是添加了个 id
* ```
* this.deepPick(result, ['id'])
*/
deepPick(source: any, keys?: Array<string>): void;
/**
* 去除循环依赖,转为纯 JSON
* @param parentKey 外面的 key,提供给 JSON.stringify 使用
* @param excludedKeys 需要额外排除的 keys
*/
toJSON(parentKey?: string, excludedKeys?: Array<string>): any;
/**
* 转为单层的 JSON
* @param parentKey 外面的 key,提供给 JSON.stringify 使用
* @param excludedKeys 需要额外排除的 keys
*/
toPlainJSON(parentKey?: string, excludedKeys?: Array<string>): any;
/**
* 查找引用
*/
findUsage(): Promise<any>;
/**
* 销毁
* 从 Map 中删除点和子节点
*/
destroy(): void;
/**
* 通过 Ref 去查找点
* @param ref
*/
static getVertexByRef(ref: string): Vertex;
}
export default Vertex;