C# to TypeScript Code Generator Libarary for WebApi Request/Response Model
https://www.nuget.org/packages/BanBrick.TypeScript.CodeGenerator/
PM > Install-Package BanBrick.TypeScript.CodeGenerator -Version 1.2.3
.net standard
using BanBrick.TypeScript.CodeGenerator;
var types = new List<Type>() { type1, type2, type3, ...};
var codeProcesser = new TypeScriptProcesser();
var code = codeProcesser.GenerateTypeScript(types);
current support typescript enum, interface, class, count generation using annotation
using BanBrick.TypeScript.CodeGenerator.Annotation;
[TypeScriptObject(Type = TypeScriptObjectType.Interface, Inherit = true)]
public class Request
{
public RequestDetail Details { get; set; }
}
public class RequestDetail
{
public string Name { get; set; }
}
this will output both Request and RequestDetail in Interface format of Typescript
- Generate const value output instead of class
- Support for Interface generation
- Auto-Indenting to multiple-layered tree structure values
- Support Auto-Resolve for Type Name Duplication
- Support for Inherit of Generation Types
- Auto-Indenting to multiple-layered tree structure types
- Support for external config instead of only annotation
- Support for Generictypes generation