@@ -24,15 +24,15 @@ and limitations under the License.
2424 * enables reusing existing code without migrating to a specific promise implementation. Still,
2525 * we recommand the use of native promises which are available in VS Code.
2626 */
27- interface Thenable < R > {
27+ interface Thenable < T > {
2828 /**
2929 * Attaches callbacks for the resolution and/or rejection of the Promise.
3030 * @param onfulfilled The callback to execute when the Promise is resolved.
3131 * @param onrejected The callback to execute when the Promise is rejected.
3232 * @returns A Promise for the completion of which ever callback is executed.
3333 */
34- then < TResult > ( onfulfilled ?: ( value : R ) => TResult | Thenable < TResult > , onrejected ?: ( reason : any ) => TResult | Thenable < TResult > ) : Thenable < TResult > ;
35- then < TResult > ( onfulfilled ?: ( value : R ) => TResult | Thenable < TResult > , onrejected ?: ( reason : any ) => void ) : Thenable < TResult > ;
34+ then < TResult > ( onfulfilled ?: ( value : T ) => TResult | Thenable < TResult > , onrejected ?: ( reason : any ) => TResult | Thenable < TResult > ) : Thenable < TResult > ;
35+ then < TResult > ( onfulfilled ?: ( value : T ) => TResult | Thenable < TResult > , onrejected ?: ( reason : any ) => void ) : Thenable < TResult > ;
3636}
3737
3838/**
@@ -45,15 +45,15 @@ interface Promise<T> extends Thenable<T> {
4545 * @param onrejected The callback to execute when the Promise is rejected.
4646 * @returns A Promise for the completion of which ever callback is executed.
4747 */
48- then < TResult > ( onfulfilled ?: ( value : T ) => TResult | Thenable < TResult > , onrejected ?: ( reason : any ) => TResult | Thenable < TResult > ) : Promise < TResult > ;
49- then < TResult > ( onfulfilled ?: ( value : T ) => TResult | Thenable < TResult > , onrejected ?: ( reason : any ) => void ) : Promise < TResult > ;
48+ then < TResult > ( onfulfilled ?: ( value : T ) => TResult | Thenable < TResult > , onrejected ?: ( reason : any ) => TResult | Thenable < TResult > ) : Promise < TResult > ;
49+ then < TResult > ( onfulfilled ?: ( value : T ) => TResult | Thenable < TResult > , onrejected ?: ( reason : any ) => void ) : Promise < TResult > ;
5050
5151 /**
5252 * Attaches a callback for only the rejection of the Promise.
5353 * @param onrejected The callback to execute when the Promise is rejected.
5454 * @returns A Promise for the completion of the callback.
5555 */
56- catch ( onrejected ?: ( reason : any ) => T | Thenable < T > ) : Promise < T > ;
56+ catch ( onrejected ?: ( reason : any ) => T | Thenable < T > ) : Promise < T > ;
5757}
5858
5959interface PromiseConstructor {
@@ -63,50 +63,50 @@ interface PromiseConstructor {
6363 * a resolve callback used resolve the promise with a value or the result of another promise,
6464 * and a reject callback used to reject the promise with a provided reason or error.
6565 */
66- new < T > ( executor : ( resolve : ( value ?: T | Thenable < T > ) => void , reject : ( reason ?: any ) => void ) => void ) : Promise < T > ;
66+ new < T > ( executor : ( resolve : ( value ?: T | Thenable < T > ) => void , reject : ( reason ?: any ) => void ) => void ) : Promise < T > ;
6767
6868 /**
6969 * Creates a Promise that is resolved with an array of results when all of the provided Promises
7070 * resolve, or rejected when any Promise is rejected.
7171 * @param values An array of Promises.
7272 * @returns A new Promise.
7373 */
74- all < T > ( values : Array < T | Thenable < T > > ) : Promise < T [ ] > ;
74+ all < T > ( values : Array < T | Thenable < T > > ) : Promise < T [ ] > ;
7575
7676 /**
7777 * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
7878 * or rejected.
7979 * @param values An array of Promises.
8080 * @returns A new Promise.
8181 */
82- race < T > ( values : Array < T | Thenable < T > > ) : Promise < T > ;
82+ race < T > ( values : Array < T | Thenable < T > > ) : Promise < T > ;
8383
8484 /**
8585 * Creates a new rejected promise for the provided reason.
8686 * @param reason The reason the promise was rejected.
8787 * @returns A new rejected Promise.
8888 */
89- reject ( reason : any ) : Promise < void > ;
89+ reject ( reason : any ) : Promise < void > ;
9090
9191 /**
9292 * Creates a new rejected promise for the provided reason.
9393 * @param reason The reason the promise was rejected.
9494 * @returns A new rejected Promise.
9595 */
96- reject < T > ( reason : any ) : Promise < T > ;
96+ reject < T > ( reason : any ) : Promise < T > ;
9797
9898 /**
9999 * Creates a new resolved promise for the provided value.
100100 * @param value A promise.
101101 * @returns A promise whose internal state matches the provided promise.
102102 */
103- resolve < T > ( value : T | Thenable < T > ) : Promise < T > ;
103+ resolve < T > ( value : T | Thenable < T > ) : Promise < T > ;
104104
105105 /**
106106 * Creates a new resolved promise .
107107 * @returns A resolved promise.
108108 */
109- resolve ( ) : Promise < void > ;
109+ resolve ( ) : Promise < void > ;
110110}
111111
112112declare var Promise : PromiseConstructor ;
0 commit comments