@@ -41,11 +41,75 @@ interface Array<T> {
41
41
thisArg ?: This
42
42
) : U [ ]
43
43
44
+ /**
45
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
46
+ * specified depth.
47
+ *
48
+ * @param depth The maximum recursion depth
49
+ */
50
+ flatten < U > ( this : U [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] , depth : 7 ) : U [ ] ;
51
+
52
+ /**
53
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
54
+ * specified depth.
55
+ *
56
+ * @param depth The maximum recursion depth
57
+ */
58
+ flatten < U > ( this : U [ ] [ ] [ ] [ ] [ ] [ ] [ ] , depth : 6 ) : U [ ] ;
59
+
60
+ /**
61
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
62
+ * specified depth.
63
+ *
64
+ * @param depth The maximum recursion depth
65
+ */
66
+ flatten < U > ( this : U [ ] [ ] [ ] [ ] [ ] [ ] , depth : 5 ) : U [ ] ;
67
+
68
+ /**
69
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
70
+ * specified depth.
71
+ *
72
+ * @param depth The maximum recursion depth
73
+ */
74
+ flatten < U > ( this : U [ ] [ ] [ ] [ ] [ ] , depth : 4 ) : U [ ] ;
75
+
76
+ /**
77
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
78
+ * specified depth.
79
+ *
80
+ * @param depth The maximum recursion depth
81
+ */
82
+ flatten < U > ( this : U [ ] [ ] [ ] [ ] , depth : 3 ) : U [ ] ;
83
+
84
+ /**
85
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
86
+ * specified depth.
87
+ *
88
+ * @param depth The maximum recursion depth
89
+ */
90
+ flatten < U > ( this : U [ ] [ ] [ ] , depth : 2 ) : U [ ] ;
91
+
92
+ /**
93
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
94
+ * specified depth.
95
+ *
96
+ * @param depth The maximum recursion depth
97
+ */
98
+ flatten < U > ( this : U [ ] [ ] , depth ?: 1 ) : U [ ] ;
99
+
100
+ /**
101
+ * Returns a new array with all sub-array elements concatenated into it recursively up to the
102
+ * specified depth.
103
+ *
104
+ * @param depth The maximum recursion depth
105
+ */
106
+ flatten < U > ( this : U [ ] , depth : 0 ) : U [ ] ;
107
+
44
108
/**
45
109
* Returns a new array with all sub-array elements concatenated into it recursively up to the
46
110
* specified depth. If no depth is provided, flatten method defaults to the depth of 1.
47
111
*
48
112
* @param depth The maximum recursion depth
49
113
*/
50
- flatten < U > ( this : U [ ] , depth ?: number ) : U [ ] ;
114
+ flatten < U > ( depth ?: number ) : any [ ] ;
51
115
}
0 commit comments