Questions tagged [tsd]

TSD is a package manager to search and install TypeScript definition files directly from the community driven DefinitelyTyped repository.

105 questions
4
votes
4 answers

Angular 2 - import of external leaflet typescript library

Im trying to import the a typescript leaflet library into my angular 2 application. This is my map component. Ive installed leaflet.d.ts with tsd install and my application does not complain about ///
Jakob Svenningsson
  • 4,175
  • 6
  • 23
  • 26
4
votes
1 answer

How to install all typescript definition file based on packages.json?

In my project, I have a package.json file, and use npm install to install all dependencies. And now, I want auto install all typescript definition file base on package.json. How can I do it. Thanks.
ThuyNguyen
  • 1,127
  • 3
  • 14
  • 24
4
votes
1 answer

Matching typescript definition module declaration to node module importing

I have installed the popular d3 library through NPM. npm install d3 tsd install d3 -save tsc In my home.ts file, I have imported the module: import * as d3 from 'd3/d3'; This compiles correctly, but I get this semantic…
JMac
  • 1,726
  • 3
  • 14
  • 30
4
votes
2 answers

VS Code: watch typescript on save file

In Visual Studio Code, I have the following code in code in tsconfig.json { "version": "1.6.0", "compilerOptions": { "target": "es5", "module": "commonjs", "sourceMap": true, "watch": true, …
antogerva
  • 549
  • 1
  • 9
  • 22
4
votes
1 answer

"Duplicate identifier" errors with Angular2 and TSD

I'm trying to convert a project from Angular 1 to Angular 2. This is a client & server project with some common code (so I keep it together). I want to use Angular 2 on the client side so I followed the ng2 QuickStart. I am currently trying to build…
Demurgos
  • 1,568
  • 18
  • 40
4
votes
1 answer

How to use Facebook Relay in a React app written in TypeScript (TSX)?

I would like to write a new web application in React that uses Relay to communicate with a GraphQL server. Recently JSX support was introduced for TypeScript. But there is no typings declaration file (.d.ts) for Relay on DefinitelyTyped. How can I…
Korneel
  • 1,487
  • 14
  • 40
4
votes
1 answer

How to link tsd definitions automatically with bower and npm?

I'm in the process of converting an existing project to TypeScript with many bower and npm dependencies (bower.json and package.json). According to the tsd github page, TSD supports discovery and linking of definitions from packages installed…
FlavorScape
  • 13,301
  • 12
  • 75
  • 117
4
votes
0 answers

Subsequent variable declarations must have the same type. Variable 'angular' must be of type 'IAngularStatic', but here has type 'IAngularStatic'

Error happens while I try to get definitions via tsd from DefinitelyTyped Repo. Subsequent variable declarations must have the same type. Variable 'angular' must be of type 'IAngularStatic', but here has type 'IAngularStatic' When I google…
asdf_enel_hak
  • 7,474
  • 5
  • 42
  • 84
3
votes
1 answer

In TypeScript v2.2.2, how do you create a definition file for a Javascript library that doesn't have a tsd?

I am searching for a full example, or at least best practices for creating a definition file (doesn't necessarily have to be a tsd) for a JavaScript library that doesn't have one in @types or included with the package. So far I've been able to put a…
3
votes
2 answers

Add property to JQueryStatic interface

I want to add a property someString to the JQueryStatic interface so I can access it with $.someString. In index.ts, I have this code: interface JQueryStatic { someString: string; } $.someString = "string"; $ is of type JQueryStatic, however I…
James Monger
  • 10,181
  • 7
  • 62
  • 98
3
votes
1 answer

Typings ambient install not working

I am trying to install some ambient typings, but it is no longer working on my machine. I recently upgraded node so not sure if this caused it. It seems to not be looking in the dt location anymore. This is the error I get: ~/w/r/c/src (master ⚡☡)…
cubabit
  • 2,527
  • 3
  • 21
  • 34
3
votes
2 answers

Typescript Failing in Travis Build

I am trying to get my project to build on Travis (all works fine locally). I am running into an issue with Typescript. In my .travis.yml file, I ahve this group of commands: before_script: - npm i -g typescript typings - typings install -…
George Edwards
  • 8,979
  • 20
  • 78
  • 161
3
votes
1 answer

Unable to import toastr module with Angular 2

I am creating an Angular 2 application with version 2.0.0-alpha.46 and I trying to import the toastr module. I have downloaded the library and also downloaded the definitely typed file as well. In my html page, I add a