Skip to content

Commit c7c774d

Browse files
committed
Merge branch 'master' of https://github.com/Microsoft/TypeScript into fixingTypeParameters
2 parents d57e8d1 + 35ca82c commit c7c774d

16 files changed

+30757
-20854
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
[![Build Status](https://travis-ci.org/Microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/Microsoft/TypeScript)
2-
[![Issue Stats](http://issuestats.com/github/Microsoft/TypeScript/badge/pr)](http://issuestats.com/github/microsoft/typescript)
3-
[![Issue Stats](http://issuestats.com/github/Microsoft/TypeScript/badge/issue)](http://issuestats.com/github/microsoft/typescript)
42
[![npm version](https://badge.fury.io/js/typescript.svg)](http://badge.fury.io/js/typescript)
53
[![Downloads](http://img.shields.io/npm/dm/TypeScript.svg)](https://npmjs.org/package/typescript)
64

bin/lib.core.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,3 +1184,16 @@ declare type ClassDecorator = <TFunction extends Function>(target: TFunction) =>
11841184
declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
11851185
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
11861186
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+
}

bin/lib.core.es6.d.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,6 +1184,19 @@ declare type ClassDecorator = <TFunction extends Function>(target: TFunction) =>
11841184
declare type PropertyDecorator = (target: Object, propertyKey: string | symbol) => void;
11851185
declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void;
11861186
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+
}
11871200
declare type PropertyKey = string | number | symbol;
11881201

11891202
interface Symbol {
@@ -4759,17 +4772,6 @@ declare module Reflect {
47594772
function setPrototypeOf(target: any, proto: any): boolean;
47604773
}
47614774

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-
47734775
/**
47744776
* Represents the completion of an asynchronous operation
47754777
*/
@@ -4789,6 +4791,7 @@ interface Promise<T> {
47894791
* @returns A Promise for the completion of the callback.
47904792
*/
47914793
catch(onrejected?: (reason: any) => T | PromiseLike<T>): Promise<T>;
4794+
catch(onrejected?: (reason: any) => void): Promise<T>;
47924795

47934796
[Symbol.toStringTag]: string;
47944797
}

0 commit comments

Comments
 (0)