Type Definition imports not working for *.ts files
A couple things related to type definitions don't seem to work for *.ts files (features currently working fine for *.js files).
- Green underlining with "Download type definition" suggestion does not appear. Instead, just a red underline with message "Cannot find name xxxxx"
- Project-wide type definition references do not automatically load in *.ts files.
A workaround is manually pasting the relevant ///
Project-wide type definition references are supported using tsconfig.json. See https://code.visualstudio.com/docs/languages/typescript for the difference between File scope and project scope.
Supporting download of d.ts files is on our list.
In addition to @dbaeumer's tsconfig.json suggestion, TypeScript now also supports managing Typings files using npm: https://blogs.msdn.microsoft.com/typescript/2016/06/15/the-future-of-declaration-files/
$ npm install --save@types/express
These typings are then automatically loaded, without needing <reference path="...">:
import express from 'express';
...
A lot has changed in the last year, so please take a look at the updated typings management story and let up know if you have any suggestions or ideas for improvement. Thanks.