@babylonjs/viewer 7.21.1 → 7.21.2-alpha

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.
Files changed (198) hide show
  1. package/dist/babylon-viewer.esm.js +112505 -0
  2. package/dist/babylon-viewer.esm.js.map +1 -0
  3. package/dist/babylon-viewer.esm.min.js +2 -0
  4. package/dist/babylon-viewer.esm.min.js.map +1 -0
  5. package/lib/index.d.ts +132 -0
  6. package/lib/index.js +348 -0
  7. package/lib/index.js.map +1 -0
  8. package/package.json +16 -29
  9. package/readme.md +35 -21
  10. package/configuration/configuration.d.ts +0 -107
  11. package/configuration/configuration.js +0 -16
  12. package/configuration/configuration.js.map +0 -1
  13. package/configuration/configurationCompatibility.d.ts +0 -8
  14. package/configuration/configurationCompatibility.js +0 -66
  15. package/configuration/configurationCompatibility.js.map +0 -1
  16. package/configuration/configurationContainer.d.ts +0 -10
  17. package/configuration/configurationContainer.js +0 -10
  18. package/configuration/configurationContainer.js.map +0 -1
  19. package/configuration/globals.d.ts +0 -6
  20. package/configuration/globals.js +0 -18
  21. package/configuration/globals.js.map +0 -1
  22. package/configuration/index.d.ts +0 -2
  23. package/configuration/index.js +0 -4
  24. package/configuration/index.js.map +0 -1
  25. package/configuration/interfaces/cameraConfiguration.d.ts +0 -31
  26. package/configuration/interfaces/cameraConfiguration.js +0 -2
  27. package/configuration/interfaces/cameraConfiguration.js.map +0 -1
  28. package/configuration/interfaces/colorGradingConfiguration.d.ts +0 -81
  29. package/configuration/interfaces/colorGradingConfiguration.js +0 -2
  30. package/configuration/interfaces/colorGradingConfiguration.js.map +0 -1
  31. package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +0 -20
  32. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +0 -2
  33. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js.map +0 -1
  34. package/configuration/interfaces/environmentMapConfiguration.d.ts +0 -22
  35. package/configuration/interfaces/environmentMapConfiguration.js +0 -2
  36. package/configuration/interfaces/environmentMapConfiguration.js.map +0 -1
  37. package/configuration/interfaces/groundConfiguration.d.ts +0 -24
  38. package/configuration/interfaces/groundConfiguration.js +0 -2
  39. package/configuration/interfaces/groundConfiguration.js.map +0 -1
  40. package/configuration/interfaces/imageProcessingConfiguration.d.ts +0 -45
  41. package/configuration/interfaces/imageProcessingConfiguration.js +0 -2
  42. package/configuration/interfaces/imageProcessingConfiguration.js.map +0 -1
  43. package/configuration/interfaces/index.d.ts +0 -15
  44. package/configuration/interfaces/index.js +0 -16
  45. package/configuration/interfaces/index.js.map +0 -1
  46. package/configuration/interfaces/lightConfiguration.d.ts +0 -60
  47. package/configuration/interfaces/lightConfiguration.js +0 -2
  48. package/configuration/interfaces/lightConfiguration.js.map +0 -1
  49. package/configuration/interfaces/modelAnimationConfiguration.d.ts +0 -26
  50. package/configuration/interfaces/modelAnimationConfiguration.js +0 -2
  51. package/configuration/interfaces/modelAnimationConfiguration.js.map +0 -1
  52. package/configuration/interfaces/modelConfiguration.d.ts +0 -65
  53. package/configuration/interfaces/modelConfiguration.js +0 -2
  54. package/configuration/interfaces/modelConfiguration.js.map +0 -1
  55. package/configuration/interfaces/observersConfiguration.d.ts +0 -5
  56. package/configuration/interfaces/observersConfiguration.js +0 -2
  57. package/configuration/interfaces/observersConfiguration.js.map +0 -1
  58. package/configuration/interfaces/sceneConfiguration.d.ts +0 -48
  59. package/configuration/interfaces/sceneConfiguration.js +0 -2
  60. package/configuration/interfaces/sceneConfiguration.js.map +0 -1
  61. package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +0 -23
  62. package/configuration/interfaces/sceneOptimizerConfiguration.js +0 -2
  63. package/configuration/interfaces/sceneOptimizerConfiguration.js.map +0 -1
  64. package/configuration/interfaces/skyboxConfiguration.d.ts +0 -21
  65. package/configuration/interfaces/skyboxConfiguration.js +0 -2
  66. package/configuration/interfaces/skyboxConfiguration.js.map +0 -1
  67. package/configuration/interfaces/templateConfiguration.d.ts +0 -67
  68. package/configuration/interfaces/templateConfiguration.js +0 -2
  69. package/configuration/interfaces/templateConfiguration.js.map +0 -1
  70. package/configuration/interfaces/vrConfiguration.d.ts +0 -16
  71. package/configuration/interfaces/vrConfiguration.js +0 -2
  72. package/configuration/interfaces/vrConfiguration.js.map +0 -1
  73. package/configuration/loader.d.ts +0 -4
  74. package/configuration/loader.js +0 -17
  75. package/configuration/loader.js.map +0 -1
  76. package/configuration/mappers.d.ts +0 -43
  77. package/configuration/mappers.js +0 -192
  78. package/configuration/mappers.js.map +0 -1
  79. package/configuration/renderOnlyLoader.d.ts +0 -33
  80. package/configuration/renderOnlyLoader.js +0 -162
  81. package/configuration/renderOnlyLoader.js.map +0 -1
  82. package/configuration/types/default.d.ts +0 -6
  83. package/configuration/types/default.js +0 -121
  84. package/configuration/types/default.js.map +0 -1
  85. package/configuration/types/environmentMap.d.ts +0 -5
  86. package/configuration/types/environmentMap.js +0 -14
  87. package/configuration/types/environmentMap.js.map +0 -1
  88. package/configuration/types/extended.d.ts +0 -6
  89. package/configuration/types/extended.js +0 -317
  90. package/configuration/types/extended.js.map +0 -1
  91. package/configuration/types/index.d.ts +0 -14
  92. package/configuration/types/index.js +0 -51
  93. package/configuration/types/index.js.map +0 -1
  94. package/configuration/types/minimal.d.ts +0 -6
  95. package/configuration/types/minimal.js +0 -43
  96. package/configuration/types/minimal.js.map +0 -1
  97. package/configuration/types/renderOnlyDefault.d.ts +0 -30
  98. package/configuration/types/renderOnlyDefault.js +0 -31
  99. package/configuration/types/renderOnlyDefault.js.map +0 -1
  100. package/configuration/types/shadowLight.d.ts +0 -9
  101. package/configuration/types/shadowLight.js +0 -64
  102. package/configuration/types/shadowLight.js.map +0 -1
  103. package/helper/index.d.ts +0 -29
  104. package/helper/index.js +0 -66
  105. package/helper/index.js.map +0 -1
  106. package/index.d.ts +0 -30
  107. package/index.js +0 -46
  108. package/index.js.map +0 -1
  109. package/initializer.d.ts +0 -11
  110. package/initializer.js +0 -35
  111. package/initializer.js.map +0 -1
  112. package/interfaces.d.ts +0 -5
  113. package/interfaces.js +0 -7
  114. package/interfaces.js.map +0 -1
  115. package/labs/environmentSerializer.d.ts +0 -126
  116. package/labs/environmentSerializer.js +0 -191
  117. package/labs/environmentSerializer.js.map +0 -1
  118. package/labs/texture.d.ts +0 -183
  119. package/labs/texture.js +0 -351
  120. package/labs/texture.js.map +0 -1
  121. package/labs/viewerLabs.d.ts +0 -51
  122. package/labs/viewerLabs.js +0 -134
  123. package/labs/viewerLabs.js.map +0 -1
  124. package/loader/modelLoader.d.ts +0 -56
  125. package/loader/modelLoader.js +0 -199
  126. package/loader/modelLoader.js.map +0 -1
  127. package/loader/plugins/applyMaterialConfig.d.ts +0 -12
  128. package/loader/plugins/applyMaterialConfig.js +0 -16
  129. package/loader/plugins/applyMaterialConfig.js.map +0 -1
  130. package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +0 -9
  131. package/loader/plugins/extendedMaterialLoaderPlugin.js +0 -16
  132. package/loader/plugins/extendedMaterialLoaderPlugin.js.map +0 -1
  133. package/loader/plugins/index.d.ts +0 -19
  134. package/loader/plugins/index.js +0 -44
  135. package/loader/plugins/index.js.map +0 -1
  136. package/loader/plugins/loaderPlugin.d.ts +0 -24
  137. package/loader/plugins/loaderPlugin.js +0 -2
  138. package/loader/plugins/loaderPlugin.js.map +0 -1
  139. package/loader/plugins/msftLodLoaderPlugin.d.ts +0 -12
  140. package/loader/plugins/msftLodLoaderPlugin.js +0 -21
  141. package/loader/plugins/msftLodLoaderPlugin.js.map +0 -1
  142. package/loader/plugins/telemetryLoaderPlugin.d.ts +0 -12
  143. package/loader/plugins/telemetryLoaderPlugin.js +0 -36
  144. package/loader/plugins/telemetryLoaderPlugin.js.map +0 -1
  145. package/managers/observablesManager.d.ts +0 -66
  146. package/managers/observablesManager.js +0 -35
  147. package/managers/observablesManager.js.map +0 -1
  148. package/managers/sceneManager.d.ts +0 -245
  149. package/managers/sceneManager.js +0 -1375
  150. package/managers/sceneManager.js.map +0 -1
  151. package/managers/telemetryManager.d.ts +0 -78
  152. package/managers/telemetryManager.js +0 -117
  153. package/managers/telemetryManager.js.map +0 -1
  154. package/model/modelAnimation.d.ts +0 -215
  155. package/model/modelAnimation.js +0 -237
  156. package/model/modelAnimation.js.map +0 -1
  157. package/model/viewerModel.d.ts +0 -233
  158. package/model/viewerModel.js +0 -673
  159. package/model/viewerModel.js.map +0 -1
  160. package/optimizer/custom/extended.d.ts +0 -13
  161. package/optimizer/custom/extended.js +0 -101
  162. package/optimizer/custom/extended.js.map +0 -1
  163. package/optimizer/custom/index.d.ts +0 -9
  164. package/optimizer/custom/index.js +0 -26
  165. package/optimizer/custom/index.js.map +0 -1
  166. package/renderOnlyIndex.d.ts +0 -11
  167. package/renderOnlyIndex.js +0 -18
  168. package/renderOnlyIndex.js.map +0 -1
  169. package/templating/eventManager.d.ts +0 -35
  170. package/templating/eventManager.js +0 -66
  171. package/templating/eventManager.js.map +0 -1
  172. package/templating/plugins/hdButtonPlugin.d.ts +0 -9
  173. package/templating/plugins/hdButtonPlugin.js +0 -21
  174. package/templating/plugins/hdButtonPlugin.js.map +0 -1
  175. package/templating/plugins/printButton.d.ts +0 -9
  176. package/templating/plugins/printButton.js +0 -40
  177. package/templating/plugins/printButton.js.map +0 -1
  178. package/templating/templateManager.d.ts +0 -197
  179. package/templating/templateManager.js +0 -561
  180. package/templating/templateManager.js.map +0 -1
  181. package/templating/viewerTemplatePlugin.d.ts +0 -21
  182. package/templating/viewerTemplatePlugin.js +0 -69
  183. package/templating/viewerTemplatePlugin.js.map +0 -1
  184. package/viewer/defaultViewer.d.ts +0 -130
  185. package/viewer/defaultViewer.js +0 -675
  186. package/viewer/defaultViewer.js.map +0 -1
  187. package/viewer/renderOnlyViewer.d.ts +0 -9
  188. package/viewer/renderOnlyViewer.js +0 -46
  189. package/viewer/renderOnlyViewer.js.map +0 -1
  190. package/viewer/viewer.d.ts +0 -258
  191. package/viewer/viewer.js +0 -783
  192. package/viewer/viewer.js.map +0 -1
  193. package/viewer/viewerManager.d.ts +0 -58
  194. package/viewer/viewerManager.js +0 -91
  195. package/viewer/viewerManager.js.map +0 -1
  196. package/viewer/viewerWithTemplate.d.ts +0 -9
  197. package/viewer/viewerWithTemplate.js +0 -20
  198. package/viewer/viewerWithTemplate.js.map +0 -1
