npm install tsd -gIf not previously installed, install git , python (v2.xx) and nodejs . All of them must be registered in the PATH.
npm install tsd -g --msvs_version = 2013where 2013 is the studio version. If you installed the Express version, you must specify --msvs_version = 2013e.
{ "version": "v4", "repo": "borisyankov/DefinitelyTyped", "ref": "master", "path": "ClientSide/typings", "bundle": "ClientSide/typings/tsd.d.ts", "installed": { "bootstrap/bootstrap.d.ts": { "commit": "1c829808b649eb0c794ec8caf38177495a5d7630" }, "jquery/jquery.d.ts": { "commit": "1c829808b649eb0c794ec8caf38177495a5d7630" }, "angularjs/angular.d.ts": { "commit": "1c829808b649eb0c794ec8caf38177495a5d7630" }, "angularjs/angular-resource.d.ts": { "commit": "1c829808b649eb0c794ec8caf38177495a5d7630" } } }
module.exports = function (grunt) { grunt.initConfig({ bower: { ... } }, tsd: { refresh: { options: { command: 'reinstall', latest: true, config: 'tsd.json', opts: { } } } } }); grunt.registerTask("default", ["bower:install"]); grunt.loadNpmTasks("grunt-bower-task"); grunt.loadNpmTasks("grunt-tsd"); };
/// <reference path="typings/tsd.d.ts" /> module Demo { 'use strict'; var todomvc = angular.module('app', []) .controller('demoCtrl', DemoCtrl); }
/// <reference path="../typings/tsd.d.ts" /> module Demo { export interface IDemoScope extends ng.IScope { greeting: string; login: (name: string) => void; } }
/// <reference path="../typings/tsd.d.ts" /> /// <reference path="../interfaces/idemoscope.ts" /> module Demo { 'use strict'; export class DemoCtrl { constructor(private $scope: IDemoScope) { $scope.greeting = "Wellcome!" $scope.login = function (name) { $scope.greeting = "Hello, " + name + "!"; } } } }
"Typescript": "^ 1.4.1",
"Grunt-typescript": "^ 0.6.1"
module.exports = function (grunt) { grunt.initConfig({ bower: { ... }, tsd: { ... }, typescript: { base: { src: ['ClientSide/**/*.ts'], dest: 'wwwroot/app.js', options: { module: 'amd', target: 'es5' } } } }); ... grunt.loadNpmTasks("grunt-typescript"); };
"angular": "^1.3.10"
"angular": { "": "*.{js,css}" },
<html ng-app="demo">
<script src="~/lib/angular/angular.js"></script> <script src="~/app.js"></script>
<div class="jumbotron" ng-controller="demoCtrl"> <h1>{{greeting}}</h1> <input type="text" ng-model="name" /> <button ng-click="login(name)">Log In</button> </div>
Source: https://habr.com/ru/post/249361/
All Articles