简体   繁体   中英

How to use TypeScript definitions in VS 2015

I am trying to create a TypeScript NodeJS project in VS 2015, I have installed Typings, and have used it to install TypeScript definitions for express and other node frameworks

However, when I use /// <reference path="Scripts/typings/globals/express/index.d.ts" /> in my .ts file, I do not receive any intellisense when trying to use express. There are no errors, and it finds the definition file.

How can I get the TypeScript definitions to work?

Turns out I was using this syntax: var express = require('express');

When I should have been using this: import express = require('express');

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM