mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
+ changed promise declaration to own custom since it is not possible to reuse ES6 polyfill promise class declaration
This commit is contained in:
Vendored
+6
-8
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user