collect-your-stuff 1.2.6 → 1.2.8

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 (74) hide show
  1. package/README.md +2525 -2525
  2. package/browser/collect-your-stuff.js +22766 -22859
  3. package/browser/collect-your-stuff.min.js +1 -1
  4. package/dist/collections/arrayable/ArrayElement.d.ts +36 -36
  5. package/dist/collections/arrayable/ArrayElement.js +64 -70
  6. package/dist/collections/arrayable/ArrayElement.min.js +1 -1
  7. package/dist/collections/arrayable/Arrayable.d.ts +108 -108
  8. package/dist/collections/arrayable/Arrayable.js +188 -196
  9. package/dist/collections/arrayable/Arrayable.min.js +1 -1
  10. package/dist/collections/doubly-linked-list/DoubleLinker.d.ts +46 -46
  11. package/dist/collections/doubly-linked-list/DoubleLinker.js +69 -77
  12. package/dist/collections/doubly-linked-list/DoubleLinker.min.js +1 -1
  13. package/dist/collections/doubly-linked-list/DoublyLinkedList.d.ts +113 -113
  14. package/dist/collections/doubly-linked-list/DoublyLinkedList.js +274 -277
  15. package/dist/collections/doubly-linked-list/DoublyLinkedList.min.js +1 -1
  16. package/dist/collections/linked-list/LinkedList.d.ts +109 -109
  17. package/dist/collections/linked-list/LinkedList.js +233 -241
  18. package/dist/collections/linked-list/LinkedList.min.js +1 -1
  19. package/dist/collections/linked-list/Linker.d.ts +43 -43
  20. package/dist/collections/linked-list/Linker.js +80 -86
  21. package/dist/collections/linked-list/Linker.min.js +1 -1
  22. package/dist/collections/linked-tree-list/LinkedTreeList.d.ts +135 -135
  23. package/dist/collections/linked-tree-list/LinkedTreeList.js +252 -261
  24. package/dist/collections/linked-tree-list/LinkedTreeList.min.js +1 -1
  25. package/dist/collections/linked-tree-list/TreeLinker.d.ts +63 -63
  26. package/dist/collections/linked-tree-list/TreeLinker.js +79 -92
  27. package/dist/collections/linked-tree-list/TreeLinker.min.js +1 -1
  28. package/dist/collections/queue/Queue.d.ts +63 -63
  29. package/dist/collections/queue/Queue.js +130 -136
  30. package/dist/collections/queue/Queue.min.js +1 -1
  31. package/dist/collections/queue/Queueable.d.ts +77 -77
  32. package/dist/collections/queue/Queueable.js +141 -151
  33. package/dist/collections/queue/Queueable.min.js +1 -1
  34. package/dist/collections/stack/Stack.d.ts +63 -63
  35. package/dist/collections/stack/Stack.js +106 -112
  36. package/dist/collections/stack/Stack.min.js +1 -1
  37. package/dist/collections/stack/Stackable.d.ts +56 -56
  38. package/dist/collections/stack/Stackable.js +83 -91
  39. package/dist/collections/stack/Stackable.min.js +1 -1
  40. package/dist/main.d.ts +40 -40
  41. package/dist/main.js +50 -50
  42. package/dist/recipes/ArrayIterator.d.ts +10 -10
  43. package/dist/recipes/ArrayIterator.js +29 -30
  44. package/dist/recipes/ArrayIterator.min.js +1 -1
  45. package/dist/recipes/DoubleLinkerIterator.d.ts +9 -9
  46. package/dist/recipes/DoubleLinkerIterator.js +24 -24
  47. package/dist/recipes/IsArrayable.d.ts +105 -105
  48. package/dist/recipes/IsArrayable.js +5 -5
  49. package/dist/recipes/IsDoubleLinker.d.ts +14 -14
  50. package/dist/recipes/IsDoubleLinker.js +5 -5
  51. package/dist/recipes/IsElement.d.ts +14 -14
  52. package/dist/recipes/IsElement.js +5 -5
  53. package/dist/recipes/IsLinker.d.ts +10 -10
  54. package/dist/recipes/IsLinker.js +5 -5
  55. package/dist/recipes/IsTree.d.ts +11 -11
  56. package/dist/recipes/IsTree.js +5 -5
  57. package/dist/recipes/IsTreeNode.d.ts +29 -29
  58. package/dist/recipes/IsTreeNode.js +5 -5
  59. package/dist/recipes/LinkerIterator.d.ts +9 -9
  60. package/dist/recipes/LinkerIterator.js +24 -24
  61. package/dist/recipes/Runnable.d.ts +54 -54
  62. package/dist/recipes/Runnable.js +68 -69
  63. package/dist/recipes/Runnable.min.js +1 -1
  64. package/dist/recipes/TreeLinkerIterator.d.ts +9 -9
  65. package/dist/recipes/TreeLinkerIterator.js +25 -25
  66. package/dist/recipes/recipes.d.ts +15 -15
  67. package/dist/recipes/recipes.js +22 -22
  68. package/dist/services/parseTree.d.ts +9 -9
  69. package/dist/services/parseTree.js +24 -24
  70. package/dist/services/parseTreeNext.d.ts +14 -14
  71. package/dist/services/parseTreeNext.js +47 -47
  72. package/dist/services/services.d.ts +13 -13
  73. package/dist/services/services.js +22 -22
  74. package/package.json +2 -2
