@@ -1184,6 +1184,19 @@ declare type ClassDecorator = <TFunction extends Function>(target: TFunction) =>
1184
1184
declare type PropertyDecorator = ( target : Object , propertyKey : string | symbol ) => void ;
1185
1185
declare type MethodDecorator = < T > ( target : Object , propertyKey : string | symbol , descriptor : TypedPropertyDescriptor < T > ) => TypedPropertyDescriptor < T > | void ;
1186
1186
declare type ParameterDecorator = ( target : Object , propertyKey : string | symbol , parameterIndex : number ) => void ;
1187
+
1188
+ declare type PromiseConstructorLike = new < T > ( executor : ( resolve : ( value ?: T | PromiseLike < T > ) => void , reject : ( reason ?: any ) => void ) => void ) => PromiseLike < T > ;
1189
+
1190
+ interface PromiseLike < T > {
1191
+ /**
1192
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
1193
+ * @param onfulfilled The callback to execute when the Promise is resolved.
1194
+ * @param onrejected The callback to execute when the Promise is rejected.
1195
+ * @returns A Promise for the completion of which ever callback is executed.
1196
+ */
1197
+ then < TResult > ( onfulfilled ?: ( value : T ) => TResult | PromiseLike < TResult > , onrejected ?: ( reason : any ) => TResult | PromiseLike < TResult > ) : PromiseLike < TResult > ;
1198
+ then < TResult > ( onfulfilled ?: ( value : T ) => TResult | PromiseLike < TResult > , onrejected ?: ( reason : any ) => void ) : PromiseLike < TResult > ;
1199
+ }
1187
1200
declare type PropertyKey = string | number | symbol ;
1188
1201
1189
1202
interface Symbol {
@@ -4759,17 +4772,6 @@ declare module Reflect {
4759
4772
function setPrototypeOf ( target : any , proto : any ) : boolean ;
4760
4773
}
4761
4774
4762
- interface PromiseLike < T > {
4763
- /**
4764
- * Attaches callbacks for the resolution and/or rejection of the Promise.
4765
- * @param onfulfilled The callback to execute when the Promise is resolved.
4766
- * @param onrejected The callback to execute when the Promise is rejected.
4767
- * @returns A Promise for the completion of which ever callback is executed.
4768
- */
4769
- then < TResult > ( onfulfilled ?: ( value : T ) => TResult | PromiseLike < TResult > , onrejected ?: ( reason : any ) => TResult | PromiseLike < TResult > ) : PromiseLike < TResult > ;
4770
- then < TResult > ( onfulfilled ?: ( value : T ) => TResult | PromiseLike < TResult > , onrejected ?: ( reason : any ) => void ) : PromiseLike < TResult > ;
4771
- }
4772
-
4773
4775
/**
4774
4776
* Represents the completion of an asynchronous operation
4775
4777
*/
@@ -4789,6 +4791,7 @@ interface Promise<T> {
4789
4791
* @returns A Promise for the completion of the callback.
4790
4792
*/
4791
4793
catch ( onrejected ?: ( reason : any ) => T | PromiseLike < T > ) : Promise < T > ;
4794
+ catch ( onrejected ?: ( reason : any ) => void ) : Promise < T > ;
4792
4795
4793
4796
[ Symbol . toStringTag ] : string ;
4794
4797
}
0 commit comments