In case your are wondering why you would want to look at using TypeScript, lets explore some of the features it provides.
.js files to
.ts files and you are off and running.
You will then immediately see TypeScript benefits before you've done anything to your code.
The TypeScript language service (which is leveraged by the IDE), can use type inference to make intelligent observations about your code and its expected types, before you ever add any type information yourself.
Some of the benefits are possible because there is additional information that the IDE tooling has about the code.
Type inference might be relatively simple, like picking up the type of a constant that is assigned to a variable at initialization, and flowing that type through a function return.
It may also be quite sophisticated like picking up a function signature from assignment to a known callback type, defined in a type definition file.
When the IDE knows type information, it can offer statement completion reducing typos and also making platforms like Aurelia MUCH easier to learn and use (we'll see examples of this when we start developing our application).
The statement completion pop-up choices also includes any inline doc comments like descriptions, parameters and parameter descriptions and return types.
It makes it much easier for developers to explore, experiment with, and discover the features of an API.
As an application grows in size, renaming and other refactoring operations become necessary. Without type information, error-prone search and replace options must be used, but with TypeScript, the language service knows where the renaming should occur and where it is a different identifier that happens to have the same name.
TypeScript type annotations
.d.ts files, created by the open source community and housed at DefinitelyTyped.
Each Aurelia repo has a corresponding
.d.ts file, as seen here.