protected string[] GenerateCode(TypeScriptGenerationOptions options, ICustomTypeGenerator customTypeGenerator, IRootTypesProvider typesProvider) { var generator = new TypeScriptGenerator(options, customTypeGenerator, typesProvider); return(generator.Generate().Select(x => x.GenerateCode(new DefaultCodeGenerationContext()).Replace("\r\n", "\n")).ToArray()); }
public TypeScriptGenerator(TypeScriptGenerationOptions options, ICustomTypeGenerator customTypeGenerator, IRootTypesProvider typesProvider) { Options = options ?? throw new ArgumentNullException(nameof(options)); TypesProvider = typesProvider ?? throw new ArgumentNullException(nameof(typesProvider)); this.customTypeGenerator = customTypeGenerator ?? throw new ArgumentNullException(nameof(customTypeGenerator)); rootTypes = typesProvider?.GetRootTypes() ?? throw new ArgumentNullException(nameof(typesProvider)); typeUnitFactory = new DefaultTypeScriptGeneratorOutput(); typeDeclarations = new Dictionary <ITypeInfo, ITypeBuildingContext>(); }