@spiffcommerce/preview 5.6.0 → 5.7.0-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.mts +17 -3
- package/dist/{index.mjs → index.esm.js} +158 -158
- package/dist/index.umd.js +1 -1
- package/package.json +17 -19
- package/dist/index.d.ts +0 -1170
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Engine } from '@babylonjs/core/Engines/engine';
|
|
2
1
|
import { ISceneLoaderProgressEvent } from '@babylonjs/core/Loading/sceneLoader';
|
|
2
|
+
import { Engine } from '@babylonjs/core/Engines/engine';
|
|
3
3
|
import { Scene } from '@babylonjs/core/scene';
|
|
4
4
|
import { Mesh } from '@babylonjs/core/Meshes/mesh';
|
|
5
5
|
import { AutoRotationBehavior } from '@babylonjs/core/Behaviors/Cameras/autoRotationBehavior';
|
|
@@ -174,9 +174,20 @@ type ThreeDPreviewService = {
|
|
|
174
174
|
/**
|
|
175
175
|
* Loads a model into the scene.
|
|
176
176
|
* @param modelDetails The details of the model to load.
|
|
177
|
+
* @param options Optional configuration.
|
|
177
178
|
* @returns A reference to the model container. Call `getInitializationPromise()` to wait for the model to be loaded.
|
|
178
179
|
*/
|
|
179
|
-
loadModel(modelDetails: ModelDetails
|
|
180
|
+
loadModel(modelDetails: ModelDetails, options?: {
|
|
181
|
+
/**
|
|
182
|
+
* When true, camera will automatically animate to the model after it loads.
|
|
183
|
+
* @default true
|
|
184
|
+
*/
|
|
185
|
+
refocusCamera?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* An event handler that is called when loading progress changes.
|
|
188
|
+
*/
|
|
189
|
+
progressHandler?: (event: ISceneLoaderProgressEvent) => void;
|
|
190
|
+
}): ModelContainer;
|
|
180
191
|
/**
|
|
181
192
|
* Preloads a model into the scene. This will load the model into memory, but it will not be visible in the scene.
|
|
182
193
|
* @param url The url of the model to preload.
|
|
@@ -1108,7 +1119,10 @@ declare class SpiffCommerce3DPreviewService implements ThreeDPreviewService {
|
|
|
1108
1119
|
fireResizeEvent(): void;
|
|
1109
1120
|
setHighlights(materials: readonly MaterialHandle[], color?: readonly [number, number, number]): void;
|
|
1110
1121
|
setRenderingPipelineConfiguration(renderingPipelineConfiguration: RenderingPipelineConfiguration): void;
|
|
1111
|
-
loadModel(modelDetails: ModelDetails,
|
|
1122
|
+
loadModel(modelDetails: ModelDetails, options?: {
|
|
1123
|
+
refocusCamera?: boolean;
|
|
1124
|
+
progressHandler?: (event: ISceneLoaderProgressEvent) => void;
|
|
1125
|
+
}): ModelContainer;
|
|
1112
1126
|
preloadModel(url: string): Promise<void>;
|
|
1113
1127
|
getAllModels(): ReadonlyArray<ModelContainer>;
|
|
1114
1128
|
getModelById(id: string): ModelContainer | undefined;
|