@babylonjs/viewer 5.0.0 → 5.0.3

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 (127) hide show
  1. package/configuration/configuration.d.ts +107 -107
  2. package/configuration/configuration.js +15 -15
  3. package/configuration/configurationCompatibility.d.ts +8 -8
  4. package/configuration/configurationCompatibility.js +65 -65
  5. package/configuration/configurationContainer.d.ts +10 -10
  6. package/configuration/configurationContainer.js +9 -9
  7. package/configuration/globals.d.ts +6 -6
  8. package/configuration/globals.js +17 -17
  9. package/configuration/index.d.ts +2 -2
  10. package/configuration/index.js +3 -3
  11. package/configuration/interfaces/cameraConfiguration.d.ts +31 -31
  12. package/configuration/interfaces/cameraConfiguration.js +1 -1
  13. package/configuration/interfaces/colorGradingConfiguration.d.ts +81 -81
  14. package/configuration/interfaces/colorGradingConfiguration.js +1 -1
  15. package/configuration/interfaces/defaultRenderingPipelineConfiguration.d.ts +20 -20
  16. package/configuration/interfaces/defaultRenderingPipelineConfiguration.js +1 -1
  17. package/configuration/interfaces/environmentMapConfiguration.d.ts +22 -22
  18. package/configuration/interfaces/environmentMapConfiguration.js +1 -1
  19. package/configuration/interfaces/groundConfiguration.d.ts +24 -24
  20. package/configuration/interfaces/groundConfiguration.js +1 -1
  21. package/configuration/interfaces/imageProcessingConfiguration.d.ts +43 -43
  22. package/configuration/interfaces/imageProcessingConfiguration.js +1 -1
  23. package/configuration/interfaces/index.d.ts +15 -15
  24. package/configuration/interfaces/index.js +15 -15
  25. package/configuration/interfaces/lightConfiguration.d.ts +60 -60
  26. package/configuration/interfaces/lightConfiguration.js +1 -1
  27. package/configuration/interfaces/modelAnimationConfiguration.d.ts +26 -26
  28. package/configuration/interfaces/modelAnimationConfiguration.js +1 -1
  29. package/configuration/interfaces/modelConfiguration.d.ts +65 -65
  30. package/configuration/interfaces/modelConfiguration.js +1 -1
  31. package/configuration/interfaces/observersConfiguration.d.ts +5 -5
  32. package/configuration/interfaces/observersConfiguration.js +1 -1
  33. package/configuration/interfaces/sceneConfiguration.d.ts +48 -48
  34. package/configuration/interfaces/sceneConfiguration.js +1 -1
  35. package/configuration/interfaces/sceneOptimizerConfiguration.d.ts +23 -23
  36. package/configuration/interfaces/sceneOptimizerConfiguration.js +1 -1
  37. package/configuration/interfaces/skyboxConfiguration.d.ts +21 -21
  38. package/configuration/interfaces/skyboxConfiguration.js +1 -1
  39. package/configuration/interfaces/templateConfiguration.d.ts +67 -67
  40. package/configuration/interfaces/templateConfiguration.js +1 -1
  41. package/configuration/interfaces/vrConfiguration.d.ts +16 -16
  42. package/configuration/interfaces/vrConfiguration.js +1 -1
  43. package/configuration/loader.d.ts +4 -4
  44. package/configuration/loader.js +16 -16
  45. package/configuration/mappers.d.ts +42 -42
  46. package/configuration/mappers.js +190 -190
  47. package/configuration/renderOnlyLoader.d.ts +33 -33
  48. package/configuration/renderOnlyLoader.js +161 -161
  49. package/configuration/types/default.d.ts +6 -6
  50. package/configuration/types/default.js +120 -120
  51. package/configuration/types/environmentMap.d.ts +5 -5
  52. package/configuration/types/environmentMap.js +13 -13
  53. package/configuration/types/extended.d.ts +6 -6
  54. package/configuration/types/extended.js +316 -316
  55. package/configuration/types/index.d.ts +13 -13
  56. package/configuration/types/index.js +49 -49
  57. package/configuration/types/minimal.d.ts +6 -6
  58. package/configuration/types/minimal.js +42 -42
  59. package/configuration/types/renderOnlyDefault.d.ts +30 -30
  60. package/configuration/types/renderOnlyDefault.js +30 -30
  61. package/configuration/types/shadowLight.d.ts +9 -9
  62. package/configuration/types/shadowLight.js +63 -63
  63. package/helper/index.d.ts +26 -26
  64. package/helper/index.js +62 -62
  65. package/index.d.ts +30 -30
  66. package/index.js +45 -45
  67. package/initializer.d.ts +11 -11
  68. package/initializer.js +34 -34
  69. package/interfaces.d.ts +5 -5
  70. package/interfaces.js +1 -1
  71. package/labs/environmentSerializer.d.ts +126 -126
  72. package/labs/environmentSerializer.js +190 -190
  73. package/labs/texture.d.ts +183 -183
  74. package/labs/texture.js +300 -300
  75. package/labs/viewerLabs.d.ts +51 -51
  76. package/labs/viewerLabs.js +133 -133
  77. package/loader/modelLoader.d.ts +47 -47
  78. package/loader/modelLoader.js +189 -189
  79. package/loader/plugins/applyMaterialConfig.d.ts +12 -12
  80. package/loader/plugins/applyMaterialConfig.js +15 -15
  81. package/loader/plugins/extendedMaterialLoaderPlugin.d.ts +9 -9
  82. package/loader/plugins/extendedMaterialLoaderPlugin.js +15 -15
  83. package/loader/plugins/index.d.ts +18 -18
  84. package/loader/plugins/index.js +42 -42
  85. package/loader/plugins/loaderPlugin.d.ts +24 -24
  86. package/loader/plugins/loaderPlugin.js +1 -1
  87. package/loader/plugins/msftLodLoaderPlugin.d.ts +12 -12
  88. package/loader/plugins/msftLodLoaderPlugin.js +20 -20
  89. package/loader/plugins/telemetryLoaderPlugin.d.ts +12 -12
  90. package/loader/plugins/telemetryLoaderPlugin.js +35 -35
  91. package/managers/observablesManager.d.ts +66 -66
  92. package/managers/observablesManager.js +34 -34
  93. package/managers/sceneManager.d.ts +243 -243
  94. package/managers/sceneManager.js +1388 -1388
  95. package/managers/telemetryManager.d.ts +57 -57
  96. package/managers/telemetryManager.js +113 -113
  97. package/model/modelAnimation.d.ts +215 -215
  98. package/model/modelAnimation.js +232 -232
  99. package/model/viewerModel.d.ts +228 -228
  100. package/model/viewerModel.js +669 -669
  101. package/optimizer/custom/extended.d.ts +11 -11
  102. package/optimizer/custom/extended.js +98 -98
  103. package/optimizer/custom/index.d.ts +8 -8
  104. package/optimizer/custom/index.js +24 -24
  105. package/package.json +5 -5
  106. package/renderOnlyIndex.d.ts +11 -11
  107. package/renderOnlyIndex.js +17 -17
  108. package/templating/eventManager.d.ts +35 -35
  109. package/templating/eventManager.js +65 -65
  110. package/templating/plugins/hdButtonPlugin.d.ts +9 -9
  111. package/templating/plugins/hdButtonPlugin.js +21 -21
  112. package/templating/plugins/printButton.d.ts +9 -9
  113. package/templating/plugins/printButton.js +40 -40
  114. package/templating/templateManager.d.ts +190 -190
  115. package/templating/templateManager.js +553 -553
  116. package/templating/viewerTemplatePlugin.d.ts +21 -21
  117. package/templating/viewerTemplatePlugin.js +68 -68
  118. package/viewer/defaultViewer.d.ts +122 -122
  119. package/viewer/defaultViewer.js +665 -665
  120. package/viewer/renderOnlyViewer.d.ts +8 -8
  121. package/viewer/renderOnlyViewer.js +43 -43
  122. package/viewer/viewer.d.ts +254 -254
  123. package/viewer/viewer.js +777 -777
  124. package/viewer/viewerManager.d.ts +55 -55
  125. package/viewer/viewerManager.js +87 -87
  126. package/viewer/viewerWithTemplate.d.ts +9 -9
  127. package/viewer/viewerWithTemplate.js +19 -19
@@ -1,50 +1,50 @@
1
- import { minimalConfiguration } from "./minimal.js";
2
- import { defaultConfiguration } from "./default.js";
3
- import { extendedConfiguration } from "./extended.js";
4
- import { shadowDirectionalLightConfiguration, shadowSpotlLightConfiguration } from "./shadowLight.js";
5
- import { environmentMapConfiguration } from "./environmentMap.js";
6
- // eslint-disable-next-line import/no-internal-modules
7
- import { deepmerge } from "../../helper/index.js";
8
- /**
9
- * Get the configuration type you need to use as the base for your viewer.
10
- * The types can either be a single string, or comma separated types that will extend each other. for example:
11
- *
12
- * "default, environmentMap" will first load the default configuration and will extend it using the environmentMap configuration.
13
- *
14
- * @param types a comma-separated string of the type(s) or configuration to load.
15
- */
16
- var getConfigurationType = function (types) {
17
- var config = {};
18
- var typesSeparated = types.split(",");
19
- typesSeparated.forEach(function (type) {
20
- switch (type.trim()) {
21
- case "environmentMap":
22
- config = deepmerge(config, environmentMapConfiguration);
23
- break;
24
- case "shadowDirectionalLight":
25
- config = deepmerge(config, shadowDirectionalLightConfiguration);
26
- break;
27
- case "shadowSpotLight":
28
- config = deepmerge(config, shadowSpotlLightConfiguration);
29
- break;
30
- case "default":
31
- config = deepmerge(config, defaultConfiguration);
32
- break;
33
- case "minimal":
34
- config = deepmerge(config, minimalConfiguration);
35
- break;
36
- case "none":
37
- break;
38
- case "extended":
39
- default:
40
- config = deepmerge(config, extendedConfiguration);
41
- break;
42
- }
43
- if (config.extends) {
44
- config = deepmerge(config, getConfigurationType(config.extends));
45
- }
46
- });
47
- return config;
48
- };
49
- export { getConfigurationType, defaultConfiguration, minimalConfiguration };
1
+ import { minimalConfiguration } from "./minimal.js";
2
+ import { defaultConfiguration } from "./default.js";
3
+ import { extendedConfiguration } from "./extended.js";
4
+ import { shadowDirectionalLightConfiguration, shadowSpotlLightConfiguration } from "./shadowLight.js";
5
+ import { environmentMapConfiguration } from "./environmentMap.js";
6
+ // eslint-disable-next-line import/no-internal-modules
7
+ import { deepmerge } from "../../helper/index.js";
8
+ /**
9
+ * Get the configuration type you need to use as the base for your viewer.
10
+ * The types can either be a single string, or comma separated types that will extend each other. for example:
11
+ *
12
+ * "default, environmentMap" will first load the default configuration and will extend it using the environmentMap configuration.
13
+ *
14
+ * @param types a comma-separated string of the type(s) or configuration to load.
15
+ */
16
+ var getConfigurationType = function (types) {
17
+ var config = {};
18
+ var typesSeparated = types.split(",");
19
+ typesSeparated.forEach(function (type) {
20
+ switch (type.trim()) {
21
+ case "environmentMap":
22
+ config = deepmerge(config, environmentMapConfiguration);
23
+ break;
24
+ case "shadowDirectionalLight":
25
+ config = deepmerge(config, shadowDirectionalLightConfiguration);
26
+ break;
27
+ case "shadowSpotLight":
28
+ config = deepmerge(config, shadowSpotlLightConfiguration);
29
+ break;
30
+ case "default":
31
+ config = deepmerge(config, defaultConfiguration);
32
+ break;
33
+ case "minimal":
34
+ config = deepmerge(config, minimalConfiguration);
35
+ break;
36
+ case "none":
37
+ break;
38
+ case "extended":
39
+ default:
40
+ config = deepmerge(config, extendedConfiguration);
41
+ break;
42
+ }
43
+ if (config.extends) {
44
+ config = deepmerge(config, getConfigurationType(config.extends));
45
+ }
46
+ });
47
+ return config;
48
+ };
49
+ export { getConfigurationType, defaultConfiguration, minimalConfiguration };
50
50
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- import type { ViewerConfiguration } from "./../configuration";
2
- /**
3
- * The minimal configuration needed to make the viewer work.
4
- * Some functionalities might not work correctly (like fill-screen)
5
- */
6
- export declare const minimalConfiguration: ViewerConfiguration;
1
+ import type { ViewerConfiguration } from "./../configuration";
2
+ /**
3
+ * The minimal configuration needed to make the viewer work.
4
+ * Some functionalities might not work correctly (like fill-screen)
5
+ */
6
+ export declare const minimalConfiguration: ViewerConfiguration;
@@ -1,43 +1,43 @@
1
- import { defaultTemplate, fillContainer, loadingScreen, defaultViewer, overlay, error, loading, close } from "babylonjs-viewer-assets";
2
- /**
3
- * The minimal configuration needed to make the viewer work.
4
- * Some functionalities might not work correctly (like fill-screen)
5
- */
6
- export var minimalConfiguration = {
7
- version: "0.1",
8
- templates: {
9
- main: {
10
- html: defaultTemplate,
11
- },
12
- fillContainer: {
13
- html: fillContainer,
14
- params: {
15
- disable: false,
16
- },
17
- },
18
- loadingScreen: {
19
- html: loadingScreen,
20
- params: {
21
- backgroundColor: "#000000",
22
- loadingImage: loading,
23
- },
24
- },
25
- viewer: {
26
- html: defaultViewer,
27
- },
28
- overlay: {
29
- html: overlay,
30
- params: {
31
- closeImage: close,
32
- closeText: "Close",
33
- },
34
- },
35
- error: {
36
- html: error,
37
- },
38
- },
39
- engine: {
40
- antialiasing: true,
41
- },
42
- };
1
+ import { defaultTemplate, fillContainer, loadingScreen, defaultViewer, overlay, error, loading, close } from "babylonjs-viewer-assets";
2
+ /**
3
+ * The minimal configuration needed to make the viewer work.
4
+ * Some functionalities might not work correctly (like fill-screen)
5
+ */
6
+ export var minimalConfiguration = {
7
+ version: "0.1",
8
+ templates: {
9
+ main: {
10
+ html: defaultTemplate,
11
+ },
12
+ fillContainer: {
13
+ html: fillContainer,
14
+ params: {
15
+ disable: false,
16
+ },
17
+ },
18
+ loadingScreen: {
19
+ html: loadingScreen,
20
+ params: {
21
+ backgroundColor: "#000000",
22
+ loadingImage: loading,
23
+ },
24
+ },
25
+ viewer: {
26
+ html: defaultViewer,
27
+ },
28
+ overlay: {
29
+ html: overlay,
30
+ params: {
31
+ closeImage: close,
32
+ closeText: "Close",
33
+ },
34
+ },
35
+ error: {
36
+ html: error,
37
+ },
38
+ },
39
+ engine: {
40
+ antialiasing: true,
41
+ },
42
+ };
43
43
  //# sourceMappingURL=minimal.js.map
