Generate TypeScript Definition Automatically

TypeLITE generates Interface definition from C# classes specified in T4 pattern.

How To Use

Set TsClassAttribute (+ module name) to DTO classes.

using TypeLite;

[TsClass(Module = "module1")]
public class Sample1
{
    public int Value { get; set; }
    public Enum1 Type { get; set; }
}

[TsEnum(Module = "module1")]
public enum Enum1
{
    First = 1,
    Second = 2
}

Generated Code

TypeLite.Net.d.ts

declare module module1 {
    interface Sample1 {
        Value: number;
        Type: module1.Enum1;
    }
}

Enum.ts

module module1 {
    export enum Enum1 {
        First = 1,
        Second = 2
    }
}