@@ -1,63 +1,63 @@
1
- /**
2
- * @file doubly linked tree node.
3
- * @author Joshua Heagle <joshuaheagle@gmail.com>
4
- * @version 1.1.0
5
- * @memberOf module:collect-your-stuff
6
- */
7
- import { IsArrayable } from '../../recipes/IsArrayable';
8
- import { IsTreeNode } from '../../recipes/IsTreeNode';
9
- import { IsTree } from '../../recipes/IsTree';
10
- /**
11
- * TreeLinker represents a node in a LinkedTreeList having a parent (or root) and child nodes.
12
- * @extends DoubleLinker
13
- */
14
- export declare class TreeLinker implements IsTreeNode {
15
- readonly classType: typeof TreeLinker;
16
- data: any;
17
- next: IsTreeNode | null;
18
- prev: IsTreeNode | null;
19
- parent: IsTreeNode;
20
- children: IsArrayable<IsTreeNode>;
21
- /**
22
- * Create the new TreeLinker instance, provide the data and optionally set references for next, prev, parent, or children.
23
- * @param {Object} [settings={}]
24
- * @param {*} [settings.data=null] The data to be stored in this tree node
25
- * @param {TreeLinker} [settings.next=null] The reference to the next linker if any
26
- * @param {TreeLinker} [settings.prev=null] The reference to the previous linker if any
27
- * @param {LinkedTreeList} [settings.children=null] The references to child linkers if any
28
- * @param {TreeLinker} [settings.parent=null] The reference to a parent linker if any
29
- * @param {IsArrayable<IsTreeNode>} listClass Give the type of list to use for storing the children
30
- */
31
- constructor({ data, next, prev, children, parent, listClass }?: {
32
- data?: any;
33
- next?: IsTreeNode;
34
- prev?: IsTreeNode;
35
- children?: Array<any>;
36
- parent?: IsTreeNode;
37
- listClass?: any;
38
- });
39
- /**
40
- * Create the children for this tree from an array.
41
- * @param {Array|null} children Provide an array of data / linker references to be children of this tree node.
42
- * @param {IsArrayable<IsTreeNode>} listClass Give the type of list to use for storing the children
43
- * @return {LinkedTreeList|null}
44
- */
45
- childrenFromArray(children?: Array<any> | null, listClass?: any): IsTree | any;
46
- /**
47
- * Make a new DoubleLinker from the data given if it is not already a valid Linker.
48
- * @param {TreeLinker|*} linker Return a valid TreeLinker instance from given data, or even an already valid one.
49
- * @param {IsTreeNode} [classType=TreeLinker] Provide the type of IsTreeNode to use.
50
- * @return {TreeLinker}
51
- */
52
- static make: (linker: TreeLinker | any, classType?: any) => IsTreeNode | any;
53
- /**
54
- * Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
55
- * @param {Array} [values=[]] Provide an array of data that will be converted to a chain of tree-linkers.
56
- * @param {IsTreeNode} [classType=TreeLinker] Provide the type of IsTreeNode to use.
57
- * @returns {{head: TreeLinker, tail: TreeLinker}}
58
- */
59
- static fromArray: (values?: Array<any>, classType?: any) => {
60
- head: TreeLinker | any;
61
- tail: TreeLinker | any;
62
- };
63
- }
1
+ /**
2
+ * @file doubly linked tree node.
3
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
4
+ * @version 1.1.0
5
+ * @memberOf module:collect-your-stuff
6
+ */
7
+ import { IsArrayable } from '../../recipes/IsArrayable';
8
+ import { IsTreeNode } from '../../recipes/IsTreeNode';
9
+ import { IsTree } from '../../recipes/IsTree';
10
+ /**
11
+ * TreeLinker represents a node in a LinkedTreeList having a parent (or root) and child nodes.
12
+ * @extends DoubleLinker
13
+ */
14
+ export declare class TreeLinker implements IsTreeNode {
15
+ readonly classType: typeof TreeLinker;
16
+ data: any;
17
+ next: IsTreeNode | null;
18
+ prev: IsTreeNode | null;
19
+ parent: IsTreeNode;
20
+ children: IsArrayable<IsTreeNode>;
21
+ /**
22
+ * Create the new TreeLinker instance, provide the data and optionally set references for next, prev, parent, or children.
23
+ * @param {Object} [settings={}]
24
+ * @param {*} [settings.data=null] The data to be stored in this tree node
25
+ * @param {TreeLinker} [settings.next=null] The reference to the next linker if any
26
+ * @param {TreeLinker} [settings.prev=null] The reference to the previous linker if any
27
+ * @param {LinkedTreeList} [settings.children=null] The references to child linkers if any
28
+ * @param {TreeLinker} [settings.parent=null] The reference to a parent linker if any
29
+ * @param {IsArrayable<IsTreeNode>} listClass Give the type of list to use for storing the children
30
+ */
31
+ constructor({ data, next, prev, children, parent, listClass }?: {
32
+ data?: any;
33
+ next?: IsTreeNode;
34
+ prev?: IsTreeNode;
35
+ children?: Array<any>;
36
+ parent?: IsTreeNode;
37
+ listClass?: any;
38
+ });
39
+ /**
40
+ * Create the children for this tree from an array.
41
+ * @param {Array|null} children Provide an array of data / linker references to be children of this tree node.
42
+ * @param {IsArrayable<IsTreeNode>} listClass Give the type of list to use for storing the children
43
+ * @return {LinkedTreeList|null}
44
+ */
45
+ childrenFromArray(children?: Array<any> | null, listClass?: any): IsTree | any;
46
+ /**
47
+ * Make a new DoubleLinker from the data given if it is not already a valid Linker.
48
+ * @param {TreeLinker|*} linker Return a valid TreeLinker instance from given data, or even an already valid one.
49
+ * @param {IsTreeNode} [classType=TreeLinker] Provide the type of IsTreeNode to use.
50
+ * @return {TreeLinker}
51
+ */
52
+ static make: (linker: TreeLinker | any, classType?: any) => IsTreeNode | any;
53
+ /**
54
+ * Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
55
+ * @param {Array} [values=[]] Provide an array of data that will be converted to a chain of tree-linkers.
56
+ * @param {IsTreeNode} [classType=TreeLinker] Provide the type of IsTreeNode to use.
57
+ * @returns {{head: TreeLinker, tail: TreeLinker}}
58
+ */
59
+ static fromArray: (values?: Array<any>, classType?: any) => {
60
+ head: TreeLinker | any;
61
+ tail: TreeLinker | any;
62
+ };
63
+ }
@@ -1,92 +1,79 @@
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
- var _DoubleLinker = require('../doubly-linked-list/DoubleLinker')
10
- var _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={}]
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
- const _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}
28
- const _ref$data = _ref.data
29
- const data = _ref$data === void 0 ? null : _ref$data
30
- const _ref$next = _ref.next
31
- const next = _ref$next === void 0 ? null : _ref$next
32
- const _ref$prev = _ref.prev
33
- const prev = _ref$prev === void 0 ? null : _ref$prev
34
- const _ref$children = _ref.children
35
- const children = _ref$children === void 0 ? null : _ref$children
36
- const _ref$parent = _ref.parent
37
- const parent = _ref$parent === void 0 ? null : _ref$parent
38
- const _ref$listClass = _ref.listClass
39
- const listClass = _ref$listClass === void 0 ? _LinkedTreeList.LinkedTreeList : _ref$listClass
40
- this.classType = TreeLinker
41
- this.data = null
42
- this.next = null
43
- this.prev = null
44
- this.parent = null
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.
55
- * @param {Array|null} children Provide an array of data / linker references to be children of this tree node.
56
- * @param {IsArrayable<IsTreeNode>} listClass Give the type of list to use for storing the children
57
- * @return {LinkedTreeList|null}
58
- */
59
- childrenFromArray () {
60
- const children = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null
61
- const listClass = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _LinkedTreeList.LinkedTreeList
62
- if (children === null) {
63
- return null
64
- }
65
- // Creates a linked-tree-list to store the children.
66
- return listClass.fromArray(children.map(child => Object.assign({}, child, {
67
- parent: this
68
- })), this.classType)
69
- }
70
- }
71
- /**
72
- * Make a new DoubleLinker from the data given if it is not already a valid Linker.
73
- * @param {TreeLinker|*} linker Return a valid TreeLinker instance from given data, or even an already valid one.
74
- * @param {IsTreeNode} [classType=TreeLinker] Provide the type of IsTreeNode to use.
75
- * @return {TreeLinker}
76
- */
77
- exports.TreeLinker = TreeLinker
78
- TreeLinker.make = function (linker) {
79
- const classType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TreeLinker
80
- return _DoubleLinker.DoubleLinker.make(linker, classType)
81
- }
82
- /**
83
- * Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
84
- * @param {Array} [values=[]] Provide an array of data that will be converted to a chain of tree-linkers.
85
- * @param {IsTreeNode} [classType=TreeLinker] Provide the type of IsTreeNode to use.
86
- * @returns {{head: TreeLinker, tail: TreeLinker}}
87
- */
88
- TreeLinker.fromArray = function () {
89
- const values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : []
90
- const classType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : TreeLinker
91
- return _DoubleLinker.DoubleLinker.fromArray(values, classType)
92
- }
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
+ var _DoubleLinker = require('../doubly-linked-list/DoubleLinker')
10
+ var _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={}]
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
+ this.classType = TreeLinker
35
+ this.data = null
36
+ this.next = null
37
+ this.prev = null
38
+ this.parent = null
39
+ this.children = null
40
+ this.data = data
41
+ this.next = next
42
+ this.prev = prev
43
+ this.parent = parent
44
+ this.children = this.childrenFromArray(children, listClass)
45
+ }
46
+
47
+ /**
48
+ * Create the children for this tree from an array.
49
+ * @param {Array|null} children Provide an array of data / linker references to be children of this tree node.
50
+ * @param {IsArrayable<IsTreeNode>} listClass Give the type of list to use for storing the children
51
+ * @return {LinkedTreeList|null}
52
+ */
53
+ childrenFromArray (children = null, listClass = _LinkedTreeList.LinkedTreeList) {
54
+ if (children === null) {
55
+ return null
56
+ }
57
+ // Creates a linked-tree-list to store the children.
58
+ return listClass.fromArray(children.map(child => Object.assign({}, child, {
59
+ parent: this
60
+ })), this.classType)
61
+ }
62
+ }
63
+ /**
64
+ * Make a new DoubleLinker from the data given if it is not already a valid Linker.
65
+ * @param {TreeLinker|*} linker Return a valid TreeLinker instance from given data, or even an already valid one.
66
+ * @param {IsTreeNode} [classType=TreeLinker] Provide the type of IsTreeNode to use.
67
+ * @return {TreeLinker}
68
+ */
69
+ exports.TreeLinker = TreeLinker
70
+ TreeLinker.make = (linker, classType = TreeLinker) => {
71
+ return _DoubleLinker.DoubleLinker.make(linker, classType)
72
+ }
73
+ /**
74
+ * Convert an array into DoubleLinker instances, return the head and tail DoubleLinkers.
75
+ * @param {Array} [values=[]] Provide an array of data that will be converted to a chain of tree-linkers.
76
+ * @param {IsTreeNode} [classType=TreeLinker] Provide the type of IsTreeNode to use.
77
+ * @returns {{head: TreeLinker, tail: TreeLinker}}
78
+ */
79
+ TreeLinker.fromArray = (values = [], classType = TreeLinker) => _DoubleLinker.DoubleLinker.fromArray(values, classType)
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TreeLinker=void 0,require("core-js/modules/esnext.iterator.constructor.js"),require("core-js/modules/esnext.iterator.map.js");var _DoubleLinker=require("../doubly-linked-list/DoubleLinker"),_LinkedTreeList=require("./LinkedTreeList");class TreeLinker{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=e.data,i=void 0===r?null:r,n=e.next,t=void 0===n?null:n,l=e.prev,s=void 0===l?null:l,o=e.children,u=void 0===o?null:o,d=e.parent,a=void 0===d?null:d,L=e.listClass,h=void 0===L?_LinkedTreeList.LinkedTreeList:L;this.classType=TreeLinker,this.data=null,this.next=null,this.prev=null,this.parent=null,this.children=null,this.data=i,this.next=t,this.prev=s,this.parent=a,this.children=this.childrenFromArray(u,h)}childrenFromArray(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_LinkedTreeList.LinkedTreeList;return null===e?null:r.fromArray(e.map((e=>Object.assign({},e,{parent:this}))),this.classType)}}exports.TreeLinker=TreeLinker,TreeLinker.make=function(e){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:TreeLinker;return _DoubleLinker.DoubleLinker.make(e,r)},TreeLinker.fromArray=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:TreeLinker;return _DoubleLinker.DoubleLinker.fromArray(e,r)};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TreeLinker=void 0,require("core-js/modules/esnext.iterator.constructor.js"),require("core-js/modules/esnext.iterator.map.js");var _DoubleLinker=require("../doubly-linked-list/DoubleLinker"),_LinkedTreeList=require("./LinkedTreeList");class TreeLinker{constructor({data:e=null,next:r=null,prev:i=null,children:n=null,parent:t=null,listClass:l=_LinkedTreeList.LinkedTreeList}={}){this.classType=TreeLinker,this.data=null,this.next=null,this.prev=null,this.parent=null,this.children=null,this.data=e,this.next=r,this.prev=i,this.parent=t,this.children=this.childrenFromArray(n,l)}childrenFromArray(e=null,r=_LinkedTreeList.LinkedTreeList){return null===e?null:r.fromArray(e.map((e=>Object.assign({},e,{parent:this}))),this.classType)}}exports.TreeLinker=TreeLinker,TreeLinker.make=(e,r=TreeLinker)=>_DoubleLinker.DoubleLinker.make(e,r),TreeLinker.fromArray=(e=[],r=TreeLinker)=>_DoubleLinker.DoubleLinker.fromArray(e,r);
@@ -1,63 +1,63 @@
1
- /**
2
- * @file queue
3
- * @author Joshua Heagle <joshuaheagle@gmail.com>
4
- * @version 1.1.0
5
- * @memberOf module:collect-your-stuff
6
- */
7
- import { Queueable } from './Queueable';
8
- import { IsArrayable } from '../../recipes/IsArrayable';
9
- import { IsLinker } from '../../recipes/IsLinker';
10
- import { completeResponse } from '../../recipes/Runnable';
11
- /**
12
- * Maintain a series of queued items.
13
- */
14
- export declare class Queue {
15
- queuedList: IsArrayable<any>;
16
- private listClass;
17
- private queueableClass;
18
- /**
19
- * Instantiate the queue with the given queue list.
20
- * @param {Iterable|LinkedList} queuedList Give the list of queueables to start in this queue.
21
- * @param {IsArrayable} listClass
22
- * @param {Queueable} queueableClass
23
- */
24
- constructor(queuedList?: IsArrayable<any>, listClass?: any, queueableClass?: typeof Queueable);
25
- /**
26
- * Take a queued task from the front of the queue and run it if ready.
27
- * @return {completeResponse|*}
28
- */
29
- dequeue(): completeResponse | any;
30
- /**
31
- * Return true if the queue is empty (there are no tasks in the queue list)
32
- * @return {boolean}
33
- */
34
- empty(): boolean;
35
- /**
36
- * Add a queued task to the end of the queue
37
- * @param {Queueable} queueable Add a new queueable to the end of the queue
38
- */
39
- enqueue(queueable: Queueable): void;
40
- /**
41
- * Take a look at the next queued task
42
- * @return {Queueable}
43
- */
44
- peek(): IsLinker;
45
- /**
46
- * Remove the next queued item and return it.
47
- * @return {Queueable|null}
48
- */
49
- remove(): Queueable | null;
50
- /**
51
- * Get the length of the current queue.
52
- * @return {number}
53
- */
54
- size(): number;
55
- /**
56
- * Convert an array to a Queue.
57
- * @param {Array} values An array of values which will be converted to queueables in this queue
58
- * @param {Queueable} queueableClass The class to use for each queueable
59
- * @param {Queue|Iterable} listClass The class to use to manage the queueables
60
- * @returns {Queue}
61
- */
62
- static fromArray: (values?: Array<any>, queueableClass?: typeof Queueable, listClass?: any) => Queue;
63
- }
1
+ /**
2
+ * @file queue
3
+ * @author Joshua Heagle <joshuaheagle@gmail.com>
4
+ * @version 1.1.0
5
+ * @memberOf module:collect-your-stuff
6
+ */
7
+ import { Queueable } from './Queueable';
8
+ import { IsArrayable } from '../../recipes/IsArrayable';
9
+ import { IsLinker } from '../../recipes/IsLinker';
10
+ import { completeResponse } from '../../recipes/Runnable';
11
+ /**
12
+ * Maintain a series of queued items.
13
+ */
14
+ export declare class Queue {
15
+ queuedList: IsArrayable<any>;
16
+ private listClass;
17
+ private queueableClass;
18
+ /**
19
+ * Instantiate the queue with the given queue list.
20
+ * @param {Iterable|LinkedList} queuedList Give the list of queueables to start in this queue.
21
+ * @param {IsArrayable} listClass
22
+ * @param {Queueable} queueableClass
23
+ */
24
+ constructor(queuedList?: IsArrayable<any>, listClass?: any, queueableClass?: typeof Queueable);
25
+ /**
26
+ * Take a queued task from the front of the queue and run it if ready.
27
+ * @return {completeResponse|*}
28
+ */
29
+ dequeue(): completeResponse | any;
30
+ /**
31
+ * Return true if the queue is empty (there are no tasks in the queue list)
32
+ * @return {boolean}
33
+ */
34
+ empty(): boolean;
35
+ /**
36
+ * Add a queued task to the end of the queue
37
+ * @param {Queueable} queueable Add a new queueable to the end of the queue
38
+ */
39
+ enqueue(queueable: Queueable): void;
40
+ /**
41
+ * Take a look at the next queued task
42
+ * @return {Queueable}
43
+ */
44
+ peek(): IsLinker;
45
+ /**
46
+ * Remove the next queued item and return it.
47
+ * @return {Queueable|null}
48
+ */
49
+ remove(): Queueable | null;
50
+ /**
51
+ * Get the length of the current queue.
52
+ * @return {number}
53
+ */
54
+ size(): number;
55
+ /**
56
+ * Convert an array to a Queue.
57
+ * @param {Array} values An array of values which will be converted to queueables in this queue
58
+ * @param {Queueable} queueableClass The class to use for each queueable
59
+ * @param {Queue|Iterable} listClass The class to use to manage the queueables
60
+ * @returns {Queue}
61
+ */
62
+ static fromArray: (values?: Array<any>, queueableClass?: typeof Queueable, listClass?: any) => Queue;
63
+ }