@spiffcommerce/preview 5.3.6 → 5.3.8-rc.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.mts CHANGED
@@ -101,7 +101,7 @@ type ThreeDPreviewService = {
101
101
  * Executes an animation of the camera.
102
102
  * @param animation The animation to execute.
103
103
  */
104
- executeCameraAnimation(animation: CameraAnimation): void;
104
+ executeCameraAnimation(animation: CameraAnimation): Promise<void>;
105
105
  /**
106
106
  * Returns the values of the Arc Rotate Camera
107
107
  */
@@ -784,8 +784,9 @@ type ModelContainer = {
784
784
  /**
785
785
  * Executes an animation on the model.
786
786
  * @param animation The animation track to run.
787
+ * @returns A promise which resolves when the animation has completed. If the animation is looping, the promise will resolve after the first loop.
787
788
  */
788
- executeAnimation(animation: ModelAnimation): void;
789
+ executeAnimation(animation: ModelAnimation): Promise<void>;
789
790
  /**
790
791
  * Disposes all resources associated with the model container.
791
792
  * Note: This will also remove the container from the preview service.
@@ -1009,7 +1010,7 @@ declare class ProductCamera extends ArcRotateCamera {
1009
1010
  * Stops the auto rotation functionality immediately.
1010
1011
  */
1011
1012
  disableAutoRotationBehavior(): void;
1012
- setRadius(radius: number): void;
1013
+ updateRadiusBounds(radius: number): void;
1013
1014
  /**
1014
1015
  * A static function used to instantiate a single product camera instance on a scene. This camera will assume
1015
1016
  * the active camera role on the scene and any existing active camera will be disposed.
@@ -1059,7 +1060,8 @@ declare class SpiffCommerce3DPreviewService implements ThreeDPreviewService {
1059
1060
  private screenshotPrepareResolve;
1060
1061
  private readonly initPromise;
1061
1062
  private initComplete;
1062
- private currentCameraAnimationPromise;
1063
+ private isAnimatingCamera;
1064
+ private queuedAnimationFunction?;
1063
1065
  constructor(options?: PreviewOptions);
1064
1066
  getInitializationPromise(): Promise<void>;
1065
1067
  getInitializationComplete(): boolean;
@@ -1077,7 +1079,7 @@ declare class SpiffCommerce3DPreviewService implements ThreeDPreviewService {
1077
1079
  unregisterView(canvas: HTMLCanvasElement): void;
1078
1080
  shutdown(): void;
1079
1081
  private renderLoop;
1080
- executeCameraAnimation(animation: CameraAnimation): void;
1082
+ executeCameraAnimation(animation: CameraAnimation): Promise<void>;
1081
1083
  getCameraPose(): CameraPose | undefined;
1082
1084
  setCameraPose(cameraPose: CameraPose): void;
1083
1085
  setCameraState(rigType: ProductCameraRig): void;