Defines the interface of promise which is used for asynchronous calling.
catch(onRejected?: (reason?: any)): IPromise
Call the function after a promise is rejected.
The function which will be executed when a promise is rejected. This has a single parameter, the rejection reason. The return value will be passed to the next callback function.
then(onFulfilled?: (value?: any), onRejected?: (reason?: any)): IPromise
Call the function after a promise is fulfilled or rejected.
The function which will be executed when a promise is fulfilled. This has a single parameter, the fulfillment value. If a value is returned, it will be passed to the next callback function. If no value is returned, the original value will be passed.
The function which will be executed when a promise is rejected. This has a single parameter, the rejection reason. If a value is returned, it will be passed to the next callback function. If no value is returned, the original value will be passed.