Generic Class Support

Issue #55 resolved
Former user created an issue

Would love to see better Generics Support in to the TypeScript Result. Currently we get the `1[] and it doesn't quite work right.

Comments (3)

  1. dsherret

    Reproduction code:

    [TsClass]
    public abstract class Container<T>
    {
        public List<T> Items { get; set; }
    }
    
    [TsClass]
    public class NamedStringContainer : Container<string>
    {
        public string Name { get; set; }
    }
    

    Expected output:

    declare module TypeLiteIssue55 {
    interface NamedStringContainer extends TypeLiteIssue55.Container<string> {
      Name: string;
    }
    interface Container<T> {
      Items: Array<T>;
    }
    }
    

    Actual output:

    declare module TypeLiteIssue55 {
    interface NamedStringContainer extends TypeLiteIssue55.Container {
      Name: string;
    }
    interface Container {
      Items: TypeLiteIssue55.Container`1.T[];
    }
    }
    declare module TypeLiteIssue55.Container`1 {
    interface T {
    }
    }
    
  2. Log in to comment