collect-your-stuff 2.1.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -3926
- package/browser/collect-your-stuff.js +912 -549
- package/browser/collect-your-stuff.min.js +1 -1
- package/dist/collections/arrayable/ArrayElement.d.ts +6 -11
- package/dist/collections/arrayable/ArrayElement.js +5 -7
- package/dist/collections/arrayable/Arrayable.d.ts +22 -37
- package/dist/collections/arrayable/Arrayable.js +208 -223
- package/dist/collections/doubly-linked-list/DoubleLinker.d.ts +9 -14
- package/dist/collections/doubly-linked-list/DoubleLinker.js +71 -73
- package/dist/collections/doubly-linked-list/DoublyLinkedList.d.ts +19 -36
- package/dist/collections/doubly-linked-list/DoublyLinkedList.js +310 -327
- package/dist/collections/linked-list/LinkedList.d.ts +20 -36
- package/dist/collections/linked-list/LinkedList.js +283 -296
- package/dist/collections/linked-list/Linker.d.ts +8 -13
- package/dist/collections/linked-list/Linker.js +82 -84
- package/dist/collections/linked-tree-list/LinkedTreeList.d.ts +24 -43
- package/dist/collections/linked-tree-list/LinkedTreeList.js +274 -294
- package/dist/collections/linked-tree-list/TreeLinker.d.ts +14 -20
- package/dist/collections/linked-tree-list/TreeLinker.js +91 -94
- package/dist/collections/queue/Queue.d.ts +10 -14
- package/dist/collections/queue/Queue.js +114 -121
- package/dist/collections/queue/Queueable.d.ts +13 -22
- package/dist/collections/queue/Queueable.js +142 -148
- package/dist/collections/queue/TaskQueue.d.ts +8 -17
- package/dist/collections/queue/TaskQueue.js +128 -137
- package/dist/collections/scoped-collection/ScopedCollection.d.ts +42 -0
- package/dist/collections/scoped-collection/ScopedCollection.js +81 -0
- package/dist/collections/scoped-collection/ScopedCollection.min.js +1 -0
- package/dist/collections/stack/Stack.d.ts +11 -15
- package/dist/collections/stack/Stack.js +122 -129
- package/dist/collections/stack/Stackable.d.ts +9 -16
- package/dist/collections/stack/Stackable.js +81 -85
- package/dist/collections/stack/TaskStack.d.ts +8 -17
- package/dist/collections/stack/TaskStack.js +98 -107
- package/dist/main.d.ts +67 -68
- package/dist/main.js +8 -4
- package/dist/main.min.js +1 -1
- package/dist/recipes/ArrayIterator.d.ts +4 -4
- package/dist/recipes/ArrayIterator.js +4 -4
- package/dist/recipes/DoubleLinkerIterator.d.ts +3 -3
- package/dist/recipes/DoubleLinkerIterator.js +3 -3
- package/dist/recipes/IsArrayable.d.ts +13 -33
- package/dist/recipes/IsQueue.d.ts +4 -9
- package/dist/recipes/IsScopedCollection.d.ts +27 -0
- package/dist/recipes/IsScopedCollection.js +5 -0
- package/dist/recipes/IsScopedCollection.min.js +1 -0
- package/dist/recipes/IsStack.d.ts +4 -9
- package/dist/recipes/IsTreeNode.d.ts +1 -1
- package/dist/recipes/LinkerIterator.d.ts +3 -3
- package/dist/recipes/LinkerIterator.js +3 -3
- package/dist/recipes/Runnable.d.ts +3 -16
- package/dist/recipes/Runnable.js +3 -9
- package/dist/recipes/TreeLinkerIterator.d.ts +4 -4
- package/dist/recipes/TreeLinkerIterator.js +36 -36
- package/dist/recipes/recipes.d.ts +1 -4
- package/dist/recipes/recipes.js +19 -22
- package/dist/services/parseTree.d.ts +2 -3
- package/dist/services/parseTree.js +23 -24
- package/dist/services/parseTreeNext.d.ts +2 -3
- package/dist/services/parseTreeNext.js +2 -3
- package/dist/services/services.d.ts +1 -4
- package/dist/services/services.js +19 -22
- package/package.json +4 -4
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* @author Joshua Heagle <joshuaheagle@gmail.com>
|
|
4
|
-
* @version 1.1.0
|
|
5
|
-
* @memberOf module:collect-your-stuff
|
|
2
|
+
* linked list.
|
|
6
3
|
*/
|
|
7
4
|
import { forEachCallback, IsArrayable } from '../../recipes/IsArrayable';
|
|
8
5
|
import { IsLinker } from '../../recipes/IsLinker';
|
|
@@ -26,101 +23,88 @@ export declare class LinkedList implements IsArrayable<Linker>, Iterable<Linker>
|
|
|
26
23
|
private countCache;
|
|
27
24
|
/**
|
|
28
25
|
* Create the new LinkedList instance.
|
|
29
|
-
* @param
|
|
26
|
+
* @param linkerClass The class used to wrap given data as linkers.
|
|
30
27
|
*/
|
|
31
28
|
constructor(linkerClass?: typeof Linker);
|
|
32
29
|
/**
|
|
33
30
|
* Initialize the inner list, should only run once.
|
|
34
|
-
* @param
|
|
35
|
-
* @return {LinkedList}
|
|
31
|
+
* @param initialList Give the list of linkers to start in this linked-list.
|
|
36
32
|
*/
|
|
37
33
|
initialize(initialList: Linker): LinkedList;
|
|
38
34
|
/**
|
|
39
35
|
* Retrieve the innerList used (the list itself, not a copy).
|
|
40
|
-
* @returns {Linker}
|
|
41
36
|
*/
|
|
42
37
|
get list(): IsLinker;
|
|
43
38
|
/**
|
|
44
39
|
* Retrieve the first Linker in the list.
|
|
45
|
-
* @returns {Linker}
|
|
46
40
|
*/
|
|
47
41
|
get first(): Linker;
|
|
48
42
|
/**
|
|
49
43
|
* Retrieve the last Linker in the list. The end is remembered, so this does not walk the list.
|
|
50
|
-
* @returns {Linker}
|
|
51
44
|
*/
|
|
52
45
|
get last(): Linker | null;
|
|
53
46
|
/**
|
|
54
47
|
* Return the length of the list. It is kept up to date by the list's own methods, so this does not walk the list
|
|
55
48
|
* (call reset() after linkers were changed directly).
|
|
56
|
-
* @returns {number}
|
|
57
49
|
*/
|
|
58
50
|
get length(): number;
|
|
59
51
|
/**
|
|
60
52
|
* Insert a new node (or data) after a node.
|
|
61
|
-
* @param
|
|
62
|
-
* @param
|
|
63
|
-
* @returns {LinkedList}
|
|
53
|
+
* @param node The existing node as reference, or null to insert at the start of the list
|
|
54
|
+
* @param newNode The new node to go after the existing node
|
|
64
55
|
*/
|
|
65
56
|
insertAfter(node: IsLinker | null, newNode: Linker | any): LinkedList;
|
|
66
57
|
/**
|
|
67
58
|
* Insert a new node (or data) before a node.
|
|
68
|
-
* @param
|
|
69
|
-
* @param
|
|
70
|
-
* @returns {LinkedList}
|
|
59
|
+
* @param node The existing node as reference, or null to insert at the end of the list
|
|
60
|
+
* @param newNode The new node to go before the existing node
|
|
71
61
|
* @throws {Error} When the reference node is not in this list
|
|
72
62
|
*/
|
|
73
63
|
insertBefore(node: IsLinker | null, newNode: Linker | any): LinkedList;
|
|
74
64
|
/**
|
|
75
65
|
* Add a node (or data) after the given (or last) node in the list.
|
|
76
|
-
* @param
|
|
77
|
-
* @param
|
|
78
|
-
* @returns {Linker}
|
|
66
|
+
* @param node The new node to add to the end of the list
|
|
67
|
+
* @param after The existing last node
|
|
79
68
|
*/
|
|
80
69
|
append(node: Linker | any, after?: IsLinker): LinkedList;
|
|
81
70
|
/**
|
|
82
71
|
* Add a node (or data) before the given (or first) node in the list.
|
|
83
|
-
* @param
|
|
84
|
-
* @param
|
|
85
|
-
* @returns {Linker}
|
|
72
|
+
* @param node The new node to add to the start of the list
|
|
73
|
+
* @param before The existing first node
|
|
86
74
|
*/
|
|
87
75
|
prepend(node: Linker | any, before?: IsLinker): LinkedList;
|
|
88
76
|
/**
|
|
89
77
|
* Remove a linker from this linked list.
|
|
90
|
-
* @param
|
|
91
|
-
* @
|
|
78
|
+
* @param node The node we wish to remove (and it will be returned after removal)
|
|
79
|
+
* @returns The removed node, or null when it was not in this list (nothing is removed)
|
|
92
80
|
*/
|
|
93
81
|
remove(node: Linker | null): Linker | null;
|
|
94
82
|
/**
|
|
95
83
|
* Refresh the remembered end and length of the list by walking it once. The list's own methods keep these up to date,
|
|
96
84
|
* so this is only needed after linkers were changed directly (for example by setting next on a linker).
|
|
97
|
-
* @
|
|
85
|
+
* @returns The first linker of the list
|
|
98
86
|
*/
|
|
99
87
|
reset(): Linker | null;
|
|
100
88
|
/**
|
|
101
89
|
* Retrieve a Linker item from this list by numeric index, otherwise return null.
|
|
102
|
-
* @param
|
|
103
|
-
* @returns {Linker|null}
|
|
90
|
+
* @param index The integer number for retrieving a node by position.
|
|
104
91
|
*/
|
|
105
92
|
item(index: number): Linker | null;
|
|
106
93
|
/**
|
|
107
94
|
* Be able to run forEach on this LinkedList to iterate over the linkers.
|
|
108
|
-
* @param
|
|
109
|
-
* @param
|
|
110
|
-
* @returns {LinkedList}
|
|
95
|
+
* @param callback The function to call for-each linker
|
|
96
|
+
* @param thisArg Optional, 'this' reference
|
|
111
97
|
*/
|
|
112
98
|
forEach(callback: forEachCallback, thisArg?: LinkedList): LinkedList;
|
|
113
99
|
/**
|
|
114
100
|
* Be able to iterate over this class.
|
|
115
|
-
* @returns {Iterator}
|
|
116
101
|
*/
|
|
117
102
|
[Symbol.iterator](): Iterator<Linker>;
|
|
118
103
|
/**
|
|
119
104
|
* Convert an array to a LinkedList.
|
|
120
|
-
* @param
|
|
121
|
-
* @param
|
|
122
|
-
* @param
|
|
123
|
-
* @returns {LinkedList}
|
|
105
|
+
* @param values An array of values which will be converted to linkers in this linked-list
|
|
106
|
+
* @param linkerClass The class to use for each linker
|
|
107
|
+
* @param classType Provide the type of IsArrayable to use.
|
|
124
108
|
*/
|
|
125
109
|
static fromArray: (values?: Array<any>, linkerClass?: typeof Linker, classType?: any) => IsArrayable<IsLinker> | any;
|
|
126
110
|
}
|