public TypeScriptDocGenerator(IConfiguration configuration) { var files = configuration.GetSection("source").GetSection("files").Get <string[]>(); _aistantSettings = configuration.GetSection("aistant").Get <AistantSettings>(); var parser = new TypeDocJsonParser(files); _lib = parser.Parse(); _lib.RootPath = _aistantSettings.Section?.Uri; }
public TypeScriptLibrary Parse() { if (_lib == null) { _lib = new TypeScriptLibrary(); JObject jobject; foreach (var file in _files) { if (File.Exists(file)) { jobject = JObject.Parse(File.ReadAllText(file)); var package = new TypeScriptPackage(); LoadFromJObject(package, jobject); _lib.Packages.Add(package); } } } return(_lib); }