如何从github repo安装打字稿定义 [英] how to install typescript definitions from github repo

查看:73
本文介绍了如何从github repo安装打字稿定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何为aurelia-validatejs之类的库安装打字稿defs?

how do you install the typescript defs for a library like aurelia-validatejs?

就像我做了npm install aurelia-validatejs --save一样,将其添加到package.jsonnode_modules文件夹中.是否有键入命令将打字稿定义放入typings.jsontypings/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

如果相关,我正在基于

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安装打字稿定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