问题描述
如何为aurelia-validatejs之类的库安装打字稿defs?
how do you install the typescript defs for a library like aurelia-validatejs?
就像我做了npm install aurelia-validatejs --save
一样,将其添加到package.json
和node_modules
文件夹中.是否有键入命令将打字稿定义放入typings.json
和typings/globals
文件夹?如果没有,我该怎么办.
Like the I did the npm install aurelia-validatejs --save
to add it to the package.json
and node_modules
folders. Is there a typings command to get the typescript definitions into the typings.json
and typings/globals
folder? If not how can I do it.
库src和typescript导出位于 aurelia/validatejs github存储库
The library src and typescript exports are located at in the aurelia/validatejs github repo
如果相关,我正在基于 aurelia webpack-typescript框架,我想使validatejs和其他插件正常工作!如果有一篇博客文章显示如何将安装插件插入webpack-typescript skelton中,那将真的很酷.
In case its relevant, I am playing in a project based on the aurelia webpack-typescript skeleton and I want to get validatejs and or other plugins working! It would be really cool if there was a blog post showing how to do plug in installs into the webpack-typescript skelton.
推荐答案
使用命令:
typings install github:aurelia/validatejs/dist/aurelia-validatejs.d.ts#ee3479eb6edacb31e2a1b7fdc8871e615970d293 --save --global
或者您可以将其手动添加到您的typings.json
文件中:
Or you can manually add it to your typings.json
file:
{
"name": "Test",
"version": false,
"globalDependencies": {
"aurelia-validatejs": "github:aurelia/validatejs/dist/aurelia-validatejs.d.ts#ee3479eb6edacb31e2a1b7fdc8871e615970d293"
}
}
然后运行typings install
.
来自文档(请参见有效位置")
From documentation (see "Valid Locations")
aurelia/validatejs
-是组织/仓库
dist/aurelia-validatejs.d.ts
-是路径
ee3479eb6edacb31e2a1b7fdc8871e615970d293
-是提交
这篇关于如何从github repo安装打字稿定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!