问题描述
我正在尝试在Visual Studio 2015 RC的ASP.NET v5 Web项目中从DefinitelyTyped安装TypeScript定义文件吗? NuGet软件包似乎不再起作用,并且TSD尚未更新,并且在VS中使用它时,我也没有看到很多很好的文档.
I'm trying to install TypeScript definition files from DefinitelyTyped within a ASP.NET v5 web project in Visual Studio 2015 RC? NuGet packages don't seem to work anymore and TSD hasn't been updated in awhile and I haven't seen a lot of good documentation for it when using it within VS.
VS 2015 RC仍然有哪些工作方式?
What ways are still working for the VS 2015 RC?
推荐答案
TSD is deprecated. The generally preferred alternative is Typings.
来自文档:
#搜索定义.
键入搜索磁带
# Search for definitions.
typings search tape
#查找可用的定义(按名称).
类型搜索-名称反应
# Find an available definition (by name).
typings search --name react
#如果将软件包用作模块:
#安装非环境类型(默认来自"npm"注册表,可通过.typingsrc
中的defaultSource
配置)
键入安装调试--save
# If you use the package as a module:
# Install non-ambient typings (default from "npm" registry, configurable through defaultSource
in .typingsrc
)
typings install debug --save
#如果通过script标签使用软件包,或者
#它是环境的一部分,或者
#非环境类型的输入尚不可用:
键入安装dt〜mocha --global --save
# If you use the package through script tag, or
# it is part of the environment, or
# the non-ambient typings is not yet available:
typings install dt~mocha --global --save
#从特定的注册表中安装键入内容
键入安装env〜atom --global --save
键入安装npm〜bluebird --save
# Install typings from particular registry
typings install env~atom --global --save
typings install npm~bluebird --save
#使用typings/index.d.ts
(在tsconfig.json
中或作为///
引用).
猫的类型/index.d.ts
# Use typings/index.d.ts
(in tsconfig.json
or as a ///
reference).
cat typings/index.d.ts
这篇关于如何在ASP.NET 5中添加TypeScript绝对类型定义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!