@spiffcommerce/core 0.2.8 → 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 +42 -3
- 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;
|
|
@@ -255,20 +294,20 @@ declare class TextStepService implements StepService<_TextStepData1> {
|
|
|
255
294
|
textAlign: (stepData: _TextStepData1) => string;
|
|
256
295
|
}
|
|
257
296
|
export const textStepService: TextStepService;
|
|
258
|
-
interface EditedSteps {
|
|
297
|
+
export interface EditedSteps {
|
|
259
298
|
[stepName: string]: boolean;
|
|
260
299
|
}
|
|
261
300
|
export interface MandatorySteps {
|
|
262
301
|
[stepName: string]: boolean;
|
|
263
302
|
}
|
|
264
|
-
type StepElements = {
|
|
303
|
+
export type StepElements = {
|
|
265
304
|
[key: string]: RegionElement[];
|
|
266
305
|
};
|
|
267
306
|
type StepInitialised = {
|
|
268
307
|
[key: string]: boolean;
|
|
269
308
|
};
|
|
270
309
|
type StepMetadata = FrameMetadata | IllustrationMetadata | ModuleMetadata | TextMetadata;
|
|
271
|
-
interface WorkflowStorage {
|
|
310
|
+
export interface WorkflowStorage {
|
|
272
311
|
[stepName: string]: StepStorage;
|
|
273
312
|
}
|
|
274
313
|
export interface WorkflowMetadata {
|