@@ -561,7 +561,7 @@ interface Math {
561
561
*/
562
562
atan ( x : number ) : number ;
563
563
/**
564
- * Returns the angle (in radians) from the X axis to a point (y,x) .
564
+ * Returns the angle (in radians) from the X axis to a point.
565
565
* @param y A numeric expression representing the cartesian y-coordinate.
566
566
* @param x A numeric expression representing the cartesian x-coordinate.
567
567
*/
@@ -1237,11 +1237,41 @@ interface SymbolConstructor {
1237
1237
isConcatSpreadable : symbol ;
1238
1238
1239
1239
/**
1240
- * A method that returns the default iterator for an object.Called by the semantics of the
1240
+ * A method that returns the default iterator for an object. Called by the semantics of the
1241
1241
* for-of statement.
1242
1242
*/
1243
1243
iterator : symbol ;
1244
1244
1245
+ /**
1246
+ * A regular expression method that matches the regular expression against a string. Called
1247
+ * by the String.prototype.match method.
1248
+ */
1249
+ match : symbol ;
1250
+
1251
+ /**
1252
+ * A regular expression method that replaces matched substrings of a string. Called by the
1253
+ * String.prototype.replace method.
1254
+ */
1255
+ replace : symbol ;
1256
+
1257
+ /**
1258
+ * A regular expression method that returns the index within a string that matches the
1259
+ * regular expression. Called by the String.prototype.search method.
1260
+ */
1261
+ search : symbol ;
1262
+
1263
+ /**
1264
+ * A function valued property that is the constructor function that is used to create
1265
+ * derived objects.
1266
+ */
1267
+ species : symbol ;
1268
+
1269
+ /**
1270
+ * A regular expression method that splits a string at the indices that match the regular
1271
+ * expression. Called by the String.prototype.split method.
1272
+ */
1273
+ split : symbol ;
1274
+
1245
1275
/**
1246
1276
* A method that converts an object to a corresponding primitive value.Called by the ToPrimitive
1247
1277
* abstract operation.
@@ -1628,7 +1658,7 @@ interface IteratorResult<T> {
1628
1658
}
1629
1659
1630
1660
interface Iterator < T > {
1631
- next ( ) : IteratorResult < T > ;
1661
+ next ( value ?: any ) : IteratorResult < T > ;
1632
1662
return ?( value ?: any ) : IteratorResult < T > ;
1633
1663
throw ?( e ?: any ) : IteratorResult < T > ;
1634
1664
}
@@ -4728,6 +4758,16 @@ declare module Reflect {
4728
4758
function setPrototypeOf ( target : any , proto : any ) : boolean ;
4729
4759
}
4730
4760
4761
+ interface PromiseLike < T > {
4762
+ /**
4763
+ * Attaches callbacks for the resolution and/or rejection of the Promise.
4764
+ * @param onfulfilled The callback to execute when the Promise is resolved.
4765
+ * @param onrejected The callback to execute when the Promise is rejected.
4766
+ * @returns A Promise for the completion of which ever callback is executed.
4767
+ */
4768
+ then < TResult > ( onfulfilled ?: ( value : T ) => TResult | PromiseLike < TResult > , onrejected ?: ( reason : any ) => TResult | PromiseLike < TResult > ) : PromiseLike < TResult > ;
4769
+ }
4770
+
4731
4771
/**
4732
4772
* Represents the completion of an asynchronous operation
4733
4773
*/
@@ -4738,14 +4778,16 @@ interface Promise<T> {
4738
4778
* @param onrejected The callback to execute when the Promise is rejected.
4739
4779
* @returns A Promise for the completion of which ever callback is executed.
4740
4780
*/
4741
- then < TResult > ( onfulfilled ?: ( value : T ) => TResult | Promise < TResult > , onrejected ?: ( reason : any ) => TResult | Promise < TResult > ) : Promise < TResult > ;
4781
+ then < TResult > ( onfulfilled ?: ( value : T ) => TResult | PromiseLike < TResult > , onrejected ?: ( reason : any ) => TResult | PromiseLike < TResult > ) : Promise < TResult > ;
4742
4782
4743
4783
/**
4744
4784
* Attaches a callback for only the rejection of the Promise.
4745
4785
* @param onrejected The callback to execute when the Promise is rejected.
4746
4786
* @returns A Promise for the completion of the callback.
4747
4787
*/
4748
- catch ( onrejected ?: ( reason : any ) => T | Promise < T > ) : Promise < T > ;
4788
+ catch ( onrejected ?: ( reason : any ) => T | PromiseLike < T > ) : Promise < T > ;
4789
+
4790
+ [ Symbol . toStringTag ] : string ;
4749
4791
}
4750
4792
4751
4793
interface PromiseConstructor {
@@ -4756,37 +4798,27 @@ interface PromiseConstructor {
4756
4798
4757
4799
/**
4758
4800
* Creates a new Promise.
4759
- * @param init A callback used to initialize the promise. This callback is passed two arguments:
4801
+ * @param executor A callback used to initialize the promise. This callback is passed two arguments:
4760
4802
* a resolve callback used resolve the promise with a value or the result of another promise,
4761
4803
* and a reject callback used to reject the promise with a provided reason or error.
4762
4804
*/
4763
- new < T > ( init : ( resolve : ( value ?: T | Promise < T > ) => void , reject : ( reason ?: any ) => void ) => void ) : Promise < T > ;
4764
-
4765
- < T > ( init : ( resolve : ( value ?: T | Promise < T > ) => void , reject : ( reason ?: any ) => void ) => void ) : Promise < T > ;
4805
+ new < T > ( executor : ( resolve : ( value ?: T | PromiseLike < T > ) => void , reject : ( reason ?: any ) => void ) => void ) : Promise < T > ;
4766
4806
4767
4807
/**
4768
4808
* Creates a Promise that is resolved with an array of results when all of the provided Promises
4769
4809
* resolve, or rejected when any Promise is rejected.
4770
4810
* @param values An array of Promises.
4771
4811
* @returns A new Promise.
4772
4812
*/
4773
- all < T > ( values : ( T | Promise < T > ) [ ] ) : Promise < T [ ] > ;
4774
-
4775
- /**
4776
- * Creates a Promise that is resolved with an array of results when all of the provided Promises
4777
- * resolve, or rejected when any Promise is rejected.
4778
- * @param values An array of values.
4779
- * @returns A new Promise.
4780
- */
4781
- all ( values : Promise < void > [ ] ) : Promise < void > ;
4813
+ all < T > ( values : Iterable < T | PromiseLike < T > > ) : Promise < T [ ] > ;
4782
4814
4783
4815
/**
4784
4816
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
4785
4817
* or rejected.
4786
4818
* @param values An array of Promises.
4787
4819
* @returns A new Promise.
4788
4820
*/
4789
- race < T > ( values : ( T | Promise < T > ) [ ] ) : Promise < T > ;
4821
+ race < T > ( values : Iterable < T | PromiseLike < T > > ) : Promise < T > ;
4790
4822
4791
4823
/**
4792
4824
* Creates a new rejected promise for the provided reason.
@@ -4807,13 +4839,15 @@ interface PromiseConstructor {
4807
4839
* @param value A promise.
4808
4840
* @returns A promise whose internal state matches the provided promise.
4809
4841
*/
4810
- resolve < T > ( value : T | Promise < T > ) : Promise < T > ;
4842
+ resolve < T > ( value : T | PromiseLike < T > ) : Promise < T > ;
4811
4843
4812
4844
/**
4813
4845
* Creates a new resolved promise .
4814
4846
* @returns A resolved promise.
4815
4847
*/
4816
4848
resolve ( ) : Promise < void > ;
4849
+
4850
+ [ Symbol . species ] : Function ;
4817
4851
}
4818
4852
4819
4853
declare var Promise : PromiseConstructor ;
0 commit comments