Use intersection types in Object.assing defintion

This commit is contained in:
Mohamed Hegazy 2015-08-31 14:54:01 -07:00
parent e200dadd9a
commit 6969986bf0

27
src/lib/es6.d.ts vendored
View File

@ -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<T, U>(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<T, U, V>(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<T, U, V, W>(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.