From 6969986bf0a3721845a0dff8eee706a75948968b Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Mon, 31 Aug 2015 14:54:01 -0700 Subject: [PATCH] Use intersection types in Object.assing defintion --- src/lib/es6.d.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/lib/es6.d.ts b/src/lib/es6.d.ts index c07d047b58e..d44b6c0f41a 100644 --- a/src/lib/es6.d.ts +++ b/src/lib/es6.d.ts @@ -121,6 +121,33 @@ interface Object { } 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 source source objects to copy properties from. + */ + 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 first source objects to copy properties from. + * @param source2 second source objects to copy properties from. + */ + 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 first source objects to copy properties from. + * @param source2 second source objects to copy properties from. + * @param source3 second source objects to copy properties from. + */ + 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.