I'm new to TypeScript, when include jquery.d.ts
getting many syntax errors while building the code, I'm using VS express 2012. To include the jQuery definition I have use the following code:
/// <reference path="./jquery.d.ts" />
I get a lot of errors just from the definition file - such as this:
Error 109 Index signature parameter type must be 'string' or 'number'. D:/Able/TypeScript/HelloWorld/HelloWorld/jquery.d.ts 54 20 HelloWorld
Here is the screen shot of error...
Why is the definition file generating errors?
The TypeScript definition you have won't work in the TypeScript 0.9 compiler.
You can get the latest version from either...
Codeplex or Definitely Typed
You'll notice that the indexers are updated from:
headers?: { [key: any]: any; };
To
headers?: { [key: string]: any; };
This is to comply with tighter compiler rules that state the key must be a string or a number.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With