Error 545 Interface 'JQueryPromise' incorrectly extends interface 'JQueryGenericPromise'.
Types of property 'then' are incompatible.
Type '(doneCallbacks: any, failCallbacks: any, progressCallbacks?: any) => JQueryPromise' is not assignable to type '{ (doneFilter: (value?: T, ...values: any[]) => U | JQueryPromise, failFilter?: (...reasons...'.
Type 'JQueryPromise' is not assignable to type 'JQueryPromise'.
Type 'T' is not assignable to type 'void'. X:\Web\Scripts\typings\jquery\jquery.d.ts @ Lines: 304 Column: 11Use Package Management Console reinstall version 2.2.2, it works fine.
Then I found that the issue happened only when using Kendo UI's TypeScript definition, kendo.all.d.ts, with jQuery definition 2.2.3, but I am not sure which definition should be modified. I have reported it on Github, but I think Kendo team can help.
Here is a simple project to reproduce the issue: https://www.dropbox.com/s/qfemleptefy5stp/JQTSTest.zip?dl=0
12 Answers, 1 is accepted
In kendo.all.d.ts (line 15060)
interface JQueryPromise<T> {
pipe(doneFilter?: (x: any) => any, failFilter?: (x: any) => any, progressFilter?: (x: any) => any): JQueryPromise<T>;
then(doneCallbacks: any, failCallbacks: any, progressCallbacks?: any): JQueryPromise<T>;
}
is not compatible with jQuery definition 2.2.3.
Reference: https://github.com/borisyankov/DefinitelyTyped/issues/3976#issuecomment-88411743
thank you very much for the report and for the linked resources; we will investigate it further and hopefully address it soon.
Regards,
Petyo
Telerik
I'm getting this error to.
I have:
// Type definitions for jQuery 1.10.x / 2.0.x
// Type definitions for Kendo UI (included in th e kendoui.professional.2015.1.408.commercial distribution file)
Please accept our apologies; the problem is not yet addressed. We will look into resolving it soon.
Regards,
Petyo
Telerik
Hi Jeffrey
I recently decided to migrate my coffee scripts to typescript, however, upon first attempt at migrating anything kendo related VS displayed the compilation error you experienced too.
It made me winder if migrating my kendo related coffee scripts to typescript is possible. I presume that the kendo.all.d.ts file must be updated with every kendo.all.js update.
Have you been writing typescripts with kendo references for a long time?
Is this the first time you have this error?
/Morten
Morten,
I have been writing TypeScirpt with Kendo references for more than one year, the compilation error happened only after jQuery.d.ts upgraded to 2.2.3 one month ago. Everything goes fine before 2.2.2.
It's easy to fix this issue by comment interface JQueryPromise<T> declaration in kendo.all.d.ts as a workaround, and I believe Telerik will fix it soon. Don't worry about using TypeScript with Kendo UI, just do it! Have fun.
Regards,
Jeffrey
Thanks Jeffrey
one last question (ts is fairly new to me). After commenting the interface JQueryPromise<T> the VS2013 solution builds alright, however in my "Error list" window I now get one error for every class implementing the interface.
1069 Cannot find name 'JQueryPromise'. C:\Projects\WebSite\Scripts\typings\kendo\kendo.all.d.ts 374 11 kendo.all.d.ts
54 errors in all.
Do I need to worry about this?
/Morten
Morten,
In my test, commenting line 15060-15063 of kendo.all.d.ts fixed the error, and I can use JQueryPromise<T> in my TypeScript without any error. Do you reference jquery.d.ts in your project? There is an official JQueryPromise<T> declaration inside jquery.d.ts, for kendo.all.d.ts to use. For your reference.
Jeffrey
Hi Jeffrey
Thanks for your reply.
For reference:
- I updated to 2015.1.430 version of kendo.all.d.ts
- commented out the interface "interface JQueryPromise<T> {" (lines 15376-15379 in the file kendo.all.d.ts).
- referenced jquery.d.ts in kendo.all.d.ts /// <reference path="jquery/jquery.d.ts" />
I'm having the same problem in kendo.web.d.ts on version 2015.1.429
Commenting out the interface as in previous comments has allowed the project to build again.
Oh, and tslint spammed 500 warnings into my error console about this file. I had to add /* tslint:disable */ at the top of the file to get Web Essentials to ignore it.
thanks for sharing that info - we will run the tslint on the file and see if we can fix the errors.
Regards,
Petyo
Telerik