I'm having trouble understanding the type of jQueryPromise. I would like my promise to be of the void type, but as long as the interface definition accepts the void, I donβt know how to return / pass the promise in accordance with the interface signature. When I compile, I get an error message:
Calling type signatures '() => JQueryPromise <{}>' and '() => JQueryPromise' are not compatible.
Here is a sample code:
module Sample { export interface Ifoo { bar: () => JQueryPromise<void>; } export class fooClass implements Ifoo { bar() { var result = $.Deferred();
What am I doing wrong; or what can i do right?
Thanks!
-John
jquery interface jquery-deferred typescript
Johnkoz
source share