Suggestion: Allow typedefs for aliasing types, class names and interface names
Use case:
// 1. Use case overlaps with interface functions types and is even ugliertypedef(number)=>numberMyCallback;// 2. With genericstypedefVector<SomeDataType>MyVector;// 3. With primitive data typestypedefstringMyData;// 4. Aliasing classes and interfacestypedefReallyLongClassNameShortName;typedefotherModule.subModule.subModule.RunnableRunnable;
Question: Do we need them?
- Assigning a name to function types is already possible using interface function types. In my opinion, their syntax is nicer and we should not introduce another syntax for the same feature.
- This can help minimzing the amount of typing.
- According to the last comment of the original CodePlex issue, this can help commenting the code. It does however introduce another layer of name aliasing for names which are already short (
number, string, boolean). - This can also help minimzing the amount of typing, especially for accessing external classes and interfaces inside deeply nested modules. Aliasing modules themselves would also be imaginable.
The original CodePlex issue: http://typescript.codeplex.com/workitem/119
Note that many of the given code examples are already covered by #14 (union types).
Suggestion: Allow typedefs for aliasing types, class names and interface names
Use case:
Question: Do we need them?
number, string, boolean).The original CodePlex issue: http://typescript.codeplex.com/workitem/119
Note that many of the given code examples are already covered by #14 (union types).