@@ -1,30 +1,30 @@
1
- /**
2
- * The render only default configuration of the viewer, including templates (canvas, overly, loading screen)
3
- * This configuration doesn't hold specific parameters, and only defines objects that are needed for the render only viewer viewer to fully work correctly.
4
- */
5
- export declare const renderOnlyDefaultConfiguration: {
6
- version: string;
7
- camera: {
8
- behaviors: {
9
- autoRotate: {
10
- type: number;
11
- };
12
- framing: {
13
- type: number;
14
- zoomOnBoundingInfo: boolean;
15
- zoomStopsAnimation: boolean;
16
- };
17
- bouncing: {
18
- type: number;
19
- };
20
- };
21
- };
22
- skybox: {};
23
- ground: {
24
- receiveShadows: boolean;
25
- };
26
- engine: {
27
- antialiasing: boolean;
28
- };
29
- scene: {};
30
- };
1
+ /**
2
+ * The render only default configuration of the viewer, including templates (canvas, overly, loading screen)
3
+ * This configuration doesn't hold specific parameters, and only defines objects that are needed for the render only viewer viewer to fully work correctly.
4
+ */
5
+ export declare const renderOnlyDefaultConfiguration: {
6
+ version: string;
7
+ camera: {
8
+ behaviors: {
9
+ autoRotate: {
10
+ type: number;
11
+ };
12
+ framing: {
13
+ type: number;
14
+ zoomOnBoundingInfo: boolean;
15
+ zoomStopsAnimation: boolean;
16
+ };
17
+ bouncing: {
18
+ type: number;
19
+ };
20
+ };
21
+ };
22
+ skybox: {};
23
+ ground: {
24
+ receiveShadows: boolean;
25
+ };
26
+ engine: {
27
+ antialiasing: boolean;
28
+ };
29
+ scene: {};
30
+ };
@@ -1,31 +1,31 @@
1
- /**
2
- * The render only default configuration of the viewer, including templates (canvas, overly, loading screen)
3
- * This configuration doesn't hold specific parameters, and only defines objects that are needed for the render only viewer viewer to fully work correctly.
4
- */
5
- export var renderOnlyDefaultConfiguration = {
6
- version: "3.2.0-alpha4",
7
- camera: {
8
- behaviors: {
9
- autoRotate: {
10
- type: 0,
11
- },
12
- framing: {
13
- type: 2,
14
- zoomOnBoundingInfo: true,
15
- zoomStopsAnimation: false,
16
- },
17
- bouncing: {
18
- type: 1,
19
- },
20
- },
21
- },
22
- skybox: {},
23
- ground: {
24
- receiveShadows: true,
25
- },
26
- engine: {
27
- antialiasing: true,
28
- },
29
- scene: {},
30
- };
1
+ /**
2
+ * The render only default configuration of the viewer, including templates (canvas, overly, loading screen)
3
+ * This configuration doesn't hold specific parameters, and only defines objects that are needed for the render only viewer viewer to fully work correctly.
4
+ */
5
+ export var renderOnlyDefaultConfiguration = {
6
+ version: "3.2.0-alpha4",
7
+ camera: {
8
+ behaviors: {
9
+ autoRotate: {
10
+ type: 0,
11
+ },
12
+ framing: {
13
+ type: 2,
14
+ zoomOnBoundingInfo: true,
15
+ zoomStopsAnimation: false,
16
+ },
17
+ bouncing: {
18
+ type: 1,
19
+ },
20
+ },
21
+ },
22
+ skybox: {},
23
+ ground: {
24
+ receiveShadows: true,
25
+ },
26
+ engine: {
27
+ antialiasing: true,
28
+ },
29
+ scene: {},
30
+ };
31
31
  //# sourceMappingURL=renderOnlyDefault.js.map
