@spiffcommerce/preview 5.0.0-beta.0 → 5.0.0-rc.1

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
@@ -56,19 +56,6 @@ type ThreeDPreviewService = {
56
56
  * @param listener The listener to remove.
57
57
  */
58
58
  unregisterFocusLostListener(listener: () => void): void;
59
- /**
60
- * Providers listeners with information about load progress when
61
- * the preview is loading scenes.
62
- * @param listener A function to get load progress updates
63
- */
64
- registerLoadProgressListener(listener: (e: LoadProgressEventData) => void): void;
65
- /**
66
- * Allows you to pass any function that originally called registerLoadProgressListener()
67
- * to have it excluded from load progress updates.
68
- * If the function was never registered this call has no effect.
69
- * @param listener The listener to exclude from load progress.
70
- */
71
- unregisterLoadProgressListener(listener: (e: LoadProgressEventData) => void): void;
72
59
  /**
73
60
  * Provides a callback that will be called when the service has been initialized.
74
61
  * @param listener The callback function to add.
@@ -115,12 +102,6 @@ type ThreeDPreviewService = {
115
102
  * Shutdown the preview engine and all registered plugins. Noop if the engine is not initialized.
116
103
  */
117
104
  shutdown(): void;
118
- /**
119
- * Initialize the scene. Also initialize the engine, if it hasn't been done already.
120
- * @param modelDetails Optional model details to load.
121
- * @returns A promise that resolves with the model container, or undefined if no model was loaded.
122
- */
123
- initialize(modelDetails?: ModelDetails): Promise<ModelContainer | undefined>;
124
105
  /**
125
106
  * Executes an animation of the camera.
126
107
  * @param animation The animation to execute.
@@ -151,10 +132,6 @@ type ThreeDPreviewService = {
151
132
  * @param shouldAutoRotate When true rotation is running, paused otherwise.
152
133
  */
153
134
  setAutoRotation(shouldAutoRotate: boolean): void;
154
- /**
155
- * Get current load progress for the scene.
156
- */
157
- getSceneInitializationProgress(): number;
158
135
  /**
159
136
  * Returns the current configuration object applied to the scene.
160
137
  */
@@ -1016,10 +993,6 @@ declare class SpiffCommerce3DPreviewService implements ThreeDPreviewService {
1016
993
  private readonly configuration;
1017
994
  private readonly engine;
1018
995
  private readonly scene;
1019
- /**
1020
- * The current progress of loading the scene. A value between 0-100.
1021
- */
1022
- private loadProgress;
1023
996
  /**
1024
997
  * The last camera animation requested if the scene wasn't ready.
1025
998
  */
@@ -1029,10 +1002,6 @@ declare class SpiffCommerce3DPreviewService implements ThreeDPreviewService {
1029
1002
  * this field will be set to true.
1030
1003
  */
1031
1004
  private focusLostNotified;
1032
- /**
1033
- * A list of listener who want to know about the progress of scene loading.
1034
- */
1035
- private loadObservable;
1036
1005
  /**
1037
1006
  * An observable handling loss of target focus by the camera.
1038
1007
  */
@@ -1042,7 +1011,7 @@ declare class SpiffCommerce3DPreviewService implements ThreeDPreviewService {
1042
1011
  */
1043
1012
  private initializedCallbacks;
1044
1013
  /**
1045
- * Whether or not the preview service has been initialized.
1014
+ * Whether or not the preview service has completed its first render
1046
1015
  */
1047
1016
  private isInitialized;
1048
1017
  /**
@@ -1067,8 +1036,6 @@ declare class SpiffCommerce3DPreviewService implements ThreeDPreviewService {
1067
1036
  };
1068
1037
  registerFocusLostListener(listener: () => void): void;
1069
1038
  unregisterFocusLostListener(listener: () => void): void;
1070
- registerLoadProgressListener(listener: (e: LoadProgressEventData) => void): void;
1071
- unregisterLoadProgressListener(listener: (e: LoadProgressEventData) => void): void;
1072
1039
  registerInitializedListener(listener: () => void | Promise<void>): void;
1073
1040
  unregisterInitializedListener(listener: () => void | Promise<void>): void;
1074
1041
  getIsInitialized(): boolean;
@@ -1078,8 +1045,7 @@ declare class SpiffCommerce3DPreviewService implements ThreeDPreviewService {
1078
1045
  getNumViewports(): number;
1079
1046
  unregisterView(canvas: HTMLCanvasElement): void;
1080
1047
  shutdown(): void;
1081
- getSceneInitializationProgress(): number;
1082
- initialize(modelDetails?: ModelDetails): Promise<ModelContainer | undefined>;
1048
+ private renderLoop;
1083
1049
  executeCameraAnimation(animation: CameraAnimation): void;
1084
1050
  getCameraPose(): CameraPose | undefined;
1085
1051
  setCameraPose(cameraPose: CameraPose): void;
@@ -1108,23 +1074,12 @@ declare class SpiffCommerce3DPreviewService implements ThreeDPreviewService {
1108
1074
  rotation: Vector;
1109
1075
  scale: Vector;
1110
1076
  };
1111
- private handleMaterialProgressCallback;
1112
- private handleModelProgressCallback;
1113
1077
  /**
1114
1078
  * Given a valid canvas element, will remove any existing input controls
1115
1079
  * and re-attach them to the given canvas. The pan mouse button can be set
1116
1080
  * to either 0 (left mouse) or 2 (right mouse).
1117
1081
  */
1118
1082
  private reattachControls;
1119
- /**
1120
- * Computes a load listener event based on current state of scene.
1121
- */
1122
- private getLoadListenerEvent;
1123
- /**
1124
- * Computes the average loading time across all loading events and notifies
1125
- * listeners of the current load progress.
1126
- */
1127
- private notifyLoadHandlers;
1128
1083
  }
1129
1084
 
1130
1085
  /**