1

I started to use TypeScript recently. Now I would like to use this linq.js library. Even though my problem may not be specific to this library.

I installed the library with

jspm install npm:linq

I use this to import this library

import * as Enumerable from "linq";

The code works fine. But I don't get any intellisense typing. Then I tried to install the type definition with

tsd install linq.3.0.3-Beta4

However, I still don't get correct intellisense in the code.

I found out if I remove

import * as Enumerable from "linq"; 

at the top of my file The intellisense typing will be WORKING, but at runtime, the library is not imported and the code won't work correctly.

I tried things like

/// <reference path="typings/linq/linq.d.ts" />

It doesn't change the situation. And I think I don't need this explicit reference since I can get intellisense without the import above.

What did I miss here?

Reference: DefinitelyTyped file URL. Library file URL.

Morio
  • 8,463
  • 5
  • 25
  • 29
  • Looking at the definition file, it only seems to recognize setting up `linq` as a globally-available module. (It also, by the way, contains no actual "code" - it's just an interface file to make the IDE experience pleasant and give intellisense). The way you're bringing in LINQ (not wrong, but different) is importing it, which requires a different definition statement. Have you set up your project in tsconfig.json to use something like "amd" or "CommonJS" or "ES6" imports? You may be able to remedy this with a small change to the definition file. – Katana314 Feb 26 '16 at 21:11

0 Answers0