Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JQuery Typescript definitions using 'bool' instead of 'Boolean'

I got the "Definitely Typed" typescript definition file for JQuery and it uses bool instead of 'Boolean'.

This is giving me errors in my typescript project: Cannot find name 'bool'

I changed my version to use Boolean and it works, but it has me confused.

Is Definitely Typed still the place to get typescript definitions? If so, why is it not breaking for everyone else?

Is there a better place to get typescript definitions?

like image 286
Vaccano Avatar asked Dec 03 '15 22:12

Vaccano


2 Answers

The correct name to use is boolean, not Boolean.

Definitely Typed is still the correct place to get definitions from.

Where did you get this file? The current version (https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/jquery/jquery.d.ts) does not use bool anywhere.

like image 51
Ryan Cavanaugh Avatar answered Oct 02 '22 04:10

Ryan Cavanaugh


This happened to me as well when I first setup Typescript for an AngularJS project.

  1. Go to Manage NuGet Packages for Solution
  2. View the Updates section, you should see jquery.TypeScript.DefinitelyTyped in the list.
  3. Update the package and the compilation errors will go away.

Hope this helps.

like image 28
t-ashraf Avatar answered Oct 02 '22 05:10

t-ashraf