+ changed promise declaration to own custom since it is not possible to reuse ES6 polyfill promise class declaration

This commit is contained in:
reppners
2015-03-05 08:42:15 +01:00
parent 5f2cc5b966
commit a6cbfba663
3 changed files with 14 additions and 14 deletions
+6 -8
View File
@@ -3,12 +3,6 @@
// Definitions by: Stefan Steinhart <https://github.com/reppners>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
///////////////////////////////////////////////////////////////////////////////
// Promises in js-data are ES6 polyfill promises
///////////////////////////////////////////////////////////////////////////////
/// <reference path="../es6-promise/es6-promise.d.ts" />
///////////////////////////////////////////////////////////////////////////////
// js-data module (js-data.js)
///////////////////////////////////////////////////////////////////////////////
@@ -16,10 +10,14 @@
// defining what exists in JSData and how it looks
declare module JSData {
interface JSDataPromise<R> extends Promise<R> {
interface JSDataPromise<R> {
then<U>(onFulfilled?: (value: R) => U | JSDataPromise<U>, onRejected?: (error: any) => U | JSDataPromise<U>): JSDataPromise<U>;
catch<U>(onRejected?: (error: any) => U | JSDataPromise<U>): JSDataPromise<U>;
// enhanced with finally
finally<U>(finallyCb?:() => U):Promise<U>;
finally<U>(finallyCb?:() => U):JSDataPromise<U>;
}
//TODO switch to class again when typescript supports open ended class declaration