import Package from "../../data/Package"; import Path from "../../Path"; import {TemplateSystem} from "../../TemplateSystem"; import TsPathOut from "./TsPathOut"; import TsPathTemplate from "./TsPathTemplate"; import PathHelper from "../../PathHelper"; export default class TSExportGuiBinderList { public static Export(packageList: Package[]) { let path = TsPathOut.FguiBinderList; let list = []; let importList = []; for(let pkg of packageList) { if(!pkg.genCode || pkg.genCodeNoExport) continue; let inpt = [pkg.classNameBinder, PathHelper.GetImportPath(path, pkg.tsBinderPath) ]; importList.push(inpt); if(!pkg.genCode) continue; list.push([`${pkg.classNameBinder}.bindAll()`]); } let template: TemplateSystem = new TemplateSystem(Path.ReadTxt(TsPathTemplate.FguiBinderList)); template.AddVariable("imports",importList); template.AddVariable("packlist",list); let content = template.Parse(); Path.CheckPath(path); Path.WriteTxt(path,content); } }