Install TypeScript and TypeScript Definition Manager
(obviously you'll need nodejs installed first)
npm install typescript -g
npm install tsd -g
Assume you have a file named 'myTypeScriptModule.ts' with the following code:
You will now get an error that TypeScript could not find symbol "angular".
This is where the TypeScript Definition manager comes into play.
In your typescript directory, create a new typescript project by running:
Then install the definition file for angular:
tsd query angular --action install
This will download and create a new directory containing your angular definition file. Include it by updating your typescript file to point to the angular definition:
/// <reference path="angularjs/angular.d.ts" />
Try to transpile again, and it should generate the JS file without error:
They have a lot of other types as well: