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.
Files changed (63) hide show
  1. package/README.md +32 -3926
  2. package/browser/collect-your-stuff.js +912 -549
  3. package/browser/collect-your-stuff.min.js +1 -1
  4. package/dist/collections/arrayable/ArrayElement.d.ts +6 -11
  5. package/dist/collections/arrayable/ArrayElement.js +5 -7
  6. package/dist/collections/arrayable/Arrayable.d.ts +22 -37
  7. package/dist/collections/arrayable/Arrayable.js +208 -223
  8. package/dist/collections/doubly-linked-list/DoubleLinker.d.ts +9 -14
  9. package/dist/collections/doubly-linked-list/DoubleLinker.js +71 -73
  10. package/dist/collections/doubly-linked-list/DoublyLinkedList.d.ts +19 -36
  11. package/dist/collections/doubly-linked-list/DoublyLinkedList.js +310 -327
  12. package/dist/collections/linked-list/LinkedList.d.ts +20 -36
  13. package/dist/collections/linked-list/LinkedList.js +283 -296
  14. package/dist/collections/linked-list/Linker.d.ts +8 -13
  15. package/dist/collections/linked-list/Linker.js +82 -84
  16. package/dist/collections/linked-tree-list/LinkedTreeList.d.ts +24 -43
  17. package/dist/collections/linked-tree-list/LinkedTreeList.js +274 -294
  18. package/dist/collections/linked-tree-list/TreeLinker.d.ts +14 -20
  19. package/dist/collections/linked-tree-list/TreeLinker.js +91 -94
  20. package/dist/collections/queue/Queue.d.ts +10 -14
  21. package/dist/collections/queue/Queue.js +114 -121
  22. package/dist/collections/queue/Queueable.d.ts +13 -22
  23. package/dist/collections/queue/Queueable.js +142 -148
  24. package/dist/collections/queue/TaskQueue.d.ts +8 -17
  25. package/dist/collections/queue/TaskQueue.js +128 -137
  26. package/dist/collections/scoped-collection/ScopedCollection.d.ts +42 -0
  27. package/dist/collections/scoped-collection/ScopedCollection.js +81 -0
  28. package/dist/collections/scoped-collection/ScopedCollection.min.js +1 -0
  29. package/dist/collections/stack/Stack.d.ts +11 -15
  30. package/dist/collections/stack/Stack.js +122 -129
  31. package/dist/collections/stack/Stackable.d.ts +9 -16
  32. package/dist/collections/stack/Stackable.js +81 -85
  33. package/dist/collections/stack/TaskStack.d.ts +8 -17
  34. package/dist/collections/stack/TaskStack.js +98 -107
  35. package/dist/main.d.ts +67 -68
  36. package/dist/main.js +8 -4
  37. package/dist/main.min.js +1 -1
  38. package/dist/recipes/ArrayIterator.d.ts +4 -4
  39. package/dist/recipes/ArrayIterator.js +4 -4
  40. package/dist/recipes/DoubleLinkerIterator.d.ts +3 -3
  41. package/dist/recipes/DoubleLinkerIterator.js +3 -3
  42. package/dist/recipes/IsArrayable.d.ts +13 -33
  43. package/dist/recipes/IsQueue.d.ts +4 -9
  44. package/dist/recipes/IsScopedCollection.d.ts +27 -0
  45. package/dist/recipes/IsScopedCollection.js +5 -0
  46. package/dist/recipes/IsScopedCollection.min.js +1 -0
  47. package/dist/recipes/IsStack.d.ts +4 -9
  48. package/dist/recipes/IsTreeNode.d.ts +1 -1
  49. package/dist/recipes/LinkerIterator.d.ts +3 -3
  50. package/dist/recipes/LinkerIterator.js +3 -3
  51. package/dist/recipes/Runnable.d.ts +3 -16
  52. package/dist/recipes/Runnable.js +3 -9
  53. package/dist/recipes/TreeLinkerIterator.d.ts +4 -4
  54. package/dist/recipes/TreeLinkerIterator.js +36 -36
  55. package/dist/recipes/recipes.d.ts +1 -4
  56. package/dist/recipes/recipes.js +19 -22
  57. package/dist/services/parseTree.d.ts +2 -3
  58. package/dist/services/parseTree.js +23 -24
  59. package/dist/services/parseTreeNext.d.ts +2 -3
  60. package/dist/services/parseTreeNext.js +2 -3
  61. package/dist/services/services.d.ts +1 -4
  62. package/dist/services/services.js +19 -22
  63. package/package.json +4 -4
@@ -1,94 +1,91 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.TreeLinker = void 0
7
- require('core-js/modules/esnext.iterator.constructor.js')
8
- require('core-js/modules/esnext.iterator.map.js')
9
- const _DoubleLinker = require('../doubly-linked-list/DoubleLinker')
10
- const _LinkedTreeList = require('./LinkedTreeList')
11
- /**
12
- * TreeLinker represents a node in a LinkedTreeList having a parent (or root) and child nodes.
13
- * @extends DoubleLinker
14
- */
15
- class TreeLinker {
16
- /**
17
- * Create the new TreeLinker instance, provide the data and optionally set references for next, prev, parent, or children.
18
- * @param {Object} [settings={}] The settings for the new tree node.
19
- * @param {*} [settings.data=null] The data to be stored in this tree node
20
- * @param {TreeLinker} [settings.next=null] The reference to the next linker if any
21
- * @param {TreeLinker} [settings.prev=null] The reference to the previous linker if any
22
- * @param {LinkedTreeList} [settings.children=null] The references to child linkers if any
23
- * @param {TreeLinker} [settings.parent=null] The reference to a parent linker if any
24
- * @param {IsArrayable<IsTreeNode>} listClass Give the type of list to use for storing the children
25
- */
26
- constructor ({
27
- data = null,
28
- next = null,
29
- prev = null,
30
- children = null,
31
- parent = null,
32
- listClass = _LinkedTreeList.LinkedTreeList
33
- } = {}) {
34
- /** The class used to create this instance, so that it can be recognized as valid without an instanceof check. */
35
- this.classType = TreeLinker
36
- /** The data stored in this tree node. */
37
- this.data = null
38
- /** The sibling after this node, or null when this is the last child. */
39
- this.next = null
40
- /** The sibling before this node, or null when this is the first child. */
41
- this.prev = null
42
- /** The node this node is a child of, or null for a root node. */
43
- this.parent = null
44
- /** The list of the children of this node, or null when it has none. */
45
- this.children = null
46
- this.data = data
47
- this.next = next
48
- this.prev = prev
49
- this.parent = parent
50
- this.children = this.childrenFromArray(children, listClass)
51
- }
52
-
53
- /**
54
- * Create the children for this tree from an array. Each child becomes a tree linker with this node as its parent: an
55
- * existing linker is kept as it is, an object with a data property gives the settings of the linker, and anything
56
- * else is the data of the linker.
57
- * @param {Array|null} children Provide an array of data / linker references to be children of this tree node.
58
- * @param {IsArrayable<IsTreeNode>} listClass Give the type of list to use for storing the children
59
- * @return {LinkedTreeList|null}
60
- */
61
- childrenFromArray (children = null, listClass = _LinkedTreeList.LinkedTreeList) {
62
- if (children === null) {
63
- return null
64
- }
65
- // Every child is made into a tree linker (an existing one is kept as it is, and a plain value is the data) and is
66
- // given this node as its parent
67
- const nodes = children.map(child => {
68
- const linker = this.classType.make(child, this.classType)
69
- linker.parent = this
70
- return linker
71
- })
72
- // Creates a linked-tree-list to store the children, which remembers this node as its parent even when it is empty
73
- const list = listClass.fromArray(nodes, this.classType)
74
- list.parent = this
75
- return list
76
- }
77
- }
78
- /**
79
- * Make a new DoubleLinker from the data given if it is not already a valid Linker.
80
- * @param {TreeLinker|*} linker Return a valid TreeLinker instance from given data, or even an already valid one.
81
- * @param {IsTreeNode} [classType=TreeLinker] Provide the type of IsTreeNode to use.
82
- * @return {TreeLinker}
83
- */
84
- exports.TreeLinker = TreeLinker
85
- TreeLinker.make = (linker, classType = TreeLinker) => {
86
- return _DoubleLinker.DoubleLinker.make(linker, classType)
87
- }
88
- /**
89
- * Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
90
- * @param {Array} [values=[]] Provide an array of data that will be converted to a chain of tree-linkers.
91
- * @param {IsTreeNode} [classType=TreeLinker] Provide the type of IsTreeNode to use.
92
- * @returns {{head: TreeLinker, tail: TreeLinker}}
93
- */
94
- TreeLinker.fromArray = (values = [], classType = TreeLinker) => _DoubleLinker.DoubleLinker.fromArray(values, classType)
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.TreeLinker = void 0
7
+ require('core-js/modules/esnext.iterator.constructor.js')
8
+ require('core-js/modules/esnext.iterator.map.js')
9
+ const _DoubleLinker = require('../doubly-linked-list/DoubleLinker')
10
+ const _LinkedTreeList = require('./LinkedTreeList')
11
+ /**
12
+ * TreeLinker represents a node in a LinkedTreeList having a parent (or root) and child nodes.
13
+ * @extends DoubleLinker
14
+ */
15
+ class TreeLinker {
16
+ /**
17
+ * Create the new TreeLinker instance, provide the data and optionally set references for next, prev, parent, or children.
18
+ * @param settings The settings for the new tree node.
19
+ * @param settings.data The data to be stored in this tree node
20
+ * @param settings.next The reference to the next linker if any
21
+ * @param settings.prev The reference to the previous linker if any
22
+ * @param settings.children The references to child linkers if any
23
+ * @param settings.parent The reference to a parent linker if any
24
+ * @param listClass Give the type of list to use for storing the children
25
+ */
26
+ constructor ({
27
+ data = null,
28
+ next = null,
29
+ prev = null,
30
+ children = null,
31
+ parent = null,
32
+ listClass = _LinkedTreeList.LinkedTreeList
33
+ } = {}) {
34
+ /** The class used to create this instance, so that it can be recognized as valid without an instanceof check. */
35
+ this.classType = TreeLinker
36
+ /** The data stored in this tree node. */
37
+ this.data = null
38
+ /** The sibling after this node, or null when this is the last child. */
39
+ this.next = null
40
+ /** The sibling before this node, or null when this is the first child. */
41
+ this.prev = null
42
+ /** The node this node is a child of, or null for a root node. */
43
+ this.parent = null
44
+ /** The list of the children of this node, or null when it has none. */
45
+ this.children = null
46
+ this.data = data
47
+ this.next = next
48
+ this.prev = prev
49
+ this.parent = parent
50
+ this.children = this.childrenFromArray(children, listClass)
51
+ }
52
+
53
+ /**
54
+ * Create the children for this tree from an array. Each child becomes a tree linker with this node as its parent: an
55
+ * existing linker is kept as it is, an object with a data property gives the settings of the linker, and anything
56
+ * else is the data of the linker.
57
+ * @param children Provide an array of data / linker references to be children of this tree node.
58
+ * @param listClass Give the type of list to use for storing the children
59
+ */
60
+ childrenFromArray (children = null, listClass = _LinkedTreeList.LinkedTreeList) {
61
+ if (children === null) {
62
+ return null
63
+ }
64
+ // Every child is made into a tree linker (an existing one is kept as it is, and a plain value is the data) and is
65
+ // given this node as its parent
66
+ const nodes = children.map(child => {
67
+ const linker = this.classType.make(child, this.classType)
68
+ linker.parent = this
69
+ return linker
70
+ })
71
+ // Creates a linked-tree-list to store the children, which remembers this node as its parent even when it is empty
72
+ const list = listClass.fromArray(nodes, this.classType)
73
+ list.parent = this
74
+ return list
75
+ }
76
+ }
77
+ /**
78
+ * Make a new DoubleLinker from the data given if it is not already a valid Linker.
79
+ * @param linker Return a valid TreeLinker instance from given data, or even an already valid one.
80
+ * @param classType Provide the type of IsTreeNode to use.
81
+ */
82
+ exports.TreeLinker = TreeLinker
83
+ TreeLinker.make = (linker, classType = TreeLinker) => {
84
+ return _DoubleLinker.DoubleLinker.make(linker, classType)
85
+ }
86
+ /**
87
+ * Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
88
+ * @param values Provide an array of data that will be converted to a chain of tree-linkers.
89
+ * @param classType Provide the type of IsTreeNode to use.
90
+ */
91
+ TreeLinker.fromArray = (values = [], classType = TreeLinker) => _DoubleLinker.DoubleLinker.fromArray(values, classType)
@@ -12,48 +12,44 @@ export declare class Queue<T = any> implements IsQueue<T>, Iterable<T> {
12
12
  private readonly linkerClass;
13
13
  /**
14
14
  * Instantiate the queue, optionally with a list of items to start from.
15
- * @param {IsArrayable|null} [queuedList=null] The list of linkers to start in this queue (the first is the front)
16
- * @param {IsArrayable} [listClass=LinkedList] The type of list to create when no queued list is given
17
- * @param {Linker} [linkerClass=Linker] The class used to hold each queued item
15
+ * @param queuedList The list of linkers to start in this queue (the first is the front)
16
+ * @param listClass The type of list to create when no queued list is given
17
+ * @param linkerClass The class used to hold each queued item
18
18
  */
19
19
  constructor(queuedList?: IsArrayable<any> | null, listClass?: any, linkerClass?: typeof Linker);
20
20
  /**
21
21
  * Take the item from the front of the queue.
22
- * @return {*|null} The item, or null when the queue is empty
22
+ * @returns The item, or null when the queue is empty
23
23
  */
24
24
  dequeue(): T | null;
25
25
  /**
26
26
  * Check whether the queue has no items.
27
- * @return {boolean}
28
27
  */
29
28
  empty(): boolean;
30
29
  /**
31
30
  * Add an item to the back of the queue.
32
- * @param {*} data The item to add
33
- * @return {Queue} This queue, so that adding can be chained
31
+ * @param data The item to add
32
+ * @returns This queue, so that adding can be chained
34
33
  */
35
34
  enqueue(data: T): this;
36
35
  /**
37
36
  * Look at the item at the front of the queue, without removing it.
38
- * @return {*|null} The item, or null when the queue is empty
37
+ * @returns The item, or null when the queue is empty
39
38
  */
40
39
  peek(): T | null;
41
40
  /**
42
41
  * Count the items in the queue.
43
- * @return {number}
44
42
  */
45
43
  size(): number;
46
44
  /**
47
45
  * Iterate over the items from the front of the queue to the back, without removing them.
48
- * @return {Iterator}
49
46
  */
50
47
  [Symbol.iterator](): Iterator<T>;
51
48
  /**
52
49
  * Convert an array to a Queue, the first value is at the front.
53
- * @param {Array} [values=[]] The items to queue
54
- * @param {IsArrayable} [listClass=LinkedList] The type of list used to store the items
55
- * @param {Linker} [linkerClass=Linker] The class used to hold each queued item
56
- * @returns {Queue}
50
+ * @param values The items to queue
51
+ * @param listClass The type of list used to store the items
52
+ * @param linkerClass The class used to hold each queued item
57
53
  */
58
54
  static fromArray: <T_1 = any>(values?: Array<T_1>, listClass?: any, linkerClass?: typeof Linker) => Queue<T_1>;
59
55
  }
