Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jquery.d.ts errors when added to projects

  1. I created a new TypeScript project.
  2. Created a folder called types
  3. Downloaded jquery.d.ts from https://github.com/borisyankov/DefinitelyTyped/tree/master/jquery and placed it in the folder.

If I create a new TypeScript file and drag jquery.d.ts onto the document, such that the only thing at the top of the page is.

/// <reference path="types/jquery.d.ts" />

I get 101 Errors. Starting from the top of jquery.d.ts - VS has a problem with boolean in the async?: boolean; line.

interface JQueryAjaxSettings {
accepts?: any;
async?: boolean; 

What am I doing wrong here, I'm assuming that jquery.d.ts has some form of dependency, but I don't know where to start?

like image 327
Warrick FitzGerald Avatar asked Mar 22 '26 01:03

Warrick FitzGerald


1 Answers

The most likely cause of this error is that you are running an older version of the TypeScript compiler.

In TypeScript 0.9 the language specification was updated from bool to boolean. This means boolean will only compiler in 0.9+. If you have a 0.8 compiler, it won't understand what a boolean is.

You can either upgrade to the latest compiler, or check the version history on GitHub for jQuery.d.ts to find an old version with bool rather than boolean.

like image 113
Fenton Avatar answered Mar 23 '26 15:03

Fenton