Skip to content

Commit 6969986

Browse files
committed
Use intersection types in Object.assing defintion
1 parent e200dad commit 6969986

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

src/lib/es6.d.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,33 @@ interface Object {
121121
}
122122

123123
interface ObjectConstructor {
124+
/**
125+
* Copy the values of all of the enumerable own properties from one or more source objects to a
126+
* target object. Returns the target object.
127+
* @param target The target object to copy to.
128+
* @param source source objects to copy properties from.
129+
*/
130+
assign<T, U>(target: T, source: U): T & U;
131+
132+
/**
133+
* Copy the values of all of the enumerable own properties from one or more source objects to a
134+
* target object. Returns the target object.
135+
* @param target The target object to copy to.
136+
* @param source1 first source objects to copy properties from.
137+
* @param source2 second source objects to copy properties from.
138+
*/
139+
assign<T, U, V>(target: T, source1: U, source2: V): T & U & V;
140+
141+
/**
142+
* Copy the values of all of the enumerable own properties from one or more source objects to a
143+
* target object. Returns the target object.
144+
* @param target The target object to copy to.
145+
* @param source1 first source objects to copy properties from.
146+
* @param source2 second source objects to copy properties from.
147+
* @param source3 second source objects to copy properties from.
148+
*/
149+
assign<T, U, V, W>(target: T, source1: U, source2: V, source3: W): T & U & V & W;
150+
124151
/**
125152
* Copy the values of all of the enumerable own properties from one or more source objects to a
126153
* target object. Returns the target object.

0 commit comments

Comments
 (0)