Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        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);
        }