source: node_modules/es-toolkit/dist/compat/object/assignIn.d.ts

Last change on this file was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 4.9 KB
Line 
1/**
2 * Assigns own and inherited properties from one source object to a target object.
3 *
4 * @template T - The type of the target object.
5 * @template U - The type of the source object.
6 * @param {T} object - The target object to which properties will be assigned.
7 * @param {U} source - The source object whose properties will be assigned to the target object.
8 * @returns {T & U} The updated target object with properties from the source object assigned.
9 *
10 * @example
11 * const target = { a: 1, b: 2 };
12 * const source = { b: 3, c: 4 };
13 * const result = assignIn(target, source);
14 * // => { a: 1, b: 3, c: 4 }
15 */
16declare function assignIn<T, U>(object: T, source: U): T & U;
17/**
18 * Assigns own and inherited properties from two source objects to a target object.
19 *
20 * @template T - The type of the target object.
21 * @template U - The type of the first source object.
22 * @template V - The type of the second source object.
23 * @param {T} object - The target object to which properties will be assigned.
24 * @param {U} source1 - The first source object whose properties will be assigned to the target object.
25 * @param {V} source2 - The second source object whose properties will be assigned to the target object.
26 * @returns {T & U & V} The updated target object with properties from the source objects assigned.
27 *
28 * @example
29 * const target = { a: 1 };
30 * const source1 = { b: 2 };
31 * const source2 = { c: 3 };
32 * const result = assignIn(target, source1, source2);
33 * // => { a: 1, b: 2, c: 3 }
34 */
35declare function assignIn<T, U, V>(object: T, source1: U, source2: V): T & U & V;
36/**
37 * Assigns own and inherited properties from three source objects to a target object.
38 *
39 * @template T - The type of the target object.
40 * @template U - The type of the first source object.
41 * @template V - The type of the second source object.
42 * @template W - The type of the third source object.
43 * @param {T} object - The target object to which properties will be assigned.
44 * @param {U} source1 - The first source object whose properties will be assigned to the target object.
45 * @param {V} source2 - The second source object whose properties will be assigned to the target object.
46 * @param {W} source3 - The third source object whose properties will be assigned to the target object.
47 * @returns {T & U & V & W} The updated target object with properties from the source objects assigned.
48 *
49 * @example
50 * const target = { a: 1 };
51 * const source1 = { b: 2 };
52 * const source2 = { c: 3 };
53 * const source3 = { d: 4 };
54 * const result = assignIn(target, source1, source2, source3);
55 * // => { a: 1, b: 2, c: 3, d: 4 }
56 */
57declare function assignIn<T, U, V, W>(object: T, source1: U, source2: V, source3: W): T & U & V & W;
58/**
59 * Assigns own and inherited properties from four source objects to a target object.
60 *
61 * @template T - The type of the target object.
62 * @template U - The type of the first source object.
63 * @template V - The type of the second source object.
64 * @template W - The type of the third source object.
65 * @template X - The type of the fourth source object.
66 * @param {T} object - The target object to which properties will be assigned.
67 * @param {U} source1 - The first source object whose properties will be assigned to the target object.
68 * @param {V} source2 - The second source object whose properties will be assigned to the target object.
69 * @param {W} source3 - The third source object whose properties will be assigned to the target object.
70 * @param {X} source4 - The fourth source object whose properties will be assigned to the target object.
71 * @returns {T & U & V & W & X} The updated target object with properties from the source objects assigned.
72 *
73 * @example
74 * const target = { a: 1 };
75 * const source1 = { b: 2 };
76 * const source2 = { c: 3 };
77 * const source3 = { d: 4 };
78 * const source4 = { e: 5 };
79 * const result = assignIn(target, source1, source2, source3, source4);
80 * // => { a: 1, b: 2, c: 3, d: 4, e: 5 }
81 */
82declare function assignIn<T, U, V, W, X>(object: T, source1: U, source2: V, source3: W, source4: X): T & U & V & W & X;
83/**
84 * Returns the target object as-is.
85 *
86 * @template T - The type of the target object.
87 * @param {T} object - The target object.
88 * @returns {T} The target object.
89 *
90 * @example
91 * const target = { a: 1, b: 2 };
92 * const result = assignIn(target);
93 * // => { a: 1, b: 2 }
94 */
95declare function assignIn<T>(object: T): T;
96/**
97 * Assigns own and inherited properties from multiple source objects to a target object.
98 *
99 * @template R - The type of the result.
100 * @param {any} object - The target object to which properties will be assigned.
101 * @param {...any[]} otherArgs - The source objects whose properties will be assigned to the target object.
102 * @returns {R} The updated target object with properties from the source objects assigned.
103 *
104 * @example
105 * const target = { a: 1 };
106 * const result = assignIn(target, { b: 2 }, { c: 3 }, { d: 4 });
107 * // => { a: 1, b: 2, c: 3, d: 4 }
108 */
109declare function assignIn<R>(object: any, ...otherArgs: any[]): R;
110
111export { assignIn };
Note: See TracBrowser for help on using the repository browser.