1. JamesDiacono
  2. jdiacono

Source

jdiacono / JDiacono / TypeScript /

Filename Size Date modified Message
..
Declarations
Poco
609 B
* Better doco
5.8 KB
* Better doco

This is a small utility to facilitate the reuse of CLR POCO classes as TypeScript interfaces.

It turns this:

public class Parent : Person
{
    public bool IsGoodParent { get; set; }
    public virtual ICollection<Child> Children { get; set; }
}

into this:

///<reference path="Person.d.ts" />
///<reference path="Child.d.ts" />
interface Parent extends Person {
    IsGoodParent : bool;
    Children : Child[];
}

Supports all basic .NET data types, nullables, enums and relationships with other complex types.

Also handles inheritance.