@spiffcommerce/core 18.4.1 → 18.4.3-alpha.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/index.d.ts CHANGED
@@ -89,17 +89,25 @@ declare class PromiseQueue<T extends QueueablePromise> {
89
89
  private queue;
90
90
  private activePromise?;
91
91
  private queueMaxSize;
92
+ private isEnabled;
92
93
  /**
93
94
  * Constructs a new promise queue.
94
95
  * @param queueMaxSize An optional maximum size, when the max size is hit.
95
96
  * The older promises will be discarded.
97
+ * @param enabled When false, the queue will not process any jobs. Assign `enabled` to true to start processing.
96
98
  */
97
- constructor(queueMaxSize?: number);
99
+ constructor(queueMaxSize?: number, enabled?: boolean);
98
100
  /**
99
101
  * Enqueue a new promise.
100
102
  * @param promise A new promise to add to the queue.
101
103
  */
102
104
  enqueue(promise: T): void;
105
+ get enabled(): boolean;
106
+ /**
107
+ * Enable or disable the queue. When disabled, the queue will not process any jobs.
108
+ * Disabling processing will not cancel any active promises.
109
+ */
110
+ set enabled(value: boolean);
103
111
  /**
104
112
  * @returns Returns true when work is being actively processed by this queue.
105
113
  */
@@ -468,6 +476,11 @@ interface WorkflowManager {
468
476
  * Ejects the model of this product from the preview service. This also sets the internal preview service to undefined.
469
477
  */
470
478
  ejectFromPreviewService(): void;
479
+ /**
480
+ * Enables or disables uploading of workflow state to the server.
481
+ * @param enabled When true, workflow state will be uploaded to the server.
482
+ */
483
+ setWorkflowStateSyncEnabled: (enabled: boolean) => void;
471
484
  }
472
485
 
473
486
  interface StepService<T extends AnyStepData> {
@@ -1379,6 +1392,10 @@ interface ExperienceOptions {
1379
1392
  * by default.
1380
1393
  */
1381
1394
  singleVariantsRenderable?: boolean;
1395
+ /**
1396
+ * When true, will delay syncing the workflow state until manually enabled.
1397
+ */
1398
+ delayWorkflowStateSync?: boolean;
1382
1399
  }
1383
1400
  /**
1384
1401
  * A Workflow experience encapsulates the workflow manager and command context. It
@@ -2609,6 +2626,7 @@ declare class MockWorkflowManager implements WorkflowManager {
2609
2626
  updateStorage(_stepName: string, _update: StepStorage): Promise<void>;
2610
2627
  injectIntoPreviewService(_previewService: any): Promise<void>;
2611
2628
  ejectFromPreviewService(): void;
2629
+ setWorkflowStateSyncEnabled(_enabled: boolean): void;
2612
2630
  }
2613
2631
 
2614
2632
  declare const generateCommands: (designInputSteps: DesignInputStep[], workflow: Workflow, layouts: ILayout[], productOverlayImageUrl?: string) => Promise<CanvasCommand[]>;