how do you install the typescript defs for a library like aurelia-validatejs?
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.
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.
With a command:
typings install github:aurelia/validatejs/dist/aurelia-validatejs.d.ts#ee3479eb6edacb31e2a1b7fdc8871e615970d293 --save --global
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"
}
}
And run typings install
after this.
From documentation (see "Valid Locations")
aurelia/validatejs
- is org/repo
dist/aurelia-validatejs.d.ts
- is the path
ee3479eb6edacb31e2a1b7fdc8871e615970d293
- is a commit
Use this command, this will surely helpful
typings install package_name --ambient --save
It will save package_name to typings.json, for further reference.
来源:https://stackoverflow.com/questions/37691996/how-to-install-typescript-definitions-from-github-repo