@@ -1,21 +0,0 @@
1
- import type { EventCallback, Template } from "./templateManager";
2
- export interface IViewerTemplatePlugin {
3
- readonly templateName: string;
4
- readonly eventsToAttach?: Array<string>;
5
- interactionPredicate(event: EventCallback): boolean;
6
- onEvent?(event: EventCallback): void;
7
- addHTMLTemplate?(template: Template): void;
8
- }
9
- export declare abstract class AbstractViewerNavbarButton implements IViewerTemplatePlugin {
10
- readonly templateName: string;
11
- readonly eventsToAttach: Array<string>;
12
- protected _prepend: boolean;
13
- protected _buttonName: string;
14
- protected _buttonClass: string;
15
- protected _htmlTemplate: string;
16
- constructor(buttonName: string, buttonClass?: string, htmlTemplate?: string);
17
- interactionPredicate(event: EventCallback): boolean;
18
- abstract onEvent(event: EventCallback): void;
19
- addHTMLTemplate(template: Template): void;
20
- protected _generateHTMLElement(template: Template): Element | DocumentFragment;
21
- }
@@ -1,69 +0,0 @@
1
- import * as Handlebars from "handlebars";
2
- var AbstractViewerNavbarButton = /** @class */ (function () {
3
- function AbstractViewerNavbarButton(buttonName, buttonClass, htmlTemplate) {
4
- this.templateName = "navBar";
5
- this.eventsToAttach = ["pointerdown"];
6
- this._prepend = true;
7
- this._buttonName = buttonName;
8
- if (buttonClass) {
9
- this._buttonClass = buttonClass;
10
- }
11
- else {
12
- this._buttonClass = buttonName + "-button";
13
- }
14
- if (htmlTemplate) {
15
- this._htmlTemplate = htmlTemplate;
16
- }
17
- else {
18
- this._htmlTemplate = "\n<button class=\"".concat(this._buttonClass, "\">\n <span class=\"icon ").concat(this._buttonName, "-icon\"></span>\n</button>\n");
19
- }
20
- }
21
- AbstractViewerNavbarButton.prototype.interactionPredicate = function (event) {
22
- var pointerDown = event.event;
23
- if (pointerDown.button !== 0) {
24
- return false;
25
- }
26
- var element = event.event.target;
27
- if (!element) {
28
- return false;
29
- }
30
- var elementClasses = element.classList;
31
- for (var i = 0; i < elementClasses.length; ++i) {
32
- var className = elementClasses[i];
33
- if (className.indexOf(this._buttonClass) !== -1) {
34
- return true;
35
- }
36
- }
37
- return false;
38
- };
39
- AbstractViewerNavbarButton.prototype.addHTMLTemplate = function (template) {
40
- var element = this._generateHTMLElement(template);
41
- var container = template.parent.querySelector("div.default-control");
42
- if (container) {
43
- if (this._prepend) {
44
- container.insertBefore(element, container.firstChild);
45
- }
46
- else {
47
- container.appendChild(element);
48
- }
49
- }
50
- };
51
- AbstractViewerNavbarButton.prototype._generateHTMLElement = function (template) {
52
- var compiledTemplate = Handlebars.compile(this._htmlTemplate, { noEscape: template.configuration.params && !!template.configuration.params.noEscape });
53
- var config = template.configuration.params || {};
54
- var rawHtml = compiledTemplate(config);
55
- var fragment;
56
- try {
57
- fragment = document.createRange().createContextualFragment(rawHtml);
58
- }
59
- catch (e) {
60
- var test_1 = document.createElement(this._buttonClass);
61
- test_1.innerHTML = rawHtml;
62
- fragment = test_1;
63
- }
64
- return fragment;
65
- };
66
- return AbstractViewerNavbarButton;
67
- }());
68
- export { AbstractViewerNavbarButton };
69
- //# sourceMappingURL=viewerTemplatePlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"viewerTemplatePlugin.js","sourceRoot":"","sources":["../../../../tools/viewer/src/templating/viewerTemplatePlugin.ts"],"names":[],"mappings":"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","sourcesContent":["import type { EventCallback, Template } from \"./templateManager\";\r\nimport * as Handlebars from \"handlebars\";\r\n\r\nexport interface IViewerTemplatePlugin {\r\n readonly templateName: string;\r\n readonly eventsToAttach?: Array<string>;\r\n\r\n interactionPredicate(event: EventCallback): boolean;\r\n onEvent?(event: EventCallback): void;\r\n addHTMLTemplate?(template: Template): void;\r\n}\r\n\r\nexport abstract class AbstractViewerNavbarButton implements IViewerTemplatePlugin {\r\n public readonly templateName: string = \"navBar\";\r\n public readonly eventsToAttach: Array<string> = [\"pointerdown\"];\r\n protected _prepend: boolean = true;\r\n protected _buttonName: string;\r\n protected _buttonClass: string;\r\n protected _htmlTemplate: string;\r\n\r\n constructor(buttonName: string, buttonClass?: string, htmlTemplate?: string) {\r\n this._buttonName = buttonName;\r\n if (buttonClass) {\r\n this._buttonClass = buttonClass;\r\n } else {\r\n this._buttonClass = buttonName + \"-button\";\r\n }\r\n if (htmlTemplate) {\r\n this._htmlTemplate = htmlTemplate;\r\n } else {\r\n this._htmlTemplate = `\r\n<button class=\"${this._buttonClass}\">\r\n <span class=\"icon ${this._buttonName}-icon\"></span>\r\n</button>\r\n`;\r\n }\r\n }\r\n\r\n interactionPredicate(event: EventCallback): boolean {\r\n const pointerDown = <PointerEvent>event.event;\r\n if (pointerDown.button !== 0) {\r\n return false;\r\n }\r\n const element = <HTMLElement>event.event.target;\r\n\r\n if (!element) {\r\n return false;\r\n }\r\n\r\n const elementClasses = element.classList;\r\n\r\n for (let i = 0; i < elementClasses.length; ++i) {\r\n const className = elementClasses[i];\r\n if (className.indexOf(this._buttonClass) !== -1) {\r\n return true;\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n abstract onEvent(event: EventCallback): void;\r\n\r\n public addHTMLTemplate(template: Template): void {\r\n const element = this._generateHTMLElement(template);\r\n const container = template.parent.querySelector(\"div.default-control\");\r\n if (container) {\r\n if (this._prepend) {\r\n container.insertBefore(element, container.firstChild);\r\n } else {\r\n container.appendChild(element);\r\n }\r\n }\r\n }\r\n\r\n protected _generateHTMLElement(template: Template): Element | DocumentFragment {\r\n const compiledTemplate = Handlebars.compile(this._htmlTemplate, { noEscape: template.configuration.params && !!template.configuration.params.noEscape });\r\n const config = template.configuration.params || {};\r\n const rawHtml = compiledTemplate(config);\r\n let fragment: Element | DocumentFragment;\r\n try {\r\n fragment = document.createRange().createContextualFragment(rawHtml);\r\n } catch (e) {\r\n const test = document.createElement(this._buttonClass);\r\n test.innerHTML = rawHtml;\r\n fragment = test;\r\n }\r\n return fragment;\r\n }\r\n}\r\n"]}
@@ -1,130 +0,0 @@
1
- import type { Template } from "../templating/templateManager";
2
- import { TemplateManager } from "../templating/templateManager";
3
- import { AbstractViewerWithTemplate } from "./viewerWithTemplate";
4
- import type { ViewerModel } from "../model/viewerModel";
5
- import type { IViewerTemplatePlugin } from "../templating/viewerTemplatePlugin";
6
- import type { ViewerConfiguration } from "../configuration/configuration";
7
- import type { IModelConfiguration } from "../configuration/interfaces/modelConfiguration";
8
- import "@babylonjs/core/Lights/Shadows/shadowGeneratorSceneComponent.js";
9
- /**
10
- * The Default viewer is the default implementation of the AbstractViewer.
11
- * It uses the templating system to render a new canvas and controls.
12
- */
13
- export declare class DefaultViewer extends AbstractViewerWithTemplate {
14
- containerElement: Element;
15
- /**
16
- * The corresponsing template manager of this viewer.
17
- */
18
- templateManager: TemplateManager;
19
- fullscreenElement?: Element;
20
- /**
21
- * Create a new default viewer
22
- * @param containerElement the element in which the templates will be rendered
23
- * @param initialConfiguration the initial configuration. Defaults to extending the default configuration
24
- */
25
- constructor(containerElement: Element, initialConfiguration?: ViewerConfiguration);
26
- private _registeredPlugins;
27
- registerTemplatePlugin(plugin: IViewerTemplatePlugin): void;
28
- /**
29
- * This will be executed when the templates initialize.
30
- * @returns a promise that will be resolved when the templates are loaded
31
- */
32
- protected _onTemplatesLoaded(): Promise<import("./viewer").AbstractViewer>;
33
- private _initNavbar;
34
- private _animationList;
35
- private _currentAnimation;
36
- private _isAnimationPaused;
37
- private _resumePlay;
38
- private _handlePointerClick;
39
- /**
40
- * Plays or Pauses animation
41
- * @param noUiUpdate
42
- */
43
- private _togglePlayPause;
44
- private _oldIdleRotationValue;
45
- /**
46
- * Control progress bar position based on animation current frame
47
- */
48
- private _updateProgressBar;
49
- /**
50
- * Update Current Animation Speed
51
- * @param speed
52
- * @param paramsObject
53
- */
54
- private _updateAnimationSpeed;
55
- /**
56
- * Update Current Animation Type
57
- * @param data
58
- * @param data.label
59
- * @param data.value
60
- * @param paramsObject
61
- */
62
- private _updateAnimationType;
63
- protected _initVR(): void;
64
- /**
65
- * Toggle fullscreen of the entire viewer
66
- */
67
- toggleFullscreen: () => void;
68
- /**
69
- * Preparing the container element to present the viewer
70
- */
71
- protected _prepareContainerElement(): void;
72
- /**
73
- * This function will configure the templates and update them after a model was loaded
74
- * It is mainly responsible to changing the title and subtitle etc'.
75
- * @param model the model to be used to configure the templates by
76
- */
77
- protected _configureTemplate(model?: ViewerModel): void;
78
- /**
79
- * This will load a new model to the default viewer
80
- * overriding the AbstractViewer's loadModel.
81
- * The scene will automatically be cleared of the old models, if exist.
82
- * @param model the configuration object (or URL) to load.
83
- * @returns a promise that will be resolved when the model is loaded
84
- */
85
- loadModel(model?: string | File | IModelConfiguration): Promise<ViewerModel>;
86
- private _onModelLoaded;
87
- /**
88
- * Show the overlay and the defined sub-screen.
89
- * Mainly used for help and errors
90
- * @param subScreen the name of the subScreen. Those can be defined in the configuration object
91
- * @returns a promise that will be resolved when the overlay is shown
92
- */
93
- showOverlayScreen(subScreen: string): Promise<string> | Promise<Template>;
94
- /**
95
- * Hide the overlay screen.
96
- * @returns a promise that will be resolved when the overlay is hidden
97
- */
98
- hideOverlayScreen(): Promise<string> | Promise<Template>;
99
- /**
100
- * show the viewer (in case it was hidden)
101
- *
102
- * @param visibilityFunction an optional function to execute in order to show the container
103
- * @returns a promise that will be resolved when the viewer is shown
104
- */
105
- show(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
106
- /**
107
- * hide the viewer (in case it is visible)
108
- *
109
- * @param visibilityFunction an optional function to execute in order to hide the container
110
- * @returns a promise that will be resolved when the viewer is hidden
111
- */
112
- hide(visibilityFunction?: (template: Template) => Promise<Template>): Promise<Template>;
113
- /**
114
- * Show the loading screen.
115
- * The loading screen can be configured using the configuration object
116
- * @returns a promise that will be resolved when the loading screen is shown
117
- */
118
- showLoadingScreen(): Promise<string> | Promise<Template>;
119
- /**
120
- * Hide the loading screen
121
- * @returns a promise that will be resolved when the loading screen is hidden
122
- */
123
- hideLoadingScreen(): Promise<string> | Promise<Template>;
124
- dispose(): void;
125
- protected _onConfigurationLoaded(configuration: ViewerConfiguration): void;
126
- /**
127
- * An extension of the light configuration of the abstract viewer.
128
- */
129
- private _configureLights;
130
- }