dsherret / ts-type-info

TypeScript AST and code generator [Deprecated]
MIT License
94 stars 8 forks source link

TypeDefinition text should be computed #224

Closed dsherret closed 7 years ago

dsherret commented 7 years ago

A TypeDefinition should be computed based on its properties. For example...

{
    unionTypes: [{ text: "string" }, { text: "number" }]
    text: "string | number"
}

...with the above TypeDefinition, doing the following:

type.unionTypes[0].text = "Date";

...would mean the TypeDefinition would change to:

{
    unionTypes: [{ text: "Date" }, { text: "number" }]
    text: "Date | number"
}

This is all working towards making types easier to work with and manipulate. Right now it's lacking.

dsherret commented 7 years ago

Nope. Not going to do this. Too complicated. I already have a way better potential solution in ts-simple-ast.