-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultiArray.d.ts
More file actions
97 lines (84 loc) · 2.26 KB
/
Copy pathMultiArray.d.ts
File metadata and controls
97 lines (84 loc) · 2.26 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
type ArrayAny<T> = Array<T> | MultiArray<T>
export default class MultiArray<T> {
constructor (...args: ArrayAny<T>[])
/**
* Get element from MultiArray.
*
* @param index - Index of element from MultiArray.
*
* @throws TypeError
* Thrown when argument is not integer.
*
* @returns Returns element that was on index. If not exist, returns nothing.
*/
get (index: number): T
/**
* Add new body to MultiArray.
*
* @param args - One or more of Array or MultiArray to added on body.
*
* @throws TypeError
* Thrown when argument is not Array or MultiArray.
*
* @returns New length of body.
*/
append (...args: ArrayAny<T>[]): number
/**
* Remove body from MultiArray.
*
* @param index - Index of body from MultiArray.
*
* @throws TypeError
* Thrown when argument is not integer.
*
* @throws RangeError
* Thrown when index is out of range.
*
* @returns New length of body.
*/
remove (index: number): number
/**
* Length of MultiArray, or sum of length from body.
*/
length: number
/**
* Length of MultiArray body, or count of referenced arrays.
*/
bodyLength: number
/**
* Found object from MultiArray and returns its index.
*
* @param obj - Object to find.
*
* @returns Index of object in MultiArray. If not exist, returns -1.
*/
indexOf (obj: T): number
/**
* Found object from MultiArray by filter and returns its index.
*
* @param func - Filter to use.
*
* @returns Index of object in MultiArray. If not exist, returns -1.
*/
find (func: Function): number
/**
* Concat two MultiArray to get new MultiArray.
*
* @param other - MultiArray to concat.
*
* @throws TypeError
* Thrown when argument is not MultiArray.
*
* @returns New MultiArray with combined body.
*/
concat (other: MultiArray<T>): MultiArray<T>
toString (): string
/**
* Check the argument is MultiArray or not.
*
* @param arr - Object to check.
*/
static isMultiArray (arr:any): boolean
[Symbol.iterator](): Generator<T>;
[K: number]: T;
}