From 25e18b592470e3dddccc826fde2bb8e7610ef863 Mon Sep 17 00:00:00 2001 From: Aluan Haddad Date: Mon, 25 Jul 2016 12:37:59 -0400 Subject: [PATCH] Improve precision of Object.assign signature Modified the signature of `Object.assign`, adding three overloads, and adjusting the documentation of the fourth. Please note that these have been copied verbatim from the _lib.es2015.core.d.ts_ file shipped with typescript@2.1.0-dev.20160725. --- core-js/core-js.d.ts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/core-js/core-js.d.ts b/core-js/core-js.d.ts index e9be316364..c633dc4ef6 100644 --- a/core-js/core-js.d.ts +++ b/core-js/core-js.d.ts @@ -31,7 +31,34 @@ interface ObjectConstructor { * Copy the values of all of the enumerable own properties from one or more source objects to a * target object. Returns the target object. * @param target The target object to copy to. - * @param sources One or more source objects to copy properties from. + * @param source The source object from which to copy properties. + */ + assign(target: T, source: U): T & U; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V): T & U & V; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param source1 The first source object from which to copy properties. + * @param source2 The second source object from which to copy properties. + * @param source3 The third source object from which to copy properties. + */ + assign(target: T, source1: U, source2: V, source3: W): T & U & V & W; + + /** + * Copy the values of all of the enumerable own properties from one or more source objects to a + * target object. Returns the target object. + * @param target The target object to copy to. + * @param sources One or more source objects from which to copy properties */ assign(target: any, ...sources: any[]): any;