@@ -1,9 +1,9 @@
1
- import type { ViewerConfiguration } from "./../configuration";
2
- /**
3
- * Defines a default directional shadow light for normalized objects (!)
4
- */
5
- export declare const shadowDirectionalLightConfiguration: ViewerConfiguration;
6
- /**
7
- * Defines a default shadow-enabled spot light for normalized objects.
8
- */
9
- export declare const shadowSpotlLightConfiguration: ViewerConfiguration;
1
+ import type { ViewerConfiguration } from "./../configuration";
2
+ /**
3
+ * Defines a default directional shadow light for normalized objects (!)
4
+ */
5
+ export declare const shadowDirectionalLightConfiguration: ViewerConfiguration;
6
+ /**
7
+ * Defines a default shadow-enabled spot light for normalized objects.
8
+ */
9
+ export declare const shadowSpotlLightConfiguration: ViewerConfiguration;
@@ -1,64 +1,64 @@
1
- /**
2
- * Defines a default directional shadow light for normalized objects (!)
3
- */
4
- export var shadowDirectionalLightConfiguration = {
5
- model: {
6
- receiveShadows: true,
7
- castShadow: true,
8
- },
9
- ground: {
10
- receiveShadows: true,
11
- },
12
- lights: {
13
- shadowDirectionalLight: {
14
- type: 1,
15
- shadowEnabled: true,
16
- target: { x: 0, y: 0, z: 0.5 },
17
- position: { x: 1.49, y: 2.39, z: -1.33 },
18
- diffuse: { r: 0.867, g: 0.816, b: 0.788 },
19
- intensity: 4.887,
20
- intensityMode: 0,
21
- shadowBufferSize: 1024,
22
- shadowFrustumSize: 6.0,
23
- shadowFieldOfView: 50.977,
24
- shadowMinZ: 0.1,
25
- shadowMaxZ: 10.0,
26
- shadowConfig: {
27
- blurKernel: 32,
28
- useBlurCloseExponentialShadowMap: true,
29
- },
30
- },
31
- },
32
- };
33
- /**
34
- * Defines a default shadow-enabled spot light for normalized objects.
35
- */
36
- export var shadowSpotlLightConfiguration = {
37
- model: {
38
- receiveShadows: true,
39
- castShadow: true,
40
- },
41
- ground: {
42
- receiveShadows: true,
43
- },
44
- lights: {
45
- shadowSpotLight: {
46
- type: 2,
47
- intensity: 2,
48
- shadowEnabled: true,
49
- target: { x: 0, y: 0, z: 0.5 },
50
- position: { x: 0, y: 3.5, z: 3.7 },
51
- angle: 1,
52
- shadowOrthoScale: 0.5,
53
- shadowBufferSize: 1024,
54
- shadowMinZ: 0.1,
55
- shadowMaxZ: 50.0,
56
- shadowConfig: {
57
- frustumEdgeFalloff: 0.5,
58
- blurKernel: 32,
59
- useBlurExponentialShadowMap: true,
60
- },
61
- },
62
- },
63
- };
1
+ /**
2
+ * Defines a default directional shadow light for normalized objects (!)
3
+ */
4
+ export var shadowDirectionalLightConfiguration = {
5
+ model: {
6
+ receiveShadows: true,
7
+ castShadow: true,
8
+ },
9
+ ground: {
10
+ receiveShadows: true,
11
+ },
12
+ lights: {
13
+ shadowDirectionalLight: {
14
+ type: 1,
15
+ shadowEnabled: true,
16
+ target: { x: 0, y: 0, z: 0.5 },
17
+ position: { x: 1.49, y: 2.39, z: -1.33 },
18
+ diffuse: { r: 0.867, g: 0.816, b: 0.788 },
19
+ intensity: 4.887,
20
+ intensityMode: 0,
21
+ shadowBufferSize: 1024,
22
+ shadowFrustumSize: 6.0,
23
+ shadowFieldOfView: 50.977,
24
+ shadowMinZ: 0.1,
25
+ shadowMaxZ: 10.0,
26
+ shadowConfig: {
27
+ blurKernel: 32,
28
+ useBlurCloseExponentialShadowMap: true,
29
+ },
30
+ },
31
+ },
32
+ };
33
+ /**
34
+ * Defines a default shadow-enabled spot light for normalized objects.
35
+ */
36
+ export var shadowSpotlLightConfiguration = {
37
+ model: {
38
+ receiveShadows: true,
39
+ castShadow: true,
40
+ },
41
+ ground: {
42
+ receiveShadows: true,
43
+ },
44
+ lights: {
45
+ shadowSpotLight: {
46
+ type: 2,
47
+ intensity: 2,
48
+ shadowEnabled: true,
49
+ target: { x: 0, y: 0, z: 0.5 },
50
+ position: { x: 0, y: 3.5, z: 3.7 },
51
+ angle: 1,
52
+ shadowOrthoScale: 0.5,
53
+ shadowBufferSize: 1024,
54
+ shadowMinZ: 0.1,
55
+ shadowMaxZ: 50.0,
56
+ shadowConfig: {
57
+ frustumEdgeFalloff: 0.5,
58
+ blurKernel: 32,
59
+ useBlurExponentialShadowMap: true,
60
+ },
61
+ },
62
+ },
63
+ };
64
64
  //# sourceMappingURL=shadowLight.js.map
