@spiffcommerce/core 0.2.9 → 0.3.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/dist/main.js +2 -2
- package/dist/module.js +2 -2
- package/dist/types.d.ts +39 -0
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -21,6 +21,45 @@ interface WorkflowScenesConfiguration {
|
|
|
21
21
|
finishScene: boolean;
|
|
22
22
|
finishSceneTitle: string;
|
|
23
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* A queue promise is a container for a promise that can be
|
|
26
|
+
* executed at a later time.
|
|
27
|
+
*/
|
|
28
|
+
export abstract class QueueablePromise {
|
|
29
|
+
readonly timestamp: number;
|
|
30
|
+
abstract execute(): Promise<any>;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A promise queue contains any number of QueuePromise objects. These objects are stored within a PromiseQueue and executed
|
|
34
|
+
* as quickly as possible in order. This is ideal in situations where a specific operation should be
|
|
35
|
+
* applied in an ordered way while still making.
|
|
36
|
+
*/
|
|
37
|
+
export class PromiseQueue<T extends QueueablePromise> {
|
|
38
|
+
/**
|
|
39
|
+
* Constructs a new promise queue.
|
|
40
|
+
* @param queueMaxSize An optional maximum size, when the max size is hit.
|
|
41
|
+
* The older promises will be discarded.
|
|
42
|
+
*/
|
|
43
|
+
constructor(queueMaxSize?: number);
|
|
44
|
+
/**
|
|
45
|
+
* Enqueue a new promise.
|
|
46
|
+
* @param promise A new promise to add to the queue.
|
|
47
|
+
*/
|
|
48
|
+
enqueue(promise: T): Promise<void>;
|
|
49
|
+
/**
|
|
50
|
+
* @returns Returns true when work is being actively processed by this queue.
|
|
51
|
+
*/
|
|
52
|
+
hasActivePromise(): boolean;
|
|
53
|
+
/**
|
|
54
|
+
* @returns The number of unexecuted jobs remaining in the queue. Not including the active job.
|
|
55
|
+
*/
|
|
56
|
+
getRemainingQueueSize(): number;
|
|
57
|
+
/**
|
|
58
|
+
* Finalize the queue, any jobs that come in while this is in progress will result
|
|
59
|
+
* in the promise being extended.
|
|
60
|
+
*/
|
|
61
|
+
finalize(): Promise<void>;
|
|
62
|
+
}
|
|
24
63
|
export class FrameService {
|
|
25
64
|
minZoomScale: number;
|
|
26
65
|
maxZoomScale: number;
|