@@ -1,121 +1,114 @@
1
- 'use strict'
2
-
3
- Object.defineProperty(exports, '__esModule', {
4
- value: true
5
- })
6
- exports.Queue = void 0
7
- require('core-js/modules/esnext.iterator.constructor.js')
8
- require('core-js/modules/esnext.iterator.for-each.js')
9
- const _LinkedList = require('../linked-list/LinkedList')
10
- const _Linker = require('../linked-list/Linker')
11
- /**
12
- * @file queue
13
- * @author Joshua Heagle <joshuaheagle@gmail.com>
14
- * @version 2.0.0
15
- * @memberOf module:collect-your-stuff
16
- */
17
-
18
- /**
19
- * A first-in-first-out collection: items are added to the back with enqueue and taken from the front with dequeue.
20
- * Any value can be queued (it is stored as it is, whether it is a function, an object or null), and adding and taking
21
- * are constant time. To queue tasks which are run as they are taken use TaskQueue.
22
- */
23
- class Queue {
24
- /**
25
- * Instantiate the queue, optionally with a list of items to start from.
26
- * @param {IsArrayable|null} [queuedList=null] The list of linkers to start in this queue (the first is the front)
27
- * @param {IsArrayable} [listClass=LinkedList] The type of list to create when no queued list is given
28
- * @param {Linker} [linkerClass=Linker] The class used to hold each queued item
29
- */
30
- constructor (queuedList = null, listClass = _LinkedList.LinkedList, linkerClass = _Linker.Linker) {
31
- this.linkerClass = linkerClass
32
- this.queuedList = queuedList === null ? new listClass(linkerClass) : queuedList
33
- }
34
-
35
- /**
36
- * Take the item from the front of the queue.
37
- * @return {*|null} The item, or null when the queue is empty
38
- */
39
- dequeue () {
40
- const front = this.queuedList.first
41
- if (front === null || typeof front === 'undefined') {
42
- return null
43
- }
44
- this.queuedList.remove(front)
45
- return front.data
46
- }
47
-
48
- /**
49
- * Check whether the queue has no items.
50
- * @return {boolean}
51
- */
52
- empty () {
53
- return this.size() <= 0
54
- }
55
-
56
- /**
57
- * Add an item to the back of the queue.
58
- * @param {*} data The item to add
59
- * @return {Queue} This queue, so that adding can be chained
60
- */
61
- enqueue (data) {
62
- // The item is wrapped here rather than left to the list, since the list treats objects that look like a linker's
63
- // settings (they have a data property) as such, and a queue must give back exactly what it was given
64
- this.queuedList.append(new this.linkerClass({
65
- data
66
- }))
67
- return this
68
- }
69
-
70
- /**
71
- * Look at the item at the front of the queue, without removing it.
72
- * @return {*|null} The item, or null when the queue is empty
73
- */
74
- peek () {
75
- const front = this.queuedList.first
76
- return front === null || typeof front === 'undefined' ? null : front.data
77
- }
78
-
79
- /**
80
- * Count the items in the queue.
81
- * @return {number}
82
- */
83
- size () {
84
- return this.queuedList.length
85
- }
86
-
87
- /**
88
- * Iterate over the items from the front of the queue to the back, without removing them.
89
- * @return {Iterator}
90
- */
91
- [Symbol.iterator] () {
92
- const linkers = this.queuedList[Symbol.iterator]()
93
- return {
94
- next: () => {
95
- const result = linkers.next()
96
- return result.done
97
- ? {
98
- done: true,
99
- value: undefined
100
- }
101
- : {
102
- done: false,
103
- value: result.value.data
104
- }
105
- }
106
- }
107
- }
108
- }
109
- /**
110
- * Convert an array to a Queue, the first value is at the front.
111
- * @param {Array} [values=[]] The items to queue
112
- * @param {IsArrayable} [listClass=LinkedList] The type of list used to store the items
113
- * @param {Linker} [linkerClass=Linker] The class used to hold each queued item
114
- * @returns {Queue}
115
- */
116
- exports.Queue = Queue
117
- Queue.fromArray = (values = [], listClass = _LinkedList.LinkedList, linkerClass = _Linker.Linker) => {
118
- const queue = new Queue(null, listClass, linkerClass)
119
- values.forEach(value => queue.enqueue(value))
120
- return queue
121
- }
1
+ 'use strict'
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ })
6
+ exports.Queue = void 0
7
+ require('core-js/modules/esnext.iterator.constructor.js')
8
+ require('core-js/modules/esnext.iterator.for-each.js')
9
+ const _LinkedList = require('../linked-list/LinkedList')
10
+ const _Linker = require('../linked-list/Linker')
11
+ /**
12
+ * queue
13
+ */
14
+
15
+ /**
16
+ * A first-in-first-out collection: items are added to the back with enqueue and taken from the front with dequeue.
17
+ * Any value can be queued (it is stored as it is, whether it is a function, an object or null), and adding and taking
18
+ * are constant time. To queue tasks which are run as they are taken use TaskQueue.
19
+ */
20
+ class Queue {
21
+ /**
22
+ * Instantiate the queue, optionally with a list of items to start from.
23
+ * @param queuedList The list of linkers to start in this queue (the first is the front)
24
+ * @param listClass The type of list to create when no queued list is given
25
+ * @param linkerClass The class used to hold each queued item
26
+ */
27
+ constructor (queuedList = null, listClass = _LinkedList.LinkedList, linkerClass = _Linker.Linker) {
28
+ this.linkerClass = linkerClass
29
+ this.queuedList = queuedList === null ? new listClass(linkerClass) : queuedList
30
+ }
31
+
32
+ /**
33
+ * Take the item from the front of the queue.
34
+ * @returns The item, or null when the queue is empty
35
+ */
36
+ dequeue () {
37
+ const front = this.queuedList.first
38
+ if (front === null || typeof front === 'undefined') {
39
+ return null
40
+ }
41
+ this.queuedList.remove(front)
42
+ return front.data
43
+ }
44
+
45
+ /**
46
+ * Check whether the queue has no items.
47
+ */
48
+ empty () {
49
+ return this.size() <= 0
50
+ }
51
+
52
+ /**
53
+ * Add an item to the back of the queue.
54
+ * @param data The item to add
55
+ * @returns This queue, so that adding can be chained
56
+ */
57
+ enqueue (data) {
58
+ // The item is wrapped here rather than left to the list, since the list treats objects that look like a linker's
59
+ // settings (they have a data property) as such, and a queue must give back exactly what it was given
60
+ this.queuedList.append(new this.linkerClass({
61
+ data
62
+ }))
63
+ return this
64
+ }
65
+
66
+ /**
67
+ * Look at the item at the front of the queue, without removing it.
68
+ * @returns The item, or null when the queue is empty
69
+ */
70
+ peek () {
71
+ const front = this.queuedList.first
72
+ return front === null || typeof front === 'undefined' ? null : front.data
73
+ }
74
+
75
+ /**
76
+ * Count the items in the queue.
77
+ */
78
+ size () {
79
+ return this.queuedList.length
80
+ }
81
+
82
+ /**
83
+ * Iterate over the items from the front of the queue to the back, without removing them.
84
+ */
85
+ [Symbol.iterator] () {
86
+ const linkers = this.queuedList[Symbol.iterator]()
87
+ return {
88
+ next: () => {
89
+ const result = linkers.next()
90
+ return result.done
91
+ ? {
92
+ done: true,
93
+ value: undefined
94
+ }
95
+ : {
96
+ done: false,
97
+ value: result.value.data
98
+ }
99
+ }
100
+ }
101
+ }
102
+ }
103
+ /**
104
+ * Convert an array to a Queue, the first value is at the front.
105
+ * @param values The items to queue
106
+ * @param listClass The type of list used to store the items
107
+ * @param linkerClass The class used to hold each queued item
108
+ */
109
+ exports.Queue = Queue
110
+ Queue.fromArray = (values = [], listClass = _LinkedList.LinkedList, linkerClass = _Linker.Linker) => {
111
+ const queue = new Queue(null, listClass, linkerClass)
112
+ values.forEach(value => queue.enqueue(value))
113
+ return queue
114
+ }
@@ -1,8 +1,5 @@
1
1
  /**
2
- * @file queueable item.
3
- * @author Joshua Heagle <joshuaheagle@gmail.com>
4
- * @version 1.1.0
5
- * @memberOf module:collect-your-stuff
2
+ * queueable item.
6
3
  */