package/helper/index.d.ts CHANGED
@@ -1,26 +1,26 @@
1
- declare const expDm: Ideepmerge;
2
- export { expDm as deepmerge };
3
- /**
4
- * Is the provided string a URL?
5
- *
6
- * @param urlToCheck the url to inspect
7
- */
8
- export declare function isUrl(urlToCheck: string): boolean;
9
- /**
10
- * Convert a string from kebab-case to camelCase
11
- * @param s string to convert
12
- */
13
- export declare function kebabToCamel(s: string): string;
14
- /**
15
- * Convert a string from camelCase to kebab-case
16
- * @param str string to convert
17
- */
18
- export declare function camelToKebab(str: string): string | null;
19
- /**
20
- * This will extend an object with configuration values.
21
- * What it practically does it take the keys from the configuration and set them on the object.
22
- * If the configuration is a tree, it will traverse into the tree.
23
- * @param object the object to extend
24
- * @param config the configuration object that will extend the object
25
- */
26
- export declare function extendClassWithConfig(object: any, config: any): void;
1
+ declare const expDm: Ideepmerge;
2
+ export { expDm as deepmerge };
3
+ /**
4
+ * Is the provided string a URL?
5
+ *
6
+ * @param urlToCheck the url to inspect
7
+ */
8
+ export declare function isUrl(urlToCheck: string): boolean;
9
+ /**
10
+ * Convert a string from kebab-case to camelCase
11
+ * @param s string to convert
12
+ */
13
+ export declare function kebabToCamel(s: string): string;
14
+ /**
15
+ * Convert a string from camelCase to kebab-case
16
+ * @param str string to convert
17
+ */
18
+ export declare function camelToKebab(str: string): string | null;
19
+ /**
20
+ * This will extend an object with configuration values.
21
+ * What it practically does it take the keys from the configuration and set them on the object.
22
+ * If the configuration is a tree, it will traverse into the tree.
23
+ * @param object the object to extend
24
+ * @param config the configuration object that will extend the object
25
+ */
26
+ export declare function extendClassWithConfig(object: any, config: any): void;
package/helper/index.js CHANGED
@@ -1,63 +1,63 @@
1
- import * as deepmerge from "deepmerge";
2
- var expDm = deepmerge["default"];
3
- export { expDm as deepmerge };
4
- /**
5
- * Is the provided string a URL?
6
- *
7
- * @param urlToCheck the url to inspect
8
- */
9
- export function isUrl(urlToCheck) {
10
- if (urlToCheck.indexOf("http") === 0 || urlToCheck.indexOf("/") === 0 || urlToCheck.indexOf("./") === 0 || urlToCheck.indexOf("../") === 0) {
11
- return true;
12
- }
13
- return false;
14
- }
15
- /**
16
- * Convert a string from kebab-case to camelCase
17
- * @param s string to convert
18
- */
19
- export function kebabToCamel(s) {
20
- return s.replace(/(-\w)/g, function (m) {
21
- return m[1].toUpperCase();
22
- });
23
- }
24
- //https://gist.github.com/youssman/745578062609e8acac9f
25
- /**
26
- * Convert a string from camelCase to kebab-case
27
- * @param str string to convert
28
- */
29
- export function camelToKebab(str) {
30
- return !str
31
- ? null
32
- : str.replace(/([A-Z])/g, function (g) {
33
- return "-" + g[0].toLowerCase();
34
- });
35
- }
36
- /**
37
- * This will extend an object with configuration values.
38
- * What it practically does it take the keys from the configuration and set them on the object.
39
- * If the configuration is a tree, it will traverse into the tree.
40
- * @param object the object to extend
41
- * @param config the configuration object that will extend the object
42
- */
43
- export function extendClassWithConfig(object, config) {
44
- if (!config || typeof config !== "object") {
45
- return;
46
- }
47
- Object.keys(config).forEach(function (key) {
48
- if (key in object && typeof object[key] !== "function") {
49
- // if (typeof object[key] === 'function') return;
50
- // if it is an object, iterate internally until reaching basic types
51
- // but null is an object so if its null and config[key] is not an object eg. number, the number should be set
52
- if (typeof object[key] === "object" && (object[key] !== null || typeof config[key] === "object")) {
53
- extendClassWithConfig(object[key], config[key]);
54
- }
55
- else {
56
- if (config[key] !== undefined) {
57
- object[key] = config[key];
58
- }
59
- }
60
- }
61
- });
62
- }
1
+ import * as deepmerge from "deepmerge";
2
+ var expDm = deepmerge["default"];
3
+ export { expDm as deepmerge };
4
+ /**
5
+ * Is the provided string a URL?
6
+ *
7
+ * @param urlToCheck the url to inspect
8
+ */
9
+ export function isUrl(urlToCheck) {
10
+ if (urlToCheck.indexOf("http") === 0 || urlToCheck.indexOf("/") === 0 || urlToCheck.indexOf("./") === 0 || urlToCheck.indexOf("../") === 0) {
11
+ return true;
12
+ }
13
+ return false;
14
+ }
15
+ /**
16
+ * Convert a string from kebab-case to camelCase
17
+ * @param s string to convert
18
+ */
19
+ export function kebabToCamel(s) {
20
+ return s.replace(/(-\w)/g, function (m) {
21
+ return m[1].toUpperCase();
22
+ });
23
+ }
24
+ //https://gist.github.com/youssman/745578062609e8acac9f
25
+ /**
26
+ * Convert a string from camelCase to kebab-case
27
+ * @param str string to convert
28
+ */
29
+ export function camelToKebab(str) {
30
+ return !str
31
+ ? null
32
+ : str.replace(/([A-Z])/g, function (g) {
33
+ return "-" + g[0].toLowerCase();
34
+ });
35
+ }
36
+ /**
37
+ * This will extend an object with configuration values.
38
+ * What it practically does it take the keys from the configuration and set them on the object.
39
+ * If the configuration is a tree, it will traverse into the tree.
40
+ * @param object the object to extend
41
+ * @param config the configuration object that will extend the object
42
+ */
43
+ export function extendClassWithConfig(object, config) {
44
+ if (!config || typeof config !== "object") {
45
+ return;
46
+ }
47
+ Object.keys(config).forEach(function (key) {
48
+ if (key in object && typeof object[key] !== "function") {
49
+ // if (typeof object[key] === 'function') return;
50
+ // if it is an object, iterate internally until reaching basic types
51
+ // but null is an object so if its null and config[key] is not an object eg. number, the number should be set
52
+ if (typeof object[key] === "object" && (object[key] !== null || typeof config[key] === "object")) {
53
+ extendClassWithConfig(object[key], config[key]);
54
+ }
55
+ else {
56
+ if (config[key] !== undefined) {
57
+ object[key] = config[key];
58
+ }
59
+ }
60
+ }
61
+ });
62
+ }
63
63
  //# sourceMappingURL=index.js.map