@spiffcommerce/core 20.3.0 → 20.4.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
@@ -640,6 +640,10 @@ interface Transaction {
640
640
  * The users who have access to this transaction.
641
641
  */
642
642
  stakeholders?: Stakeholder[];
643
+ /**
644
+ * The amount of this transaction that was, or will be, ordered
645
+ */
646
+ quantity?: number;
643
647
  }
644
648
  /**
645
649
  * An integration product represents the connection of a product in SpiffCommerce with
@@ -1532,6 +1536,33 @@ interface WorkflowExperience {
1532
1536
  getExportedData(): Map<string, {
1533
1537
  [key: string]: string;
1534
1538
  }>;
1539
+ /**
1540
+ * Get the quantity of this WorkflowExperience's Transaction.
1541
+ * @returns The amount that was, or will be, ordered.
1542
+ */
1543
+ getQuantity(): number;
1544
+ /**
1545
+ * Sets the quantity of this WorkflowExperience's Transaction.
1546
+ * @throws {Error} if the WorkflowExperience is read-only.
1547
+ * @throws {RangeError} if the value is below 1.
1548
+ * @param quantity The amount that was, or will be, ordered.
1549
+ */
1550
+ setQuantity(quantity: number): void;
1551
+ /**
1552
+ * Registers a callback function to be called when the specified event is raised.
1553
+ * @param type The type of event to listen for.
1554
+ * @param callback The function to call when the event occurs.
1555
+ */
1556
+ addEventListener(type: WorkflowExperienceEventType, callback: (workflowExperience: WorkflowExperience) => void): void;
1557
+ /**
1558
+ * Removes a previously registered callback.
1559
+ * @param type The type of event.
1560
+ * @param callback The function to remove.
1561
+ */
1562
+ removeEventListener(type: WorkflowExperienceEventType, callback: (workflowExperience: WorkflowExperience) => void): void;
1563
+ }
1564
+ declare enum WorkflowExperienceEventType {
1565
+ QuantityChanged = "QuantityChanged"
1535
1566
  }
1536
1567
  declare class WorkflowExperienceImpl implements WorkflowExperience {
1537
1568
  readonly client: SpiffCommerceClient;
@@ -1541,6 +1572,7 @@ declare class WorkflowExperienceImpl implements WorkflowExperience {
1541
1572
  readonly cachedStepHandles: Map<string, StepHandle<any>>;
1542
1573
  private renderableScenes;
1543
1574
  private renderableSceneCallbacks;
1575
+ private eventCallbacks;
1544
1576
  constructor(client: SpiffCommerceClient, experienceOptions: ExperienceOptions);
1545
1577
  getClient(): SpiffCommerceClient;
1546
1578
  getIsReadOnly(): boolean;
@@ -1577,6 +1609,11 @@ declare class WorkflowExperienceImpl implements WorkflowExperience {
1577
1609
  getExportedData(): Map<string, {
1578
1610
  [key: string]: string;
1579
1611
  }>;
1612
+ getQuantity(): number;
1613
+ setQuantity(quantity: number): void;
1614
+ addEventListener(type: WorkflowExperienceEventType, callback: (workflowExperience: WorkflowExperience) => void): void;
1615
+ removeEventListener(type: WorkflowExperienceEventType, callback: (workflowExperience: WorkflowExperience) => void): void;
1616
+ private callEvent;
1580
1617
  }
1581
1618
 
1582
1619
  /**