7
4
  import { completeResponse, IsRunnable } from '../../recipes/Runnable';
8
5
  import { IsLinker } from '../../recipes/IsLinker';
@@ -25,10 +22,10 @@ export declare class Queueable implements IsLinker, IsRunnable {
25
22
  running: boolean;
26
23
  /**
27
24
  * Create a queueable item that can be used in a queue.
28
- * @param {Object} [queueableData={}] The settings for the new queueable.
29
- * @param {*} [queueableData.task=null] The data to be stored in this queueable
30
- * @param {Queueable|null} [queueableData.next=null] The reference to the next queueable if any
31
- * @param {boolean|Function} [queueableData.ready=false] Indicate if the queueable is ready to run
25
+ * @param queueableData The settings for the new queueable.
26
+ * @param queueableData.task The data to be stored in this queueable
27
+ * @param queueableData.next The reference to the next queueable if any
28
+ * @param queueableData.ready Indicate if the queueable is ready to run
32
29
  */
33
30
  constructor({ task, next, ready }?: {
34
31
  task?: any;
@@ -37,21 +34,18 @@ export declare class Queueable implements IsLinker, IsRunnable {
37
34
  });
38
35
  /**
39
36
  * Check ready state.
40
- * @return {boolean}
41
37
  */
42
38
  get isReady(): boolean;
43
39
  /**
44
40
  * Retrieve the data which should be formed as a task.
45
- * @return {*}
46
41
  */
47
42
  get task(): any;
48
43
  /**
49
44
  * Set this queueable as completed.
50
- * @param {Object} [completeResponse={}] The result to report for the task.
51
- * @param {*} [completeResponse.success=true] Indicate when the task failed (use false) or give a success message
52
- * @param {*} [completeResponse.error=false] Indicate a task was error-free (use false) or give an error message
53
- * @param {*} [completeResponse.context=null] Provide additional data in the response
54
- * @return {completeResponse}
45
+ * @param completeResponse The result to report for the task.
46
+ * @param completeResponse.success Indicate when the task failed (use false) or give a success message
47
+ * @param completeResponse.error Indicate a task was error-free (use false) or give an error message
48
+ * @param completeResponse.context Provide additional data in the response
55
49
  */
56
50
  markCompleted({ success, error, context }?: {
57
51
  success?: any;
@@ -60,21 +54,18 @@ export declare class Queueable implements IsLinker, IsRunnable {
60
54
  }): completeResponse;
61
55
  /**
62
56
  * Intend to run the queued task when it is ready. If ready, mark this task as running and run the task.
63
- * @return {completeResponse}
64
57
  */
65
58
  run(): completeResponse;
66
59
  /**
67
60
  * Make a new Queueable from the data given if it is not already a valid Queueable.
68
- * @param {Queueable|*} queueable Return a valid Queueable instance from given data, or even an already valid one.
69
- * @param {IsLinker} [classType=Queueable] Provide the type of IsLinker to use.
70
- * @return {Queueable}
61
+ * @param queueable Return a valid Queueable instance from given data, or even an already valid one.
62
+ * @param classType Provide the type of IsLinker to use.
71
63
  */
72
64
  static make: (queueable: Queueable | any, classType?: any) => IsLinker;
73
65
  /**
74
66
  * Convert an array into Queueable instances, return the head and tail Queueables.
75
- * @param {Array} values Provide an array of data that will be converted to a chain of queueable linkers.
76
- * @param {IsLinker} [classType=Queueable] Provide the type of IsLinker to use.
77
- * @returns {{head: Queueable, tail: Queueable}}
67
+ * @param values Provide an array of data that will be converted to a chain of queueable linkers.
68
+ * @param classType Provide the type of IsLinker to use.
78
69
  */
79
70
  static fromArray: (values?: Array<any>, classType?: any) => {
80
71
  head: IsLinker;