@@ -51,11 +51,41 @@ interface SymbolConstructor {
5151 isConcatSpreadable : symbol ;
5252
5353 /**
54- * A method that returns the default iterator for an object.Called by the semantics of the
54+ * A method that returns the default iterator for an object. Called by the semantics of the
5555 * for-of statement.
5656 */
5757 iterator : symbol ;
5858
59+ /**
60+ * A regular expression method that matches the regular expression against a string. Called
61+ * by the String.prototype.match method.
62+ */
63+ match : symbol ;
64+
65+ /**
66+ * A regular expression method that replaces matched substrings of a string. Called by the
67+ * String.prototype.replace method.
68+ */
69+ replace : symbol ;
70+
71+ /**
72+ * A regular expression method that returns the index within a string that matches the
73+ * regular expression. Called by the String.prototype.search method.
74+ */
75+ search : symbol ;
76+
77+ /**
78+ * A function valued property that is the constructor function that is used to create
79+ * derived objects.
80+ */
81+ species : symbol ;
82+
83+ /**
84+ * A regular expression method that splits a string at the indices that match the regular
85+ * expression. Called by the String.prototype.split method.
86+ */
87+ split : symbol ;
88+
5989 /**
6090 * A method that converts an object to a corresponding primitive value.Called by the ToPrimitive
6191 * abstract operation.
@@ -3542,6 +3572,16 @@ declare module Reflect {
35423572 function setPrototypeOf ( target : any , proto : any ) : boolean ;
35433573}
35443574
3575+ interface IPromise < T > {
3576+ /**
3577+ * Attaches callbacks for the resolution and/or rejection of the Promise.
3578+ * @param onfulfilled The callback to execute when the Promise is resolved.
3579+ * @param onrejected The callback to execute when the Promise is rejected.
3580+ * @returns A Promise for the completion of which ever callback is executed.
3581+ */
3582+ then < TResult > ( onfulfilled ?: ( value : T ) => TResult | IPromise < TResult > , onrejected ?: ( reason : any ) => TResult | IPromise < TResult > ) : IPromise < TResult > ;
3583+ }
3584+
35453585/**
35463586 * Represents the completion of an asynchronous operation
35473587 */
@@ -3552,14 +3592,16 @@ interface Promise<T> {
35523592 * @param onrejected The callback to execute when the Promise is rejected.
35533593 * @returns A Promise for the completion of which ever callback is executed.
35543594 */
3555- then < TResult > ( onfulfilled ?: ( value : T ) => TResult | Promise < TResult > , onrejected ?: ( reason : any ) => TResult | Promise < TResult > ) : Promise < TResult > ;
3595+ then < TResult > ( onfulfilled ?: ( value : T ) => TResult | IPromise < TResult > , onrejected ?: ( reason : any ) => TResult | IPromise < TResult > ) : Promise < TResult > ;
35563596
35573597 /**
35583598 * Attaches a callback for only the rejection of the Promise.
35593599 * @param onrejected The callback to execute when the Promise is rejected.
35603600 * @returns A Promise for the completion of the callback.
35613601 */
3562- catch ( onrejected ?: ( reason : any ) => T | Promise < T > ) : Promise < T > ;
3602+ catch ( onrejected ?: ( reason : any ) => T | IPromise < T > ) : Promise < T > ;
3603+
3604+ [ Symbol . toStringTag ] : string ;
35633605}
35643606
35653607interface PromiseConstructor {
@@ -3570,37 +3612,27 @@ interface PromiseConstructor {
35703612
35713613 /**
35723614 * Creates a new Promise.
3573- * @param init A callback used to initialize the promise. This callback is passed two arguments:
3615+ * @param executor A callback used to initialize the promise. This callback is passed two arguments:
35743616 * a resolve callback used resolve the promise with a value or the result of another promise,
35753617 * and a reject callback used to reject the promise with a provided reason or error.
35763618 */
3577- new < T > ( init : ( resolve : ( value ?: T | Promise < T > ) => void , reject : ( reason ?: any ) => void ) => void ) : Promise < T > ;
3578-
3579- < T > ( init : ( resolve : ( value ?: T | Promise < T > ) => void , reject : ( reason ?: any ) => void ) => void ) : Promise < T > ;
3619+ new < T > ( executor : ( resolve : ( value ?: T | IPromise < T > ) => void , reject : ( reason ?: any ) => void ) => void ) : Promise < T > ;
35803620
35813621 /**
35823622 * Creates a Promise that is resolved with an array of results when all of the provided Promises
35833623 * resolve, or rejected when any Promise is rejected.
35843624 * @param values An array of Promises.
35853625 * @returns A new Promise.
35863626 */
3587- all < T > ( values : ( T | Promise < T > ) [ ] ) : Promise < T [ ] > ;
3588-
3589- /**
3590- * Creates a Promise that is resolved with an array of results when all of the provided Promises
3591- * resolve, or rejected when any Promise is rejected.
3592- * @param values An array of values.
3593- * @returns A new Promise.
3594- */
3595- all ( values : Promise < void > [ ] ) : Promise < void > ;
3627+ all < T > ( values : Iterable < T | IPromise < T > > ) : Promise < T [ ] > ;
35963628
35973629 /**
35983630 * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
35993631 * or rejected.
36003632 * @param values An array of Promises.
36013633 * @returns A new Promise.
36023634 */
3603- race < T > ( values : ( T | Promise < T > ) [ ] ) : Promise < T > ;
3635+ race < T > ( values : Iterable < T | IPromise < T > > ) : Promise < T > ;
36043636
36053637 /**
36063638 * Creates a new rejected promise for the provided reason.
@@ -3621,13 +3653,15 @@ interface PromiseConstructor {
36213653 * @param value A promise.
36223654 * @returns A promise whose internal state matches the provided promise.
36233655 */
3624- resolve < T > ( value : T | Promise < T > ) : Promise < T > ;
3656+ resolve < T > ( value : T | IPromise < T > ) : Promise < T > ;
36253657
36263658 /**
36273659 * Creates a new resolved promise .
36283660 * @returns A resolved promise.
36293661 */
36303662 resolve ( ) : Promise < void > ;
3663+
3664+ [ Symbol . species ] : Function ;
36313665}
36323666
36333667declare var Promise : PromiseConstructor ;
0 commit comments