RafaelSalguero/CSharp2TS

Handling of initialization at declaration

Closed this issue · 2 comments

Extension should handle initialization at declaration for basic types (standard collections, numbers, strings, etc).
For example, class

public interface Contact {
    public int Id { get; set; } = 0;
    public string Number { get; set; } = "123-123-123";
    public float Score { get; set; } = 1.2f;
    public List<Adrress> Addresses { get; set; } = new List<Address>();
}

should be converted to

export interface Contact {
    id: number = 0;
    number: string = "123-123-123";
    score: number = 1.2;
    addresses: Adrress[] = [];
}

or skip initialization itself and convert to

export interface Contact {
    id: number;
    number: string;
    score: number;
    addresses: Adrress[];
}

Working on it

Fixed on commit e64b497