@lcap/asl
Version:
NetEase Application Specific Language
136 lines (135 loc) • 2.88 kB
TypeScript
import { LEVEL_ENUM, Vertex, Service, WebService, MicroService, History } from '..';
interface AppLoadAllOptions {
asyncLoadServicesDetail?: boolean;
asyncLoadViewsDetail?: boolean;
}
/**
* 应用类
* @example OA
* @category App
*/
export declare class App extends Vertex {
/**
* 概念类型
*/
readonly level: LEVEL_ENUM;
/**
* App Id
*/
readonly id: string;
/**
* Alias of id
*/
readonly appId: string;
/**
* 应用标识
*/
readonly name: string;
/**
* 应用标题
*/
readonly title: string;
/**
* 应用图标
*/
readonly icon: string;
/**
* 应用描述
*/
readonly description: string;
/**
* 域名
*/
readonly dnsAddr: string;
/**
* 官方类型
*/
readonly officialType: 'offical' | 'nonofficial';
/**
* IDE 版本
*/
readonly ideVersion: string;
/**
* 轻舟项目 Id
*/
readonly projectId: string;
/**
* 租户 Id
*/
readonly tenantId: string;
/**
* 租户 Id
*/
readonly userGroupId: string;
/**
* h5 pc type
*/
readonly scope: 'pc' | 'h5';
/**
* 发布状态
*/
readonly deploying: string;
/**
* 发布 Id,用于获取CICD详情
*/
readonly deploymentId: string;
/**
* 应用下的服务
*/
readonly services: Array<Service>;
/**
* 首个 Web 服务
* 后续 App 创建不了多个模块了,默认处理该服务
*/
readonly firstWebService: WebService;
/**
* 首个 Web 服务
* 后续 App 创建不了多个模块了,默认处理该服务
*/
readonly firstMicroService: MicroService;
/**
* 历史记录
* 用于处理撤销重做
*/
readonly history: History;
/**
* @param source 需要合并的部分参数
*/
constructor(source?: Partial<App>);
/**
* 加载详情并同步 envList 信息
* @requires this.id
*/
loadEnvList(appDetail: any): Promise<void>;
/**
* 加载详情并同步 App 信息
* @requires this.id
*/
load(): Promise<this>;
/**
* 加载 App 下的所有服务
*/
loadServices(): Promise<any>;
/**
* 加载页面和逻辑详情
*/
_loadViewsDetail(): Promise<void>;
/**
* 需要先调用 loadServices 之后再调用此函数
* 加载 App 下的服务具体内容
*/
private _loadServicesDetail;
/**
* 加载 App 下所有子节点
* @example
* const app = new App({ id: appId });
* await app.loadAll();
*/
loadAll(options?: AppLoadAllOptions): Promise<void>;
/**
* 从后端 JSON 生成规范的 App 对象
* @param source JSON
*/
from(source: any): App;
}
export default App;