import IManifest from '../../compiler/javascript/vela/interface/IManifest'; export declare class UxFileUtils { static readonly CONFIG_FILE_NAME = "manifest.json"; /** * 获取manifest.json路径 * @param projectPath * @param sourceRoot * @returns */ static getManifestFilePath(projectPath: string, sourceRoot?: string): string; /** * 获取manifest.json内容 * @param projectPath * @param sourceRoot * @returns */ static getManifestInfo(projectPath: string, sourceRoot?: string): IManifest; /** * 检查 manifest文件,并显示错误信息 * * 1. 使用ManifestSchema 校验 * 1. TypeError: Error * 2. 其它: Warn * 2. 检查 router.entry 是否存在于 router.pages * 3. 检查icon是否存在 * * @param projectPath 项目路径 * @param sourceRoot 源码路径--相对项目根目录 * @returns */ static validateManifest(projectPath: string, sourceRoot?: string): void; /** * 检查 sitemap.json 文件,并显示错误信息 * * 1. 当sitemap.json的 rules 中配置的page 不存在于 manifest.json 中时,报错 * @param projectPath * @param sourceRoot */ static validateSitemap(projectPath: string, sourceRoot?: string): void; /** * 比较新旧文件列表差异 * 1. 遍历旧文件列表 * 1.1 若文件路径在新文件列表remainingNewFilest中,且内容一致时,从remainingNewFiles中移除该项 * 1.2 若文件路径在新文件列表remainingNewFiles中,且内容不一致时,添加到diffList中表示待更新,从remainingNewFiles中移除该项 * 1.3 若文件路径不在新文件列表中,表示该文件待删除(热更新时,可以不做删除,删除耗费性能) * 2. 若遍历完旧文件列表后,remainingNewFiles长度不为0,表示有文件待新增 * @param oldFileList 旧文件路径列表(相对路径) * @param newFileList 新文件路径列表(绝对路径) * @param oldDir 旧文件所在目录(绝对路径) * @param newDir 新文件所在目录(绝对路径) * @returns 返回差异文件路径列表(相对路径) */ static getDiffJSON(oldFileList: string[], newFileList: string[], oldDir: string, newDir: string): string[]; } export default UxFileUtils;