2

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.

2 Answers 2

4

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

Sign up to request clarification or add additional context in comments.

Comments

0

Use this command, this will surely helpful

typings install package_name --ambient --save

It will save package_name to typings.json, for further reference.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.