1) The Object interface is defined in lib.d.ts and changed slightly in the latest release with the general tightening up of the type inference system. Just change jaydata.d.ts so that valueOf
returns an Object
and that's solved.
interface IPromise<T> extends Object {
then: {
(handler: (args: T) => void ): IPromise<any>;
(handler: (args: T) => any): IPromise<any>;
};
fail: {
(handler: (args: T) => void ): IPromise<any>;
(handler: (args: T) => any): IPromise<any>;
};
valueOf(): Object;
}
2) This is caused by the same tightening up. Before when there was a generic type with no type parameter it would assume any, and now it's an error instead of making that assumption. The code will work the same if you just make it explicit. For example:
Old:
var x: IPromise;
New:
var x: IPromise<any>;
My understanding if that these kinds of breaking changes won't happen after the 1.0 release.