@@ -10,106 +10,23 @@ interface ReadonlyArray<T> {
1010 * @param thisArg An object to which the this keyword can refer in the callback function. If
1111 * thisArg is omitted, undefined is used as the this value.
1212 */
13- flatMap < U , This = undefined > (
14- callback : ( this : This , value : T , index : number , array : T [ ] ) => U | ReadonlyArray < U > ,
15- thisArg ?: This
16- ) : U [ ]
17-
18-
19- /**
20- * Returns a new array with all sub-array elements concatenated into it recursively up to the
21- * specified depth.
22- *
23- * @param depth The maximum recursion depth
24- */
25- flat < U > ( this :
26- ReadonlyArray < U [ ] [ ] [ ] [ ] > |
27-
28- ReadonlyArray < ReadonlyArray < U [ ] [ ] [ ] > > |
29- ReadonlyArray < ReadonlyArray < U [ ] [ ] > [ ] > |
30- ReadonlyArray < ReadonlyArray < U [ ] > [ ] [ ] > |
31- ReadonlyArray < ReadonlyArray < U > [ ] [ ] [ ] > |
32-
33- ReadonlyArray < ReadonlyArray < ReadonlyArray < U [ ] [ ] > > > |
34- ReadonlyArray < ReadonlyArray < ReadonlyArray < U > [ ] [ ] > > |
35- ReadonlyArray < ReadonlyArray < ReadonlyArray < U > > [ ] [ ] > |
36- ReadonlyArray < ReadonlyArray < ReadonlyArray < U > [ ] > [ ] > |
37- ReadonlyArray < ReadonlyArray < ReadonlyArray < U [ ] > > [ ] > |
38- ReadonlyArray < ReadonlyArray < ReadonlyArray < U [ ] > [ ] > > |
39-
40- ReadonlyArray < ReadonlyArray < ReadonlyArray < ReadonlyArray < U [ ] > > > > |
41- ReadonlyArray < ReadonlyArray < ReadonlyArray < ReadonlyArray < U > [ ] > > > |
42- ReadonlyArray < ReadonlyArray < ReadonlyArray < ReadonlyArray < U > > [ ] > > |
43- ReadonlyArray < ReadonlyArray < ReadonlyArray < ReadonlyArray < U > > > [ ] > |
44-
45- ReadonlyArray < ReadonlyArray < ReadonlyArray < ReadonlyArray < ReadonlyArray < U > > > > > ,
46- depth : 4 ) : U [ ] ;
47-
48- /**
49- * Returns a new array with all sub-array elements concatenated into it recursively up to the
50- * specified depth.
51- *
52- * @param depth The maximum recursion depth
53- */
54- flat < U > ( this :
55- ReadonlyArray < U [ ] [ ] [ ] > |
56-
57- ReadonlyArray < ReadonlyArray < U > [ ] [ ] > |
58- ReadonlyArray < ReadonlyArray < U [ ] > [ ] > |
59- ReadonlyArray < ReadonlyArray < U [ ] [ ] > > |
60-
61- ReadonlyArray < ReadonlyArray < ReadonlyArray < U [ ] > > > |
62- ReadonlyArray < ReadonlyArray < ReadonlyArray < U > [ ] > > |
63- ReadonlyArray < ReadonlyArray < ReadonlyArray < U > > [ ] > |
64-
65- ReadonlyArray < ReadonlyArray < ReadonlyArray < ReadonlyArray < U > > > > ,
66- depth : 3 ) : 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- flat < U > ( this :
75- ReadonlyArray < U [ ] [ ] > |
76-
77- ReadonlyArray < ReadonlyArray < U [ ] > > |
78- ReadonlyArray < ReadonlyArray < U > [ ] > |
79-
80- ReadonlyArray < ReadonlyArray < ReadonlyArray < U > > > ,
81- depth : 2 ) : U [ ] ;
82-
83- /**
84- * Returns a new array with all sub-array elements concatenated into it recursively up to the
85- * specified depth.
86- *
87- * @param depth The maximum recursion depth
88- */
89- flat < U > ( this :
90- ReadonlyArray < U [ ] > |
91- ReadonlyArray < ReadonlyArray < U > > ,
92- depth ?: 1
93- ) : U [ ] ;
13+ flatMap < U > (
14+ callbackfn : ( value : T , index : number , array : readonly T [ ] ) => U ,
15+ thisArg ?: any
16+ ) : Flatten < U > [ ] ;
9417
9518 /**
9619 * Returns a new array with all sub-array elements concatenated into it recursively up to the
9720 * specified depth.
9821 *
9922 * @param depth The maximum recursion depth
10023 */
101- flat < U > ( this :
102- ReadonlyArray < U > ,
103- depth : 0
104- ) : U [ ] ;
105-
106- /**
107- * Returns a new array with all sub-array elements concatenated into it recursively up to the
108- * specified depth. If no depth is provided, flat method defaults to the depth of 1.
109- *
110- * @param depth The maximum recursion depth
111- */
112- flat < U > ( depth ?: number ) : any [ ] ;
24+ flat ( depth : 4 ) : Flatten < Flatten < Flatten < Flatten < T > > > > [ ] ;
25+ flat ( depth : 3 ) : Flatten < Flatten < Flatten < T > > > [ ] ;
26+ flat ( depth : 2 ) : Flatten < Flatten < T > > [ ] ;
27+ flat ( depth ?: 1 ) : Flatten < T > [ ] ;
28+ flat ( depth : 0 ) : T [ ] ;
29+ flat ( depth : number ) : ( Flatten < Flatten < Flatten < Flatten < T > > > > extends readonly any [ ] ? unknown : Flatten < Flatten < Flatten < Flatten < T > > > > | Flatten < Flatten < Flatten < T > > > | Flatten < Flatten < T > > | Flatten < T > | T ) [ ] ;
11330}
11431
11532interface Array < T > {
@@ -124,80 +41,21 @@ interface Array<T> {
12441 * @param thisArg An object to which the this keyword can refer in the callback function. If
12542 * thisArg is omitted, undefined is used as the this value.
12643 */
127- flatMap < U , This = undefined > (
128- callback : ( this : This , value : T , index : number , array : T [ ] ) => U | ReadonlyArray < U > ,
129- thisArg ?: This
130- ) : U [ ]
44+ flatMap < U > (
45+ callbackfn : ( value : T , index : number , array : T [ ] ) => U ,
46+ thisArg ?: any
47+ ) : Flatten < U > [ ] ;
13148
13249 /**
13350 * Returns a new array with all sub-array elements concatenated into it recursively up to the
13451 * specified depth.
13552 *
13653 * @param depth The maximum recursion depth
13754 */
138- flat < U > ( this : U [ ] [ ] [ ] [ ] [ ] [ ] [ ] [ ] , depth : 7 ) : U [ ] ;
139-
140- /**
141- * Returns a new array with all sub-array elements concatenated into it recursively up to the
142- * specified depth.
143- *
144- * @param depth The maximum recursion depth
145- */
146- flat < U > ( this : U [ ] [ ] [ ] [ ] [ ] [ ] [ ] , depth : 6 ) : U [ ] ;
147-
148- /**
149- * Returns a new array with all sub-array elements concatenated into it recursively up to the
150- * specified depth.
151- *
152- * @param depth The maximum recursion depth
153- */
154- flat < U > ( this : U [ ] [ ] [ ] [ ] [ ] [ ] , depth : 5 ) : U [ ] ;
155-
156- /**
157- * Returns a new array with all sub-array elements concatenated into it recursively up to the
158- * specified depth.
159- *
160- * @param depth The maximum recursion depth
161- */
162- flat < U > ( this : U [ ] [ ] [ ] [ ] [ ] , depth : 4 ) : U [ ] ;
163-
164- /**
165- * Returns a new array with all sub-array elements concatenated into it recursively up to the
166- * specified depth.
167- *
168- * @param depth The maximum recursion depth
169- */
170- flat < U > ( this : U [ ] [ ] [ ] [ ] , depth : 3 ) : U [ ] ;
171-
172- /**
173- * Returns a new array with all sub-array elements concatenated into it recursively up to the
174- * specified depth.
175- *
176- * @param depth The maximum recursion depth
177- */
178- flat < U > ( this : U [ ] [ ] [ ] , depth : 2 ) : U [ ] ;
179-
180- /**
181- * Returns a new array with all sub-array elements concatenated into it recursively up to the
182- * specified depth.
183- *
184- * @param depth The maximum recursion depth
185- */
186- flat < U > ( this : U [ ] [ ] , depth ?: 1 ) : U [ ] ;
187-
188- /**
189- * Returns a new array with all sub-array elements concatenated into it recursively up to the
190- * specified depth.
191- *
192- * @param depth The maximum recursion depth
193- */
194- flat < U > ( this : U [ ] , depth : 0 ) : U [ ] ;
195-
196- /**
197- * Returns a new array with all sub-array elements concatenated into it recursively up to the
198- * specified depth. If no depth is provided, flat method defaults to the depth of 1.
199- *
200- * @param depth The maximum recursion depth
201- */
202- flat < U > ( depth ?: number ) : any [ ] ;
55+ flat ( depth : 4 ) : Flatten < Flatten < Flatten < Flatten < T > > > > [ ] ;
56+ flat ( depth : 3 ) : Flatten < Flatten < Flatten < T > > > [ ] ;
57+ flat ( depth : 2 ) : Flatten < Flatten < T > > [ ] ;
58+ flat ( depth ?: 1 ) : Flatten < T > [ ] ;
59+ flat ( depth : 0 ) : T [ ] ;
60+ flat ( depth : number ) : ( Flatten < Flatten < Flatten < Flatten < T > > > > extends readonly any [ ] ? unknown : Flatten < Flatten < Flatten < Flatten < T > > > > | Flatten < Flatten < Flatten < T > > > | Flatten < Flatten < T > > | Flatten < T > | T ) [ ] ;
20361}
0 commit comments