@firestitch/common 8.0.12 → 8.0.13
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/app/directives/autofocus.directive.d.ts +6 -6
- package/app/directives/prevent-default.directive.d.ts +3 -3
- package/app/directives/stop-propagation.directive.d.ts +3 -3
- package/app/fs-common.module.d.ts +4 -4
- package/app/pipes/bytes.pipe.d.ts +4 -4
- package/app/pipes/currency.pipe.d.ts +6 -6
- package/app/pipes/number.pipe.d.ts +4 -4
- package/app/pipes/ordinal-number.pipe.d.ts +4 -4
- package/app/pipes/truncate.pipe.d.ts +5 -5
- package/app/pipes/util.pipe.d.ts +15 -15
- package/app/services/array.service.d.ts +58 -58
- package/app/services/math.service.d.ts +6 -6
- package/app/services/util.service.d.ts +86 -86
- package/app/services/vaildate.service.d.ts +13 -13
- package/bundles/firestitch-common.umd.js +3144 -3143
- package/bundles/firestitch-common.umd.js.map +1 -1
- package/bundles/firestitch-common.umd.min.js +1 -1
- package/bundles/firestitch-common.umd.min.js.map +1 -1
- package/esm2015/app/directives/autofocus.directive.js +41 -41
- package/esm2015/app/directives/prevent-default.directive.js +23 -23
- package/esm2015/app/directives/stop-propagation.directive.js +23 -23
- package/esm2015/app/fs-common.module.js +71 -71
- package/esm2015/app/pipes/bytes.pipe.js +21 -21
- package/esm2015/app/pipes/currency.pipe.js +37 -37
- package/esm2015/app/pipes/number.pipe.js +22 -22
- package/esm2015/app/pipes/ordinal-number.pipe.js +21 -21
- package/esm2015/app/pipes/truncate.pipe.js +27 -27
- package/esm2015/app/pipes/util.pipe.js +70 -70
- package/esm2015/app/services/array.service.js +351 -351
- package/esm2015/app/services/math.service.js +28 -28
- package/esm2015/app/services/util.service.js +429 -429
- package/esm2015/app/services/vaildate.service.js +47 -47
- package/esm2015/firestitch-common.js +18 -18
- package/esm2015/libs/array/compare/compare.js +18 -18
- package/esm2015/libs/array/compare/index.js +6 -6
- package/esm2015/libs/array/filter/filter.js +52 -52
- package/esm2015/libs/array/filter/index.js +6 -6
- package/esm2015/libs/array/find/find.js +16 -16
- package/esm2015/libs/array/find/index.js +6 -6
- package/esm2015/libs/array/inArray/inArray.js +21 -21
- package/esm2015/libs/array/inArray/index.js +6 -6
- package/esm2015/libs/array/index/index.js +24 -24
- package/esm2015/libs/array/index.js +18 -18
- package/esm2015/libs/array/indexOf/index.js +6 -6
- package/esm2015/libs/array/indexOf/indexOf.js +30 -30
- package/esm2015/libs/array/keyExists/index.js +6 -6
- package/esm2015/libs/array/keyExists/keyExists.js +13 -13
- package/esm2015/libs/array/ksort/index.js +6 -6
- package/esm2015/libs/array/ksort/ksort.js +21 -21
- package/esm2015/libs/array/list/index.js +6 -6
- package/esm2015/libs/array/list/list.js +29 -29
- package/esm2015/libs/array/nameValue/index.js +6 -6
- package/esm2015/libs/array/nameValue/nameValue.js +51 -51
- package/esm2015/libs/array/remove/index.js +6 -6
- package/esm2015/libs/array/remove/remove.js +19 -19
- package/esm2015/libs/array/rsort/index.js +6 -6
- package/esm2015/libs/array/rsort/rsort.js +14 -14
- package/esm2015/libs/array/sort/index.js +6 -6
- package/esm2015/libs/array/sort/sort.js +43 -43
- package/esm2015/libs/format/acronym/acronym.js +33 -33
- package/esm2015/libs/format/acronym/index.js +6 -6
- package/esm2015/libs/format/bytes/bytes.js +22 -22
- package/esm2015/libs/format/bytes/index.js +6 -6
- package/esm2015/libs/format/currency/currency.js +19 -19
- package/esm2015/libs/format/currency/index.js +6 -6
- package/esm2015/libs/format/index.js +10 -10
- package/esm2015/libs/format/number/index.js +6 -6
- package/esm2015/libs/format/number/number.js +13 -13
- package/esm2015/libs/format/truncate/index.js +6 -6
- package/esm2015/libs/format/truncate/truncate.js +24 -24
- package/esm2015/libs/index.js +10 -10
- package/esm2015/libs/rxjs/delayedRetry.js +57 -57
- package/esm2015/libs/util/boolean/boolean.js +13 -13
- package/esm2015/libs/util/boolean/index.js +6 -6
- package/esm2015/libs/util/debounce/debounce.js +39 -39
- package/esm2015/libs/util/debounce/index.js +6 -6
- package/esm2015/libs/util/get-normalized-path/get-normalized-path.js +15 -15
- package/esm2015/libs/util/get-normalized-path/index.js +6 -6
- package/esm2015/libs/util/guid/guid.js +35 -35
- package/esm2015/libs/util/guid/index.js +6 -6
- package/esm2015/libs/util/index.js +22 -22
- package/esm2015/libs/util/isClass/index.js +6 -6
- package/esm2015/libs/util/isClass/isClass.js +27 -27
- package/esm2015/libs/util/isEmpty/index.js +6 -6
- package/esm2015/libs/util/isEmpty/isEmpty.js +22 -22
- package/esm2015/libs/util/isNumeric/index.js +6 -6
- package/esm2015/libs/util/isNumeric/isNumeric.js +15 -15
- package/esm2015/libs/util/keys/index.js +6 -6
- package/esm2015/libs/util/keys/keys.js +79 -79
- package/esm2015/libs/util/length/index.js +6 -6
- package/esm2015/libs/util/length/length.js +19 -19
- package/esm2015/libs/util/ordinal-number/ordinal-number.js +19 -19
- package/esm2015/libs/util/queue/index.js +7 -7
- package/esm2015/libs/util/queue/operation.js +31 -31
- package/esm2015/libs/util/queue/queue.enum.js +11 -11
- package/esm2015/libs/util/queue/queue.js +290 -290
- package/esm2015/libs/util/remove-query-params/index.js +6 -6
- package/esm2015/libs/util/remove-query-params/remove-query-params.js +12 -12
- package/esm2015/libs/util/resolve/index.js +6 -6
- package/esm2015/libs/util/resolve/resolve.js +32 -32
- package/esm2015/libs/util/stringify/index.js +6 -6
- package/esm2015/libs/util/stringify/stringify.js +12 -12
- package/esm2015/libs/util/throttle/index.js +6 -6
- package/esm2015/libs/util/throttle/throttle.js +29 -29
- package/esm2015/libs/util/uuid/index.js +6 -6
- package/esm2015/libs/util/uuid/uuid.js +12 -12
- package/esm2015/libs/util/value/index.js +6 -6
- package/esm2015/libs/util/value/value.js +19 -19
- package/esm2015/libs/validate/email/email.js +12 -12
- package/esm2015/libs/validate/email/index.js +6 -6
- package/esm2015/libs/validate/index.js +8 -8
- package/esm2015/libs/validate/phone/index.js +6 -6
- package/esm2015/libs/validate/phone/phone.js +14 -14
- package/esm2015/libs/validate/url/index.js +6 -6
- package/esm2015/libs/validate/url/url.js +22 -22
- package/esm2015/public_api.js +16 -16
- package/esm5/app/directives/autofocus.directive.js +44 -44
- package/esm5/app/directives/prevent-default.directive.js +31 -31
- package/esm5/app/directives/stop-propagation.directive.js +31 -31
- package/esm5/app/fs-common.module.js +78 -78
- package/esm5/app/pipes/bytes.pipe.js +29 -29
- package/esm5/app/pipes/currency.pipe.js +42 -42
- package/esm5/app/pipes/number.pipe.js +31 -31
- package/esm5/app/pipes/ordinal-number.pipe.js +29 -29
- package/esm5/app/pipes/truncate.pipe.js +37 -37
- package/esm5/app/pipes/util.pipe.js +99 -99
- package/esm5/app/services/array.service.js +490 -490
- package/esm5/app/services/math.service.js +41 -41
- package/esm5/app/services/util.service.js +607 -607
- package/esm5/app/services/vaildate.service.js +62 -62
- package/esm5/firestitch-common.js +18 -18
- package/esm5/libs/array/compare/compare.js +18 -18
- package/esm5/libs/array/compare/index.js +6 -6
- package/esm5/libs/array/filter/filter.js +52 -52
- package/esm5/libs/array/filter/index.js +6 -6
- package/esm5/libs/array/find/find.js +16 -16
- package/esm5/libs/array/find/index.js +6 -6
- package/esm5/libs/array/inArray/inArray.js +21 -21
- package/esm5/libs/array/inArray/index.js +6 -6
- package/esm5/libs/array/index/index.js +25 -24
- package/esm5/libs/array/index.js +18 -18
- package/esm5/libs/array/indexOf/index.js +6 -6
- package/esm5/libs/array/indexOf/indexOf.js +30 -30
- package/esm5/libs/array/keyExists/index.js +6 -6
- package/esm5/libs/array/keyExists/keyExists.js +13 -13
- package/esm5/libs/array/ksort/index.js +6 -6
- package/esm5/libs/array/ksort/ksort.js +21 -21
- package/esm5/libs/array/list/index.js +6 -6
- package/esm5/libs/array/list/list.js +30 -30
- package/esm5/libs/array/nameValue/index.js +6 -6
- package/esm5/libs/array/nameValue/nameValue.js +51 -51
- package/esm5/libs/array/remove/index.js +6 -6
- package/esm5/libs/array/remove/remove.js +19 -19
- package/esm5/libs/array/rsort/index.js +6 -6
- package/esm5/libs/array/rsort/rsort.js +14 -14
- package/esm5/libs/array/sort/index.js +6 -6
- package/esm5/libs/array/sort/sort.js +44 -44
- package/esm5/libs/format/acronym/acronym.js +34 -34
- package/esm5/libs/format/acronym/index.js +6 -6
- package/esm5/libs/format/bytes/bytes.js +22 -22
- package/esm5/libs/format/bytes/index.js +6 -6
- package/esm5/libs/format/currency/currency.js +22 -22
- package/esm5/libs/format/currency/index.js +6 -6
- package/esm5/libs/format/index.js +10 -10
- package/esm5/libs/format/number/index.js +6 -6
- package/esm5/libs/format/number/number.js +13 -13
- package/esm5/libs/format/truncate/index.js +6 -6
- package/esm5/libs/format/truncate/truncate.js +27 -27
- package/esm5/libs/index.js +10 -10
- package/esm5/libs/rxjs/delayedRetry.js +64 -64
- package/esm5/libs/util/boolean/boolean.js +13 -13
- package/esm5/libs/util/boolean/index.js +6 -6
- package/esm5/libs/util/debounce/debounce.js +39 -39
- package/esm5/libs/util/debounce/index.js +6 -6
- package/esm5/libs/util/get-normalized-path/get-normalized-path.js +15 -15
- package/esm5/libs/util/get-normalized-path/index.js +6 -6
- package/esm5/libs/util/guid/guid.js +36 -36
- package/esm5/libs/util/guid/index.js +6 -6
- package/esm5/libs/util/index.js +22 -22
- package/esm5/libs/util/isClass/index.js +6 -6
- package/esm5/libs/util/isClass/isClass.js +27 -27
- package/esm5/libs/util/isEmpty/index.js +6 -6
- package/esm5/libs/util/isEmpty/isEmpty.js +22 -22
- package/esm5/libs/util/isNumeric/index.js +6 -6
- package/esm5/libs/util/isNumeric/isNumeric.js +15 -15
- package/esm5/libs/util/keys/index.js +6 -6
- package/esm5/libs/util/keys/keys.js +79 -79
- package/esm5/libs/util/length/index.js +6 -6
- package/esm5/libs/util/length/length.js +19 -19
- package/esm5/libs/util/ordinal-number/ordinal-number.js +21 -21
- package/esm5/libs/util/queue/index.js +7 -7
- package/esm5/libs/util/queue/operation.js +29 -29
- package/esm5/libs/util/queue/queue.enum.js +11 -11
- package/esm5/libs/util/queue/queue.js +366 -366
- package/esm5/libs/util/remove-query-params/index.js +6 -6
- package/esm5/libs/util/remove-query-params/remove-query-params.js +12 -12
- package/esm5/libs/util/resolve/index.js +6 -6
- package/esm5/libs/util/resolve/resolve.js +33 -33
- package/esm5/libs/util/stringify/index.js +6 -6
- package/esm5/libs/util/stringify/stringify.js +12 -12
- package/esm5/libs/util/throttle/index.js +6 -6
- package/esm5/libs/util/throttle/throttle.js +29 -29
- package/esm5/libs/util/uuid/index.js +6 -6
- package/esm5/libs/util/uuid/uuid.js +12 -12
- package/esm5/libs/util/value/index.js +6 -6
- package/esm5/libs/util/value/value.js +19 -19
- package/esm5/libs/validate/email/email.js +12 -12
- package/esm5/libs/validate/email/index.js +6 -6
- package/esm5/libs/validate/index.js +8 -8
- package/esm5/libs/validate/phone/index.js +6 -6
- package/esm5/libs/validate/phone/phone.js +14 -14
- package/esm5/libs/validate/url/index.js +6 -6
- package/esm5/libs/validate/url/url.js +22 -22
- package/esm5/public_api.js +16 -16
- package/fesm2015/firestitch-common.js +2641 -2641
- package/fesm2015/firestitch-common.js.map +1 -1
- package/fesm5/firestitch-common.js +3156 -3155
- package/fesm5/firestitch-common.js.map +1 -1
- package/firestitch-common.d.ts +13 -13
- package/libs/array/compare/compare.d.ts +1 -1
- package/libs/array/compare/index.d.ts +1 -1
- package/libs/array/filter/filter.d.ts +1 -1
- package/libs/array/filter/index.d.ts +1 -1
- package/libs/array/find/find.d.ts +1 -1
- package/libs/array/find/index.d.ts +1 -1
- package/libs/array/inArray/inArray.d.ts +1 -1
- package/libs/array/inArray/index.d.ts +1 -1
- package/libs/array/index/index.d.ts +1 -1
- package/libs/array/index.d.ts +13 -13
- package/libs/array/indexOf/index.d.ts +1 -1
- package/libs/array/indexOf/indexOf.d.ts +1 -1
- package/libs/array/keyExists/index.d.ts +1 -1
- package/libs/array/keyExists/keyExists.d.ts +1 -1
- package/libs/array/ksort/index.d.ts +1 -1
- package/libs/array/ksort/ksort.d.ts +1 -1
- package/libs/array/list/index.d.ts +1 -1
- package/libs/array/list/list.d.ts +1 -1
- package/libs/array/nameValue/index.d.ts +1 -1
- package/libs/array/nameValue/nameValue.d.ts +1 -1
- package/libs/array/remove/index.d.ts +1 -1
- package/libs/array/remove/remove.d.ts +1 -1
- package/libs/array/rsort/index.d.ts +1 -1
- package/libs/array/rsort/rsort.d.ts +1 -1
- package/libs/array/sort/index.d.ts +1 -1
- package/libs/array/sort/sort.d.ts +1 -1
- package/libs/format/acronym/acronym.d.ts +1 -1
- package/libs/format/acronym/index.d.ts +1 -1
- package/libs/format/bytes/bytes.d.ts +1 -1
- package/libs/format/bytes/index.d.ts +1 -1
- package/libs/format/currency/currency.d.ts +1 -1
- package/libs/format/currency/index.d.ts +1 -1
- package/libs/format/index.d.ts +5 -5
- package/libs/format/number/index.d.ts +1 -1
- package/libs/format/number/number.d.ts +1 -1
- package/libs/format/truncate/index.d.ts +1 -1
- package/libs/format/truncate/truncate.d.ts +1 -1
- package/libs/index.d.ts +5 -5
- package/libs/rxjs/delayedRetry.d.ts +2 -2
- package/libs/util/boolean/boolean.d.ts +1 -1
- package/libs/util/boolean/index.d.ts +1 -1
- package/libs/util/debounce/debounce.d.ts +1 -1
- package/libs/util/debounce/index.d.ts +1 -1
- package/libs/util/get-normalized-path/get-normalized-path.d.ts +2 -2
- package/libs/util/get-normalized-path/index.d.ts +1 -1
- package/libs/util/guid/guid.d.ts +1 -1
- package/libs/util/guid/index.d.ts +1 -1
- package/libs/util/index.d.ts +17 -17
- package/libs/util/isClass/index.d.ts +1 -1
- package/libs/util/isClass/isClass.d.ts +1 -1
- package/libs/util/isEmpty/index.d.ts +1 -1
- package/libs/util/isEmpty/isEmpty.d.ts +1 -1
- package/libs/util/isNumeric/index.d.ts +1 -1
- package/libs/util/isNumeric/isNumeric.d.ts +1 -1
- package/libs/util/keys/index.d.ts +1 -1
- package/libs/util/keys/keys.d.ts +37 -37
- package/libs/util/length/index.d.ts +1 -1
- package/libs/util/length/length.d.ts +1 -1
- package/libs/util/ordinal-number/ordinal-number.d.ts +1 -1
- package/libs/util/queue/index.d.ts +2 -2
- package/libs/util/queue/operation.d.ts +7 -7
- package/libs/util/queue/queue.d.ts +32 -32
- package/libs/util/queue/queue.enum.d.ts +4 -4
- package/libs/util/remove-query-params/index.d.ts +1 -1
- package/libs/util/remove-query-params/remove-query-params.d.ts +1 -1
- package/libs/util/resolve/index.d.ts +1 -1
- package/libs/util/resolve/resolve.d.ts +1 -1
- package/libs/util/stringify/index.d.ts +1 -1
- package/libs/util/stringify/stringify.d.ts +1 -1
- package/libs/util/throttle/index.d.ts +1 -1
- package/libs/util/throttle/throttle.d.ts +1 -1
- package/libs/util/uuid/index.d.ts +1 -1
- package/libs/util/uuid/uuid.d.ts +1 -1
- package/libs/util/value/index.d.ts +1 -1
- package/libs/util/value/value.d.ts +1 -1
- package/libs/validate/email/email.d.ts +1 -1
- package/libs/validate/email/index.d.ts +1 -1
- package/libs/validate/index.d.ts +3 -3
- package/libs/validate/phone/index.d.ts +1 -1
- package/libs/validate/phone/phone.d.ts +1 -1
- package/libs/validate/url/index.d.ts +1 -1
- package/libs/validate/url/url.d.ts +7 -7
- package/package.json +1 -1
- package/public_api.d.ts +6 -6
|
@@ -1,367 +1,367 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview added by tsickle
|
|
3
|
-
* Generated from: libs/util/queue/queue.ts
|
|
4
|
-
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5
|
-
*/
|
|
6
|
-
import { Observable, Subject } from 'rxjs';
|
|
7
|
-
import { Operation } from './operation';
|
|
8
|
-
import { QueueState } from './queue.enum';
|
|
9
|
-
import { delay, takeUntil } from 'rxjs/operators';
|
|
10
|
-
var Queue = /** @class */ (function () {
|
|
11
|
-
function Queue(_limit) {
|
|
12
|
-
if (_limit === void 0) { _limit = Infinity; }
|
|
13
|
-
this._limit = _limit;
|
|
14
|
-
this._done = new Subject();
|
|
15
|
-
this._queue = [];
|
|
16
|
-
this._inProgress = [];
|
|
17
|
-
this._total = 0;
|
|
18
|
-
this._completed = 0;
|
|
19
|
-
this._errors = 0;
|
|
20
|
-
this._state = QueueState.Idle;
|
|
21
|
-
this._destroy$ = new Subject();
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(Queue.prototype, "total", {
|
|
24
|
-
get: /**
|
|
25
|
-
* @return {?}
|
|
26
|
-
*/
|
|
27
|
-
function () {
|
|
28
|
-
return this._total;
|
|
29
|
-
},
|
|
30
|
-
enumerable: true,
|
|
31
|
-
configurable: true
|
|
32
|
-
});
|
|
33
|
-
Object.defineProperty(Queue.prototype, "completed", {
|
|
34
|
-
get: /**
|
|
35
|
-
* @return {?}
|
|
36
|
-
*/
|
|
37
|
-
function () {
|
|
38
|
-
return this._completed;
|
|
39
|
-
},
|
|
40
|
-
enumerable: true,
|
|
41
|
-
configurable: true
|
|
42
|
-
});
|
|
43
|
-
Object.defineProperty(Queue.prototype, "pending", {
|
|
44
|
-
get: /**
|
|
45
|
-
* @return {?}
|
|
46
|
-
*/
|
|
47
|
-
function () {
|
|
48
|
-
return this._queue.length;
|
|
49
|
-
},
|
|
50
|
-
enumerable: true,
|
|
51
|
-
configurable: true
|
|
52
|
-
});
|
|
53
|
-
Object.defineProperty(Queue.prototype, "inProgress", {
|
|
54
|
-
get: /**
|
|
55
|
-
* @return {?}
|
|
56
|
-
*/
|
|
57
|
-
function () {
|
|
58
|
-
return this._inProgress.length;
|
|
59
|
-
},
|
|
60
|
-
enumerable: true,
|
|
61
|
-
configurable: true
|
|
62
|
-
});
|
|
63
|
-
Object.defineProperty(Queue.prototype, "errors", {
|
|
64
|
-
get: /**
|
|
65
|
-
* @return {?}
|
|
66
|
-
*/
|
|
67
|
-
function () {
|
|
68
|
-
return this._errors;
|
|
69
|
-
},
|
|
70
|
-
enumerable: true,
|
|
71
|
-
configurable: true
|
|
72
|
-
});
|
|
73
|
-
Object.defineProperty(Queue.prototype, "state", {
|
|
74
|
-
get: /**
|
|
75
|
-
* @return {?}
|
|
76
|
-
*/
|
|
77
|
-
function () {
|
|
78
|
-
return this._state;
|
|
79
|
-
},
|
|
80
|
-
enumerable: true,
|
|
81
|
-
configurable: true
|
|
82
|
-
});
|
|
83
|
-
Object.defineProperty(Queue.prototype, "empty", {
|
|
84
|
-
get: /**
|
|
85
|
-
* @return {?}
|
|
86
|
-
*/
|
|
87
|
-
function () {
|
|
88
|
-
return !this._queue.length && !this._inProgress.length;
|
|
89
|
-
},
|
|
90
|
-
enumerable: true,
|
|
91
|
-
configurable: true
|
|
92
|
-
});
|
|
93
|
-
Object.defineProperty(Queue.prototype, "pendingOperations", {
|
|
94
|
-
get: /**
|
|
95
|
-
* @return {?}
|
|
96
|
-
*/
|
|
97
|
-
function () {
|
|
98
|
-
return this._queue
|
|
99
|
-
.map((/**
|
|
100
|
-
* @param {?} operation
|
|
101
|
-
* @return {?}
|
|
102
|
-
*/
|
|
103
|
-
function (operation) { return operation.name; }));
|
|
104
|
-
},
|
|
105
|
-
enumerable: true,
|
|
106
|
-
configurable: true
|
|
107
|
-
});
|
|
108
|
-
Object.defineProperty(Queue.prototype, "inProgressOperations", {
|
|
109
|
-
get: /**
|
|
110
|
-
* @return {?}
|
|
111
|
-
*/
|
|
112
|
-
function () {
|
|
113
|
-
return this._inProgress
|
|
114
|
-
.map((/**
|
|
115
|
-
* @param {?} operation
|
|
116
|
-
* @return {?}
|
|
117
|
-
*/
|
|
118
|
-
function (operation) { return operation.name; }));
|
|
119
|
-
},
|
|
120
|
-
enumerable: true,
|
|
121
|
-
configurable: true
|
|
122
|
-
});
|
|
123
|
-
/**
|
|
124
|
-
* @return {?}
|
|
125
|
-
*/
|
|
126
|
-
Queue.prototype.isProcessing = /**
|
|
127
|
-
* @return {?}
|
|
128
|
-
*/
|
|
129
|
-
function () {
|
|
130
|
-
return this._state === QueueState.Processing;
|
|
131
|
-
};
|
|
132
|
-
/**
|
|
133
|
-
* @return {?}
|
|
134
|
-
*/
|
|
135
|
-
Queue.prototype.isIdle = /**
|
|
136
|
-
* @return {?}
|
|
137
|
-
*/
|
|
138
|
-
function () {
|
|
139
|
-
return this._state === QueueState.Idle;
|
|
140
|
-
};
|
|
141
|
-
/**
|
|
142
|
-
* @param {?} value
|
|
143
|
-
* @return {?}
|
|
144
|
-
*/
|
|
145
|
-
Queue.prototype.setLimit = /**
|
|
146
|
-
* @param {?} value
|
|
147
|
-
* @return {?}
|
|
148
|
-
*/
|
|
149
|
-
function (value) {
|
|
150
|
-
this._limit = value;
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* @param {?} fun
|
|
154
|
-
* @param {?=} err
|
|
155
|
-
* @param {?=} complete
|
|
156
|
-
* @return {?}
|
|
157
|
-
*/
|
|
158
|
-
Queue.prototype.subscribe = /**
|
|
159
|
-
* @param {?} fun
|
|
160
|
-
* @param {?=} err
|
|
161
|
-
* @param {?=} complete
|
|
162
|
-
* @return {?}
|
|
163
|
-
*/
|
|
164
|
-
function (fun, err, complete) {
|
|
165
|
-
this._done
|
|
166
|
-
.pipe(takeUntil(this._destroy$))
|
|
167
|
-
.subscribe(fun, err, complete);
|
|
168
|
-
};
|
|
169
|
-
/**
|
|
170
|
-
* @param {?} fun
|
|
171
|
-
* @param {?=} err
|
|
172
|
-
* @param {?=} complete
|
|
173
|
-
* @return {?}
|
|
174
|
-
*/
|
|
175
|
-
Queue.prototype.complete = /**
|
|
176
|
-
* @param {?} fun
|
|
177
|
-
* @param {?=} err
|
|
178
|
-
* @param {?=} complete
|
|
179
|
-
* @return {?}
|
|
180
|
-
*/
|
|
181
|
-
function (fun, err, complete) {
|
|
182
|
-
var _this = this;
|
|
183
|
-
Observable.create((/**
|
|
184
|
-
* @param {?} observer
|
|
185
|
-
* @return {?}
|
|
186
|
-
*/
|
|
187
|
-
function (observer) {
|
|
188
|
-
if (!_this.isProcessing()) {
|
|
189
|
-
observer.next();
|
|
190
|
-
observer.complete();
|
|
191
|
-
return;
|
|
192
|
-
}
|
|
193
|
-
_this.subscribe((/**
|
|
194
|
-
* @return {?}
|
|
195
|
-
*/
|
|
196
|
-
function () {
|
|
197
|
-
observer.next();
|
|
198
|
-
observer.complete();
|
|
199
|
-
}), (/**
|
|
200
|
-
* @param {?} error
|
|
201
|
-
* @return {?}
|
|
202
|
-
*/
|
|
203
|
-
function (error) {
|
|
204
|
-
observer.error(error);
|
|
205
|
-
_this.clear();
|
|
206
|
-
}));
|
|
207
|
-
})).subscribe(fun, err, complete);
|
|
208
|
-
};
|
|
209
|
-
/**
|
|
210
|
-
* @param {?} target
|
|
211
|
-
* @param {?=} name
|
|
212
|
-
* @return {?}
|
|
213
|
-
*/
|
|
214
|
-
Queue.prototype.push = /**
|
|
215
|
-
* @param {?} target
|
|
216
|
-
* @param {?=} name
|
|
217
|
-
* @return {?}
|
|
218
|
-
*/
|
|
219
|
-
function (target, name) {
|
|
220
|
-
/** @type {?} */
|
|
221
|
-
var operation = new Operation(target, name);
|
|
222
|
-
this._total++;
|
|
223
|
-
this._state = QueueState.Processing;
|
|
224
|
-
if (this._inProgress.length < this._limit) {
|
|
225
|
-
this._processOperation(operation);
|
|
226
|
-
}
|
|
227
|
-
else {
|
|
228
|
-
this._queue.push(operation);
|
|
229
|
-
}
|
|
230
|
-
return operation.ready$;
|
|
231
|
-
};
|
|
232
|
-
/**
|
|
233
|
-
* @return {?}
|
|
234
|
-
*/
|
|
235
|
-
Queue.prototype.clear = /**
|
|
236
|
-
* @return {?}
|
|
237
|
-
*/
|
|
238
|
-
function () {
|
|
239
|
-
this._queue = [];
|
|
240
|
-
this._total = 0;
|
|
241
|
-
this._errors = 0;
|
|
242
|
-
this._completed = 0;
|
|
243
|
-
this._state = QueueState.Idle;
|
|
244
|
-
this._done = new Subject();
|
|
245
|
-
};
|
|
246
|
-
/**
|
|
247
|
-
* @return {?}
|
|
248
|
-
*/
|
|
249
|
-
Queue.prototype.destroy = /**
|
|
250
|
-
* @return {?}
|
|
251
|
-
*/
|
|
252
|
-
function () {
|
|
253
|
-
this.clear();
|
|
254
|
-
this._done.complete();
|
|
255
|
-
};
|
|
256
|
-
/**
|
|
257
|
-
* @private
|
|
258
|
-
* @param {?} operation
|
|
259
|
-
* @return {?}
|
|
260
|
-
*/
|
|
261
|
-
Queue.prototype._processOperation = /**
|
|
262
|
-
* @private
|
|
263
|
-
* @param {?} operation
|
|
264
|
-
* @return {?}
|
|
265
|
-
*/
|
|
266
|
-
function (operation) {
|
|
267
|
-
var _this = this;
|
|
268
|
-
this._inProgress.push(operation);
|
|
269
|
-
operation.target
|
|
270
|
-
.pipe(delay(200), // Hack to prevent extra quick proccess execution
|
|
271
|
-
takeUntil(this._destroy$)).subscribe({
|
|
272
|
-
next: (/**
|
|
273
|
-
* @param {?} data
|
|
274
|
-
* @return {?}
|
|
275
|
-
*/
|
|
276
|
-
function (data) {
|
|
277
|
-
operation.ready$.next(data);
|
|
278
|
-
}),
|
|
279
|
-
error: (/**
|
|
280
|
-
* @param {?} error
|
|
281
|
-
* @return {?}
|
|
282
|
-
*/
|
|
283
|
-
function (error) {
|
|
284
|
-
/** @type {?} */
|
|
285
|
-
var opIndex = _this._inProgress.indexOf(operation);
|
|
286
|
-
_this._inProgress.splice(opIndex, 1);
|
|
287
|
-
_this._errors++;
|
|
288
|
-
operation.ready$.error(error);
|
|
289
|
-
if (_this.empty) {
|
|
290
|
-
_this._state = QueueState.Idle;
|
|
291
|
-
_this._done.error(error);
|
|
292
|
-
}
|
|
293
|
-
}),
|
|
294
|
-
complete: (/**
|
|
295
|
-
* @return {?}
|
|
296
|
-
*/
|
|
297
|
-
function () {
|
|
298
|
-
/** @type {?} */
|
|
299
|
-
var opIndex = _this._inProgress.indexOf(operation);
|
|
300
|
-
_this._inProgress.splice(opIndex, 1);
|
|
301
|
-
_this._completed++;
|
|
302
|
-
operation.ready$.complete();
|
|
303
|
-
if (_this.empty) {
|
|
304
|
-
_this._state = QueueState.Idle;
|
|
305
|
-
_this._done.next();
|
|
306
|
-
}
|
|
307
|
-
else {
|
|
308
|
-
if (_this._queue.length) {
|
|
309
|
-
/** @type {?} */
|
|
310
|
-
var queueItem = _this._queue.shift();
|
|
311
|
-
_this._processOperation(queueItem);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
})
|
|
315
|
-
});
|
|
316
|
-
};
|
|
317
|
-
return Queue;
|
|
318
|
-
}());
|
|
319
|
-
export { Queue };
|
|
320
|
-
if (false) {
|
|
321
|
-
/**
|
|
322
|
-
* @type {?}
|
|
323
|
-
* @private
|
|
324
|
-
*/
|
|
325
|
-
Queue.prototype._done;
|
|
326
|
-
/**
|
|
327
|
-
* @type {?}
|
|
328
|
-
* @private
|
|
329
|
-
*/
|
|
330
|
-
Queue.prototype._queue;
|
|
331
|
-
/**
|
|
332
|
-
* @type {?}
|
|
333
|
-
* @private
|
|
334
|
-
*/
|
|
335
|
-
Queue.prototype._inProgress;
|
|
336
|
-
/**
|
|
337
|
-
* @type {?}
|
|
338
|
-
* @private
|
|
339
|
-
*/
|
|
340
|
-
Queue.prototype._total;
|
|
341
|
-
/**
|
|
342
|
-
* @type {?}
|
|
343
|
-
* @private
|
|
344
|
-
*/
|
|
345
|
-
Queue.prototype._completed;
|
|
346
|
-
/**
|
|
347
|
-
* @type {?}
|
|
348
|
-
* @private
|
|
349
|
-
*/
|
|
350
|
-
Queue.prototype._errors;
|
|
351
|
-
/**
|
|
352
|
-
* @type {?}
|
|
353
|
-
* @private
|
|
354
|
-
*/
|
|
355
|
-
Queue.prototype._state;
|
|
356
|
-
/**
|
|
357
|
-
* @type {?}
|
|
358
|
-
* @private
|
|
359
|
-
*/
|
|
360
|
-
Queue.prototype._destroy$;
|
|
361
|
-
/**
|
|
362
|
-
* @type {?}
|
|
363
|
-
* @private
|
|
364
|
-
*/
|
|
365
|
-
Queue.prototype._limit;
|
|
366
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview added by tsickle
|
|
3
|
+
* Generated from: libs/util/queue/queue.ts
|
|
4
|
+
* @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
5
|
+
*/
|
|
6
|
+
import { Observable, Subject } from 'rxjs';
|
|
7
|
+
import { Operation } from './operation';
|
|
8
|
+
import { QueueState } from './queue.enum';
|
|
9
|
+
import { delay, takeUntil } from 'rxjs/operators';
|
|
10
|
+
var Queue = /** @class */ (function () {
|
|
11
|
+
function Queue(_limit) {
|
|
12
|
+
if (_limit === void 0) { _limit = Infinity; }
|
|
13
|
+
this._limit = _limit;
|
|
14
|
+
this._done = new Subject();
|
|
15
|
+
this._queue = [];
|
|
16
|
+
this._inProgress = [];
|
|
17
|
+
this._total = 0;
|
|
18
|
+
this._completed = 0;
|
|
19
|
+
this._errors = 0;
|
|
20
|
+
this._state = QueueState.Idle;
|
|
21
|
+
this._destroy$ = new Subject();
|
|
22
|
+
}
|
|
23
|
+
Object.defineProperty(Queue.prototype, "total", {
|
|
24
|
+
get: /**
|
|
25
|
+
* @return {?}
|
|
26
|
+
*/
|
|
27
|
+
function () {
|
|
28
|
+
return this._total;
|
|
29
|
+
},
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true
|
|
32
|
+
});
|
|
33
|
+
Object.defineProperty(Queue.prototype, "completed", {
|
|
34
|
+
get: /**
|
|
35
|
+
* @return {?}
|
|
36
|
+
*/
|
|
37
|
+
function () {
|
|
38
|
+
return this._completed;
|
|
39
|
+
},
|
|
40
|
+
enumerable: true,
|
|
41
|
+
configurable: true
|
|
42
|
+
});
|
|
43
|
+
Object.defineProperty(Queue.prototype, "pending", {
|
|
44
|
+
get: /**
|
|
45
|
+
* @return {?}
|
|
46
|
+
*/
|
|
47
|
+
function () {
|
|
48
|
+
return this._queue.length;
|
|
49
|
+
},
|
|
50
|
+
enumerable: true,
|
|
51
|
+
configurable: true
|
|
52
|
+
});
|
|
53
|
+
Object.defineProperty(Queue.prototype, "inProgress", {
|
|
54
|
+
get: /**
|
|
55
|
+
* @return {?}
|
|
56
|
+
*/
|
|
57
|
+
function () {
|
|
58
|
+
return this._inProgress.length;
|
|
59
|
+
},
|
|
60
|
+
enumerable: true,
|
|
61
|
+
configurable: true
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(Queue.prototype, "errors", {
|
|
64
|
+
get: /**
|
|
65
|
+
* @return {?}
|
|
66
|
+
*/
|
|
67
|
+
function () {
|
|
68
|
+
return this._errors;
|
|
69
|
+
},
|
|
70
|
+
enumerable: true,
|
|
71
|
+
configurable: true
|
|
72
|
+
});
|
|
73
|
+
Object.defineProperty(Queue.prototype, "state", {
|
|
74
|
+
get: /**
|
|
75
|
+
* @return {?}
|
|
76
|
+
*/
|
|
77
|
+
function () {
|
|
78
|
+
return this._state;
|
|
79
|
+
},
|
|
80
|
+
enumerable: true,
|
|
81
|
+
configurable: true
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(Queue.prototype, "empty", {
|
|
84
|
+
get: /**
|
|
85
|
+
* @return {?}
|
|
86
|
+
*/
|
|
87
|
+
function () {
|
|
88
|
+
return !this._queue.length && !this._inProgress.length;
|
|
89
|
+
},
|
|
90
|
+
enumerable: true,
|
|
91
|
+
configurable: true
|
|
92
|
+
});
|
|
93
|
+
Object.defineProperty(Queue.prototype, "pendingOperations", {
|
|
94
|
+
get: /**
|
|
95
|
+
* @return {?}
|
|
96
|
+
*/
|
|
97
|
+
function () {
|
|
98
|
+
return this._queue
|
|
99
|
+
.map((/**
|
|
100
|
+
* @param {?} operation
|
|
101
|
+
* @return {?}
|
|
102
|
+
*/
|
|
103
|
+
function (operation) { return operation.name; }));
|
|
104
|
+
},
|
|
105
|
+
enumerable: true,
|
|
106
|
+
configurable: true
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(Queue.prototype, "inProgressOperations", {
|
|
109
|
+
get: /**
|
|
110
|
+
* @return {?}
|
|
111
|
+
*/
|
|
112
|
+
function () {
|
|
113
|
+
return this._inProgress
|
|
114
|
+
.map((/**
|
|
115
|
+
* @param {?} operation
|
|
116
|
+
* @return {?}
|
|
117
|
+
*/
|
|
118
|
+
function (operation) { return operation.name; }));
|
|
119
|
+
},
|
|
120
|
+
enumerable: true,
|
|
121
|
+
configurable: true
|
|
122
|
+
});
|
|
123
|
+
/**
|
|
124
|
+
* @return {?}
|
|
125
|
+
*/
|
|
126
|
+
Queue.prototype.isProcessing = /**
|
|
127
|
+
* @return {?}
|
|
128
|
+
*/
|
|
129
|
+
function () {
|
|
130
|
+
return this._state === QueueState.Processing;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* @return {?}
|
|
134
|
+
*/
|
|
135
|
+
Queue.prototype.isIdle = /**
|
|
136
|
+
* @return {?}
|
|
137
|
+
*/
|
|
138
|
+
function () {
|
|
139
|
+
return this._state === QueueState.Idle;
|
|
140
|
+
};
|
|
141
|
+
/**
|
|
142
|
+
* @param {?} value
|
|
143
|
+
* @return {?}
|
|
144
|
+
*/
|
|
145
|
+
Queue.prototype.setLimit = /**
|
|
146
|
+
* @param {?} value
|
|
147
|
+
* @return {?}
|
|
148
|
+
*/
|
|
149
|
+
function (value) {
|
|
150
|
+
this._limit = value;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* @param {?} fun
|
|
154
|
+
* @param {?=} err
|
|
155
|
+
* @param {?=} complete
|
|
156
|
+
* @return {?}
|
|
157
|
+
*/
|
|
158
|
+
Queue.prototype.subscribe = /**
|
|
159
|
+
* @param {?} fun
|
|
160
|
+
* @param {?=} err
|
|
161
|
+
* @param {?=} complete
|
|
162
|
+
* @return {?}
|
|
163
|
+
*/
|
|
164
|
+
function (fun, err, complete) {
|
|
165
|
+
this._done
|
|
166
|
+
.pipe(takeUntil(this._destroy$))
|
|
167
|
+
.subscribe(fun, err, complete);
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* @param {?} fun
|
|
171
|
+
* @param {?=} err
|
|
172
|
+
* @param {?=} complete
|
|
173
|
+
* @return {?}
|
|
174
|
+
*/
|
|
175
|
+
Queue.prototype.complete = /**
|
|
176
|
+
* @param {?} fun
|
|
177
|
+
* @param {?=} err
|
|
178
|
+
* @param {?=} complete
|
|
179
|
+
* @return {?}
|
|
180
|
+
*/
|
|
181
|
+
function (fun, err, complete) {
|
|
182
|
+
var _this = this;
|
|
183
|
+
Observable.create((/**
|
|
184
|
+
* @param {?} observer
|
|
185
|
+
* @return {?}
|
|
186
|
+
*/
|
|
187
|
+
function (observer) {
|
|
188
|
+
if (!_this.isProcessing()) {
|
|
189
|
+
observer.next();
|
|
190
|
+
observer.complete();
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
_this.subscribe((/**
|
|
194
|
+
* @return {?}
|
|
195
|
+
*/
|
|
196
|
+
function () {
|
|
197
|
+
observer.next();
|
|
198
|
+
observer.complete();
|
|
199
|
+
}), (/**
|
|
200
|
+
* @param {?} error
|
|
201
|
+
* @return {?}
|
|
202
|
+
*/
|
|
203
|
+
function (error) {
|
|
204
|
+
observer.error(error);
|
|
205
|
+
_this.clear();
|
|
206
|
+
}));
|
|
207
|
+
})).subscribe(fun, err, complete);
|
|
208
|
+
};
|
|
209
|
+
/**
|
|
210
|
+
* @param {?} target
|
|
211
|
+
* @param {?=} name
|
|
212
|
+
* @return {?}
|
|
213
|
+
*/
|
|
214
|
+
Queue.prototype.push = /**
|
|
215
|
+
* @param {?} target
|
|
216
|
+
* @param {?=} name
|
|
217
|
+
* @return {?}
|
|
218
|
+
*/
|
|
219
|
+
function (target, name) {
|
|
220
|
+
/** @type {?} */
|
|
221
|
+
var operation = new Operation(target, name);
|
|
222
|
+
this._total++;
|
|
223
|
+
this._state = QueueState.Processing;
|
|
224
|
+
if (this._inProgress.length < this._limit) {
|
|
225
|
+
this._processOperation(operation);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
this._queue.push(operation);
|
|
229
|
+
}
|
|
230
|
+
return operation.ready$;
|
|
231
|
+
};
|
|
232
|
+
/**
|
|
233
|
+
* @return {?}
|
|
234
|
+
*/
|
|
235
|
+
Queue.prototype.clear = /**
|
|
236
|
+
* @return {?}
|
|
237
|
+
*/
|
|
238
|
+
function () {
|
|
239
|
+
this._queue = [];
|
|
240
|
+
this._total = 0;
|
|
241
|
+
this._errors = 0;
|
|
242
|
+
this._completed = 0;
|
|
243
|
+
this._state = QueueState.Idle;
|
|
244
|
+
this._done = new Subject();
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* @return {?}
|
|
248
|
+
*/
|
|
249
|
+
Queue.prototype.destroy = /**
|
|
250
|
+
* @return {?}
|
|
251
|
+
*/
|
|
252
|
+
function () {
|
|
253
|
+
this.clear();
|
|
254
|
+
this._done.complete();
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* @private
|
|
258
|
+
* @param {?} operation
|
|
259
|
+
* @return {?}
|
|
260
|
+
*/
|
|
261
|
+
Queue.prototype._processOperation = /**
|
|
262
|
+
* @private
|
|
263
|
+
* @param {?} operation
|
|
264
|
+
* @return {?}
|
|
265
|
+
*/
|
|
266
|
+
function (operation) {
|
|
267
|
+
var _this = this;
|
|
268
|
+
this._inProgress.push(operation);
|
|
269
|
+
operation.target
|
|
270
|
+
.pipe(delay(200), // Hack to prevent extra quick proccess execution
|
|
271
|
+
takeUntil(this._destroy$)).subscribe({
|
|
272
|
+
next: (/**
|
|
273
|
+
* @param {?} data
|
|
274
|
+
* @return {?}
|
|
275
|
+
*/
|
|
276
|
+
function (data) {
|
|
277
|
+
operation.ready$.next(data);
|
|
278
|
+
}),
|
|
279
|
+
error: (/**
|
|
280
|
+
* @param {?} error
|
|
281
|
+
* @return {?}
|
|
282
|
+
*/
|
|
283
|
+
function (error) {
|
|
284
|
+
/** @type {?} */
|
|
285
|
+
var opIndex = _this._inProgress.indexOf(operation);
|
|
286
|
+
_this._inProgress.splice(opIndex, 1);
|
|
287
|
+
_this._errors++;
|
|
288
|
+
operation.ready$.error(error);
|
|
289
|
+
if (_this.empty) {
|
|
290
|
+
_this._state = QueueState.Idle;
|
|
291
|
+
_this._done.error(error);
|
|
292
|
+
}
|
|
293
|
+
}),
|
|
294
|
+
complete: (/**
|
|
295
|
+
* @return {?}
|
|
296
|
+
*/
|
|
297
|
+
function () {
|
|
298
|
+
/** @type {?} */
|
|
299
|
+
var opIndex = _this._inProgress.indexOf(operation);
|
|
300
|
+
_this._inProgress.splice(opIndex, 1);
|
|
301
|
+
_this._completed++;
|
|
302
|
+
operation.ready$.complete();
|
|
303
|
+
if (_this.empty) {
|
|
304
|
+
_this._state = QueueState.Idle;
|
|
305
|
+
_this._done.next();
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
if (_this._queue.length) {
|
|
309
|
+
/** @type {?} */
|
|
310
|
+
var queueItem = _this._queue.shift();
|
|
311
|
+
_this._processOperation(queueItem);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
})
|
|
315
|
+
});
|
|
316
|
+
};
|
|
317
|
+
return Queue;
|
|
318
|
+
}());
|
|
319
|
+
export { Queue };
|
|
320
|
+
if (false) {
|
|
321
|
+
/**
|
|
322
|
+
* @type {?}
|
|
323
|
+
* @private
|
|
324
|
+
*/
|
|
325
|
+
Queue.prototype._done;
|
|
326
|
+
/**
|
|
327
|
+
* @type {?}
|
|
328
|
+
* @private
|
|
329
|
+
*/
|
|
330
|
+
Queue.prototype._queue;
|
|
331
|
+
/**
|
|
332
|
+
* @type {?}
|
|
333
|
+
* @private
|
|
334
|
+
*/
|
|
335
|
+
Queue.prototype._inProgress;
|
|
336
|
+
/**
|
|
337
|
+
* @type {?}
|
|
338
|
+
* @private
|
|
339
|
+
*/
|
|
340
|
+
Queue.prototype._total;
|
|
341
|
+
/**
|
|
342
|
+
* @type {?}
|
|
343
|
+
* @private
|
|
344
|
+
*/
|
|
345
|
+
Queue.prototype._completed;
|
|
346
|
+
/**
|
|
347
|
+
* @type {?}
|
|
348
|
+
* @private
|
|
349
|
+
*/
|
|
350
|
+
Queue.prototype._errors;
|
|
351
|
+
/**
|
|
352
|
+
* @type {?}
|
|
353
|
+
* @private
|
|
354
|
+
*/
|
|
355
|
+
Queue.prototype._state;
|
|
356
|
+
/**
|
|
357
|
+
* @type {?}
|
|
358
|
+
* @private
|
|
359
|
+
*/
|
|
360
|
+
Queue.prototype._destroy$;
|
|
361
|
+
/**
|
|
362
|
+
* @type {?}
|
|
363
|
+
* @private
|
|
364
|
+
*/
|
|
365
|
+
Queue.prototype._limit;
|
|
366
|
+
}
|
|
367
367
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicXVldWUuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9AZmlyZXN0aXRjaC9jb21tb24vIiwic291cmNlcyI6WyJsaWJzL3V0aWwvcXVldWUvcXVldWUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7QUFBQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUMzQyxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBQ3hDLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFDMUMsT0FBTyxFQUFFLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxnQkFBZ0IsQ0FBQztBQUVsRDtJQWVFLGVBQW9CLE1BQWlCO1FBQWpCLHVCQUFBLEVBQUEsaUJBQWlCO1FBQWpCLFdBQU0sR0FBTixNQUFNLENBQVc7UUFiN0IsVUFBSyxHQUFHLElBQUksT0FBTyxFQUFFLENBQUM7UUFFdEIsV0FBTSxHQUFnQixFQUFFLENBQUM7UUFDekIsZ0JBQVcsR0FBZ0IsRUFBRSxDQUFDO1FBRTlCLFdBQU0sR0FBRyxDQUFDLENBQUM7UUFDWCxlQUFVLEdBQUcsQ0FBQyxDQUFDO1FBQ2YsWUFBTyxHQUFHLENBQUMsQ0FBQztRQUVaLFdBQU0sR0FBZSxV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