@@ -10,7 +10,8 @@ import { PublicArrayFilter } from '@writetome51/public-array-filter';
10
10
11
11
12
12
/**************
13
- This class is called PublicArray because an array is contained inside it, in a public property.
13
+ This class is called PublicArray because an array is contained inside it,
14
+ in a public property: 'data'
14
15
15
16
The main reason you would use this class is if you hate JavaScript's built-in Array
16
17
methods, like .slice(), .splice(), .push(), and .shift(). This class has much clearer
@@ -21,9 +22,9 @@ import { PublicArrayFilter } from '@writetome51/public-array-filter';
21
22
let arr = getPublicArray( [1,2,3,4,5,6] );
22
23
arr.remove.tail(2); // arr.data is now [1,2,3,4]
23
24
if (arr.notEmpty) arr.prepend([10]); // arr.data is now [10,1,2,3,4]
24
-
25
- To access the array itself, you access the 'data' property.
26
25
*************/
26
+
27
+
27
28
export declare class PublicArray extends PublicArrayContent {
28
29
29
30
private _filter ;
@@ -36,7 +37,23 @@ export declare class PublicArray extends PublicArrayContent {
36
37
private _sort ;
37
38
38
39
40
+ /***************
41
+ Public Properties:
42
+
43
+ readonly copy: PublicArray; // independent copy of this instance.
44
+ readonly filter: PublicArrayFilter;
45
+ readonly getConverted: PublicArrayGetterConverter;
46
+ readonly get: PublicArrayGetter;
47
+ readonly getAndRemove: PublicArrayGetterRemover;
48
+ readonly insert: PublicArrayInserter;
49
+ readonly remove: PublicArrayRemover;
50
+ readonly replace: PublicArrayReplacer;
51
+ readonly sort: PublicArraySorter;
52
+ ***************/
53
+
54
+
39
55
constructor (
56
+ // begin injected dependencies...
40
57
_filter : PublicArrayFilter ,
41
58
_getConverted : PublicArrayGetterConverter ,
42
59
_get : PublicArrayGetter ,
@@ -45,29 +62,21 @@ export declare class PublicArray extends PublicArrayContent {
45
62
_remove : PublicArrayRemover ,
46
63
_replace : PublicArrayReplacer ,
47
64
_sort : PublicArraySorter ,
65
+ // ... end injected dependencies
48
66
49
- // The actual array:
67
+ // the actual array:
50
68
data ?: any [ ]
51
69
) ;
52
70
53
71
54
- readonly filter : PublicArrayFilter ;
55
- readonly getConverted : PublicArrayGetterConverter ;
56
- readonly get : PublicArrayGetter ;
57
- readonly getAndRemove : PublicArrayGetterRemover ;
58
- readonly insert : PublicArrayInserter ;
59
- readonly remove : PublicArrayRemover ;
60
- readonly replace : PublicArrayReplacer ;
61
- readonly sort : PublicArraySorter ;
62
72
readonly copy : PublicArray ;
63
73
64
74
65
-
66
75
append ( values : any [ ] ) : this;
67
76
68
77
69
78
prepend ( values : any [ ] ) : this;
70
79
71
80
72
- forEach ( iterationFunction : Function ) : this;
81
+ forEach ( iterationFunction : any ) : this;
73
82
}
0 commit comments