FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
TypeScript/src/lib/es2019.array.d.ts at main · unknownDev31/TypeScript · GitHub
unknownDev31
TypeScript
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
TypeScript
/
src
/
lib
/
es2019.array.d.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
65 lines (58 loc) · 2.33 KB
Breadcrumbs
TypeScript
/
src
/
lib
/
es2019.array.d.ts
Copy path
File metadata and controls
65 lines (58 loc) · 2.33 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
type
FlatArray
<
Arr
,
Depth
extends
number
>
=
{
"done"
:
Arr
,
"recur"
:
Arr
extends
ReadonlyArray
<
infer
InnerArr
>
?
FlatArray
<
InnerArr
,
[
-
1
,
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
]
[
Depth
]
>
:
Arr
}
[
Depth
extends
-
1
?
"done"
:
"recur"
]
;
interface
ReadonlyArray
<
T
>
{
/**
* Calls a defined callback function on each element of an array. Then, flattens the result into
* a new array.
* This is identical to a map followed by flat with depth 1.
*
*
@param
callback A function that accepts up to three arguments. The flatMap method calls the
* callback function one time for each element in the array.
*
@param
thisArg An object to which the this keyword can refer in the callback function. If
* thisArg is omitted, undefined is used as the this value.
*/
flatMap
<
U
,
This
=
undefined
>
(
callback
:
(
this
:
This
,
value
:
T
,
index
:
number
,
array
:
T
[
]
)
=>
U
|
ReadonlyArray
<
U
>
,
thisArg
?:
This
)
:
U
[
]
/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
*
@param
depth The maximum recursion depth
*/
flat
<
A
,
D
extends
number
=
1
>
(
this
:
A
,
depth
?:
D
)
:
FlatArray
<
A
,
D
>
[
]
}
interface
Array
<
T
>
{
/**
* Calls a defined callback function on each element of an array. Then, flattens the result into
* a new array.
* This is identical to a map followed by flat with depth 1.
*
*
@param
callback A function that accepts up to three arguments. The flatMap method calls the
* callback function one time for each element in the array.
*
@param
thisArg An object to which the this keyword can refer in the callback function. If
* thisArg is omitted, undefined is used as the this value.
*/
flatMap
<
U
,
This
=
undefined
>
(
callback
:
(
this
:
This
,
value
:
T
,
index
:
number
,
array
:
T
[
]
)
=>
U
|
ReadonlyArray
<
U
>
,
thisArg
?:
This
)
:
U
[
]
/**
* Returns a new array with all sub-array elements concatenated into it recursively up to the
* specified depth.
*
*
@param
depth The maximum recursion depth
*/
flat
<
A
,
D
extends
number
=
1
>
(
this
:
A
,
depth
?:
D
)
:
FlatArray
<
A
,
D
>
[
]
}
Back
|
FazBrowse Home
|
New Git URL