@spiffcommerce/preview 5.3.14-0 → 5.4.0-alpha.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
@@ -7,6 +7,7 @@ import { FramingBehavior } from '@babylonjs/core/Behaviors/Cameras/framingBehavi
7
7
  import { ArcRotateCamera } from '@babylonjs/core/Cameras/arcRotateCamera';
8
8
  import { Vector3 } from '@babylonjs/core/Maths/math.vector';
9
9
  import { Color4 } from '@babylonjs/core/Maths/math.color';
10
+ import { AssetContainer } from '@babylonjs/core/assetContainer';
10
11
 
11
12
  /**
12
13
  * Defines the different behaviors supported by the camera system
@@ -499,12 +500,6 @@ type PreviewOptions = {
499
500
  * @returns A canvas to be used for rendering.
500
501
  */
501
502
  readonly createCanvas?: () => HTMLCanvasElement;
502
- /**
503
- * A custom function that will be used to load models. Useful if you want to pre-load models or load them from disk.
504
- * @param src The source of the model to load.
505
- * @returns A promise which resolves to an ArrayBufferView of the model file.
506
- */
507
- readonly loadModel?: (src: string) => Promise<ArrayBuffer>;
508
503
  };
509
504
  /**
510
505
  * Defines an animation to be played on a product.
@@ -1159,4 +1154,21 @@ declare const REFLECTION_PROBE_RESOLUTION = 128;
1159
1154
  type PowerOfTwoNumber = 128 | 256 | 512 | 1024 | 2048 | 4096 | 8192;
1160
1155
  declare const renderingPipelineDefaults: RenderingPipelineConfiguration;
1161
1156
 
1162
- export { AntiAliasingPipelineConfiguration, Asset, BloomPipelineConfiguration, CameraAnimation, CameraPose, ChromaticAberrationPipelineConfiguration, Color4Configuration, ColorCurvesConfiguration, DepthOfFieldPipelineConfiguration, EngineContext, GrainPipelineConfiguration, LoadProgressEventData, MaterialEffectMode, MaterialHandle, MaterialResource, MiscPipelineConfiguration, ModelAnimation, ModelContainer, ModelDetails, ModelLoadEventData, PowerOfTwoNumber, PreviewOptions, PreviewServicePlugin, ProductCameraRig, REFLECTION_PROBE_RESOLUTION, RenderableContext, RenderableContextService, RenderingConfiguration, RenderingPipelineConfiguration, SharpenPipelineConfiguration, SpiffCommerce3DPreviewService, ThreeDPreviewService, Vector, VignettePipelineConfiguration, renderingPipelineDefaults };
1157
+ /**
1158
+ * A map of string to AssetContainer where the string represents
1159
+ * a resource URL for a GLB file and the AssetContainer represents the loaded
1160
+ * GL resources ready to use in a scene.
1161
+ */
1162
+ declare const assetCache: Map<string, AssetContainer | Promise<AssetContainer>>;
1163
+ /**
1164
+ * This function wraps Babylon SceneLoader functionality and caches any
1165
+ * existing loaded AssetContainers for future use. This ensures that we
1166
+ * never have to hit browser cache and that all GL resources associated to a given URL
1167
+ * are already loaded and ready to be applied to the scene.
1168
+ * @param src The source to load from.
1169
+ * @param scene The scene the container should be added to.
1170
+ * @param progressHandler A handler to track progress of loading.
1171
+ */
1172
+ declare function getAssetContainer(src: string, scene: Scene, progressHandler?: (event: ISceneLoaderProgressEvent) => void): Promise<AssetContainer>;
1173
+
1174
+ export { AntiAliasingPipelineConfiguration, Asset, BloomPipelineConfiguration, CameraAnimation, CameraPose, ChromaticAberrationPipelineConfiguration, Color4Configuration, ColorCurvesConfiguration, DepthOfFieldPipelineConfiguration, EngineContext, GrainPipelineConfiguration, LoadProgressEventData, MaterialEffectMode, MaterialHandle, MaterialResource, MiscPipelineConfiguration, ModelAnimation, ModelContainer, ModelDetails, ModelLoadEventData, PowerOfTwoNumber, PreviewOptions, PreviewServicePlugin, ProductCameraRig, REFLECTION_PROBE_RESOLUTION, RenderableContext, RenderableContextService, RenderingConfiguration, RenderingPipelineConfiguration, SharpenPipelineConfiguration, SpiffCommerce3DPreviewService, ThreeDPreviewService, Vector, VignettePipelineConfiguration, assetCache, getAssetContainer, renderingPipelineDefaults };