@shapediver/viewer.shared.types 3.3.3 → 3.3.6

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 (78) hide show
  1. package/dist/implementation/data/GeometryData.d.ts.map +1 -1
  2. package/dist/implementation/data/GeometryData.js +1 -0
  3. package/dist/implementation/data/GeometryData.js.map +1 -1
  4. package/dist/index.d.ts +5 -4
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +4 -5
  7. package/dist/index.js.map +1 -1
  8. package/dist/interfaces/parameter/IDrawingParametersSettings.d.ts +121 -0
  9. package/dist/interfaces/parameter/IDrawingParametersSettings.d.ts.map +1 -0
  10. package/dist/interfaces/parameter/IDrawingParametersSettings.js +22 -0
  11. package/dist/interfaces/parameter/IDrawingParametersSettings.js.map +1 -0
  12. package/dist/interfaces/parameter/IDrawingToolsParametersSettings.d.ts +159 -0
  13. package/dist/interfaces/parameter/IDrawingToolsParametersSettings.d.ts.map +1 -0
  14. package/dist/interfaces/parameter/IDrawingToolsParametersSettings.js +29 -0
  15. package/dist/interfaces/parameter/IDrawingToolsParametersSettings.js.map +1 -0
  16. package/dist/interfaces/parameter/IGumballParameterSettings.d.ts +1 -5
  17. package/dist/interfaces/parameter/IGumballParameterSettings.d.ts.map +1 -1
  18. package/dist/interfaces/parameter/IGumballParameterSettings.js +0 -7
  19. package/dist/interfaces/parameter/IGumballParameterSettings.js.map +1 -1
  20. package/dist/interfaces/parameter/ISelectionParameterSettings.d.ts +1 -5
  21. package/dist/interfaces/parameter/ISelectionParameterSettings.d.ts.map +1 -1
  22. package/dist/interfaces/parameter/ISelectionParameterSettings.js +0 -7
  23. package/dist/interfaces/parameter/ISelectionParameterSettings.js.map +1 -1
  24. package/package.json +7 -8
  25. package/src/implementation/data/AnimationData.ts +0 -310
  26. package/src/implementation/data/BoneData.ts +0 -32
  27. package/src/implementation/data/CustomData.ts +0 -52
  28. package/src/implementation/data/GeometryData.ts +0 -426
  29. package/src/implementation/data/HTMLElementAnchorData.ts +0 -365
  30. package/src/implementation/material/AbstractMaterialData.ts +0 -268
  31. package/src/implementation/material/MapData.ts +0 -218
  32. package/src/implementation/material/MaterialBasicLineData.ts +0 -99
  33. package/src/implementation/material/MaterialGemData.ts +0 -310
  34. package/src/implementation/material/MaterialMultiPointData.ts +0 -659
  35. package/src/implementation/material/MaterialPointData.ts +0 -136
  36. package/src/implementation/material/MaterialShadowData.ts +0 -45
  37. package/src/implementation/material/MaterialSpecularGlossinessData.ts +0 -191
  38. package/src/implementation/material/MaterialStandardData.ts +0 -502
  39. package/src/implementation/material/MaterialUnlitData.ts +0 -122
  40. package/src/implementation/material/MaterialVariantsData.ts +0 -60
  41. package/src/implementation/sdtf/SDTFAttributesData.ts +0 -128
  42. package/src/implementation/sdtf/SDTFItemData.ts +0 -72
  43. package/src/implementation/sdtf/SDTFOverviewData.ts +0 -80
  44. package/src/index.ts +0 -141
  45. package/src/interfaces/data/IAnimationData.ts +0 -42
  46. package/src/interfaces/data/IBoneData.ts +0 -9
  47. package/src/interfaces/data/ICustomData.ts +0 -15
  48. package/src/interfaces/data/IGeometryData.ts +0 -87
  49. package/src/interfaces/data/IHTMLElementAnchorData.ts +0 -68
  50. package/src/interfaces/data/material/IMapData.ts +0 -64
  51. package/src/interfaces/data/material/IMaterialAbstractData.ts +0 -86
  52. package/src/interfaces/data/material/IMaterialBasicLineData.ts +0 -21
  53. package/src/interfaces/data/material/IMaterialGemDataProperties.ts +0 -46
  54. package/src/interfaces/data/material/IMaterialMultiPointData.ts +0 -72
  55. package/src/interfaces/data/material/IMaterialPointData.ts +0 -31
  56. package/src/interfaces/data/material/IMaterialShadowData.ts +0 -21
  57. package/src/interfaces/data/material/IMaterialSpecularGlossinessDataProperties.ts +0 -36
  58. package/src/interfaces/data/material/IMaterialStandardData.ts +0 -60
  59. package/src/interfaces/data/material/IMaterialUnlitData.ts +0 -30
  60. package/src/interfaces/data/material/IMaterialVariantsData.ts +0 -19
  61. package/src/interfaces/events/EventResponseMapping.ts +0 -53
  62. package/src/interfaces/events/ICameraEvent.ts +0 -16
  63. package/src/interfaces/events/IOutputEvent.ts +0 -29
  64. package/src/interfaces/events/IParameterEvent.ts +0 -21
  65. package/src/interfaces/events/IRenderingEvent.ts +0 -7
  66. package/src/interfaces/events/ISceneEvent.ts +0 -17
  67. package/src/interfaces/events/ISessionEvent.ts +0 -16
  68. package/src/interfaces/events/ITaskEvent.ts +0 -61
  69. package/src/interfaces/events/IViewportEvent.ts +0 -13
  70. package/src/interfaces/parameter/IGumballParameterSettings.ts +0 -44
  71. package/src/interfaces/parameter/IInteractionParameterSettings.ts +0 -85
  72. package/src/interfaces/parameter/ISelectionParameterSettings.ts +0 -37
  73. package/src/interfaces/sdtf/ISDTFAttributeVisualizationData.ts +0 -7
  74. package/src/interfaces/sdtf/ISDTFAttributesData.ts +0 -27
  75. package/src/interfaces/sdtf/ISDTFItemData.ts +0 -23
  76. package/src/interfaces/sdtf/ISDTFOverviewData.ts +0 -31
  77. package/src/types.ts +0 -68
  78. package/tsconfig.json +0 -17
@@ -1,61 +0,0 @@
1
- import { IEvent } from '@shapediver/viewer.shared.services';
2
-
3
- // #region Interfaces (1)
4
-
5
- /**
6
- * Definition of the task event.
7
- * These events are sent for task specific events ({@link EVENTTYPE_TASK}).
8
- */
9
- export interface ITaskEvent extends IEvent {
10
- // #region Properties (5)
11
-
12
- /**
13
- * The data of the task.
14
- */
15
- data?: unknown,
16
- /**
17
- * The id of the task.
18
- */
19
- id: string,
20
- /**
21
- * The progress of the task.
22
- */
23
- progress: number,
24
- /**
25
- * The status of the task.
26
- */
27
- status?: string
28
- /**
29
- * The type of the task.
30
- */
31
- type: TASK_TYPE,
32
-
33
- // #endregion Properties (5)
34
- }
35
-
36
- // #endregion Interfaces (1)
37
-
38
- // #region Enums (1)
39
-
40
- /**
41
- * Definition of the task types.
42
- * These types are used to identify the type of a task in a task event {@link ITaskEvent}.
43
- */
44
- export enum TASK_TYPE {
45
- AR_LOADING = 'ar_loading',
46
- ENVIRONMENT_MAP_LOADING = 'environment_map_loading',
47
- CUSTOM_CONTENT_LOADING = 'custom_content_loading',
48
- GLTF_CREATION = 'gltf_creation',
49
- GLTF_CONTENT_LOADING = 'gltf_content_loading',
50
- MATERIAL_CONTENT_LOADING = 'material_content_loading',
51
- TAG_CONTENT_LOADING = 'tag_content_loading',
52
- SDTF_CONTENT_LOADING = 'sdtf_content_loading',
53
- SESSION_CUSTOMIZATION = 'session_customization',
54
- SESSION_CREATION = 'session_creation',
55
- SESSION_OUTPUTS_UPDATE = 'session_outputs_update',
56
- SESSION_OUTPUTS_LOADING = 'session_outputs_loading',
57
- VIEWPORT_CREATION = 'viewer_creation',
58
- EXPORT_REQUEST = 'export_request',
59
- }
60
-
61
- // #endregion Enums (1)
@@ -1,13 +0,0 @@
1
- import { IEvent } from '@shapediver/viewer.shared.services';
2
-
3
- /**
4
- * Definition of the viewport event.
5
- * These events are sent for viewport specific events ({@link EVENTTYPE_VIEWPORT}).
6
- */
7
- export interface IViewportEvent extends IEvent {
8
- // #region Properties (1)
9
-
10
- viewportId: string,
11
-
12
- // #endregion Properties (1)
13
- }
@@ -1,44 +0,0 @@
1
- import { IInteractionParameterProps, IInteractionParameterSettings } from './IInteractionParameterSettings';
2
-
3
- // #region Type aliases (1)
4
-
5
- export type GumballParameterValue = {
6
- names: string[],
7
- transformations: number[][]
8
- };
9
-
10
- // #endregion Type aliases (1)
11
-
12
- // #region Interfaces (1)
13
-
14
- /**
15
- * Properties of a selection parameter.
16
- */
17
- export interface IGumballParameterProps extends IInteractionParameterProps {
18
- // #region Properties (5)
19
-
20
- /** If the rotation is enabled. (default: true) */
21
- enableRotation?: boolean,
22
- /** If the scaling is enabled. (default: false) */
23
- enableScaling?: boolean,
24
- /** If the translation is enabled. (default: true) */
25
- enableTranslation?: boolean,
26
- /** The scale of the controls. The scale divides the scene bounding sphere to get the actual size. (default: 0.005) */
27
- scale?: number,
28
- /** The space in which the controls operate. In world space, scaling is not available. (default: 'local') */
29
- space?: 'local' | 'world',
30
- /** The color of the objects when selected. (default: '#0d44f0') */
31
- selectionColor?: string,
32
-
33
- // #endregion Properties (5)
34
- }
35
-
36
- // #endregion Interfaces (1)
37
-
38
- // #region Functions (1)
39
-
40
- export function isInteractionGumballParameterSettings(def?: IInteractionParameterSettings): def is { type: 'gumball', props: IGumballParameterProps } {
41
- return def?.type === 'gumball';
42
- }
43
-
44
- // #endregion Functions (1)
@@ -1,85 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- // #region Type aliases (1)
4
-
5
- export type InteractionParameterSettingsType = 'selection' | 'gumball';
6
-
7
- // #endregion Type aliases (1)
8
-
9
- // #region Interfaces (2)
10
-
11
- /**
12
- * General properties of an interaction parameter.
13
- */
14
- export interface IInteractionParameterProps {
15
- // #region Properties (2)
16
-
17
- /** If the objects are hoverable. (default: true) */
18
- hover?: boolean,
19
- /** The color of the objects when hovered. (default: '#00ff78') */
20
- hoverColor?: string,
21
- /** The names of the objects that can be interacted with. (see Jira document and discussion result) */
22
- nameFilter?: string[]
23
-
24
- // #endregion Properties (2)
25
- }
26
-
27
- /**
28
- * The definition of an interaction parameter.
29
- *
30
- * For each type, there is a corresponding set of properties.
31
- */
32
- export interface IInteractionParameterSettings {
33
- // #region Properties (2)
34
-
35
- /** Properties of the parameter definition. */
36
- props: IInteractionParameterProps,
37
- /** Type of the interaction parameters. */
38
- type: InteractionParameterSettingsType,
39
-
40
- // #endregion Properties (2)
41
- }
42
-
43
- // #endregion Interfaces (2)
44
-
45
- // #region Variables (7)
46
-
47
- const IGeneralInteractionParameterJsonSchema = z.object({
48
- hover: z.boolean().optional(),
49
- hoverColor: z.string().optional(),
50
- nameFilter: z.array(z.string()).optional(),
51
- });
52
-
53
- export const ISelectionParameterJsonSchema = z.object({
54
- type: z.literal('selection'),
55
- props: z.object({
56
- maximumSelection: z.number().optional(),
57
- minimumSelection: z.number().optional(),
58
- selectionColor: z.string().optional(),
59
- }).merge(IGeneralInteractionParameterJsonSchema),
60
- });
61
- export const IGumballParameterJsonSchema = z.object({
62
- type: z.literal('gumball'),
63
- props: z.object({
64
- enableRotation: z.boolean().optional(),
65
- enableScaling: z.boolean().optional(),
66
- enableTranslation: z.boolean().optional(),
67
- scale: z.number().optional(),
68
- space: z.literal('local').or(z.literal('world')).optional(),
69
- selectionColor: z.string().optional(),
70
- }).merge(IGeneralInteractionParameterJsonSchema),
71
- });
72
-
73
- export const IInteractionParameterJsonSchema = ISelectionParameterJsonSchema.or(IGumballParameterJsonSchema);
74
-
75
- export const validateInteractionParameterSettings = (param: unknown) => {
76
- return IInteractionParameterJsonSchema.safeParse(param);
77
- };
78
- export const validateSelectionParameterSettings = (param: unknown) => {
79
- return ISelectionParameterJsonSchema.safeParse(param);
80
- };
81
- export const validateGumballParameterSettings = (param: unknown) => {
82
- return IGumballParameterJsonSchema.safeParse(param);
83
- };
84
-
85
- // #endregion Variables (7)
@@ -1,37 +0,0 @@
1
- import { IInteractionParameterProps, IInteractionParameterSettings } from './IInteractionParameterSettings';
2
-
3
- // #region Type aliases (1)
4
-
5
- export type SelectionParameterValue = {
6
- names: string[]
7
- };
8
-
9
- // #endregion Type aliases (1)
10
-
11
- // #region Interfaces (1)
12
-
13
- /**
14
- * Properties of a selection parameter.
15
- */
16
- export interface ISelectionParameterProps extends IInteractionParameterProps {
17
- // #region Properties (2)
18
-
19
- /** The maximum number of objects that can be selected. (default: 1) */
20
- maximumSelection?: number,
21
- /** The minimum number of objects that can be selected. (default: 1) */
22
- minimumSelection?: number,
23
- /** The color of the objects when selected. (default: '#0d44f0') */
24
- selectionColor?: string,
25
-
26
- // #endregion Properties (2)
27
- }
28
-
29
- // #endregion Interfaces (1)
30
-
31
- // #region Functions (1)
32
-
33
- export function isInteractionSelectionParameterSettings(def?: IInteractionParameterSettings): def is { type: 'selection', props: ISelectionParameterProps } {
34
- return def?.type === 'selection';
35
- }
36
-
37
- // #endregion Functions (1)
@@ -1,7 +0,0 @@
1
- import { mat4 } from "gl-matrix";
2
- import { IMaterialAbstractData } from "../data/material/IMaterialAbstractData";
3
-
4
- export interface ISDTFAttributeVisualizationData {
5
- material: IMaterialAbstractData,
6
- matrix: mat4
7
- }
@@ -1,27 +0,0 @@
1
- import { ITreeNodeData } from "@shapediver/viewer.shared.node-tree";
2
- import { SdtfTypeHintName } from '@shapediver/sdk.sdtf-v1'
3
-
4
- export interface ISDTFAttributeData {
5
- // #region Properties (2)
6
-
7
- readonly typeHint: SdtfTypeHintName | string;
8
- readonly value: any;
9
-
10
- // #endregion Properties (2)
11
- }
12
-
13
- export interface ISDTFAttributesData extends ITreeNodeData {
14
- // #region Properties (1)
15
-
16
- readonly attributes: {
17
- [key: string]: ISDTFAttributeData
18
- };
19
-
20
- // #endregion Properties (1)
21
-
22
- // #region Public Methods (1)
23
-
24
- clone(): ISDTFAttributesData;
25
-
26
- // #endregion Public Methods (1)
27
- }
@@ -1,23 +0,0 @@
1
- import { ITreeNodeData } from "@shapediver/viewer.shared.node-tree";
2
- import { ISDTFAttributeData } from "./ISDTFAttributesData";
3
- import { SdtfTypeHintName } from '@shapediver/sdk.sdtf-v1'
4
-
5
- export interface ISDTFItemData extends ITreeNodeData {
6
- // #region Properties (3)
7
-
8
- readonly attributes: {
9
- [key: string]: ISDTFAttributeData
10
- }
11
-
12
- readonly typeHint: SdtfTypeHintName | string
13
- readonly value: any;
14
-
15
- // #endregion Properties (3)
16
-
17
- // #region Public Methods (1)
18
-
19
- clone(): ISDTFItemData;
20
-
21
- // #endregion Public Methods (1)
22
- }
23
-
@@ -1,31 +0,0 @@
1
- import { ITreeNodeData } from "@shapediver/viewer.shared.node-tree";
2
- import { SdtfTypeHintName } from '@shapediver/sdk.sdtf-v1'
3
-
4
- export interface ISDTFOverview {
5
- // #region Public Indexers (1)
6
-
7
- [key: string]: {
8
- typeHint: SdtfTypeHintName | string;
9
- count: number;
10
- values?: string[];
11
- min?: number;
12
- max?: number;
13
- }[];
14
-
15
- // #endregion Public Indexers (1)
16
- };
17
-
18
- export interface ISDTFOverviewData extends ITreeNodeData {
19
- // #region Properties (1)
20
-
21
- readonly overview: ISDTFOverview;
22
-
23
- // #endregion Properties (1)
24
-
25
- // #region Public Methods (2)
26
-
27
- clone(): ISDTFOverviewData;
28
- merge(data: ISDTFOverviewData): void;
29
-
30
- // #endregion Public Methods (2)
31
- }
package/src/types.ts DELETED
@@ -1,68 +0,0 @@
1
- import { ShapeDiverResponseParameterType, ShapeDiverResponseParameterVisualization } from '@shapediver/sdk.geometry-api-sdk-v2';
2
- import { vec3, vec4 } from 'gl-matrix';
3
-
4
- export type Color = string | number | number[] | vec3 | vec4;
5
-
6
- /**
7
- * The type of the parameter.
8
- */
9
- export {
10
- ShapeDiverResponseParameterType as PARAMETER_TYPE,
11
- ShapeDiverResponseParameterVisualization as PARAMETER_VISUALIZATION
12
- };
13
-
14
- export interface ISettingsSections {
15
- // #region Properties (2)
16
-
17
- session?: ISessionSettingsSections,
18
- viewport?: IViewportSettingsSections
19
-
20
- // #endregion Properties (2)
21
- }
22
-
23
- export interface ISessionSettingsSections {
24
- // #region Properties (2)
25
-
26
- export?: {
27
- /** Option to update the displayname of the exports (default: false) */
28
- displayname?: boolean,
29
- /** Option to update the order of the exports (default: false) */
30
- order?: boolean,
31
- /** Option to update the hidden state of the exports (default: false) */
32
- hidden?: boolean
33
- }
34
-
35
- parameter?: {
36
- /** Option to update the displayname of the parameters (default: false) */
37
- displayname?: boolean,
38
- /** Option to update the order of the parameters (default: false) */
39
- order?: boolean,
40
- /** Option to update the hidden state of the parameters (default: false) */
41
- hidden?: boolean,
42
- /** Option to update the value of the parameters (default: false) */
43
- value?: boolean
44
- },
45
-
46
- // #endregion Properties (2)
47
- }
48
-
49
- export interface IViewportSettingsSections {
50
- // #region Properties (7)
51
-
52
- /** Option to update the ar settings (default: false) */
53
- ar?: boolean,
54
- /** Option to update the camera settings (default: false) */
55
- camera?: boolean,
56
- /** Option to update the environment settings (default: false) */
57
- environment?: boolean
58
- /** Option to update the general settings (default: false) */
59
- general?: boolean
60
- /** Option to update the light settings (default: false) */
61
- light?: boolean,
62
- /** Option to update the postprocessing settings (default: false) */
63
- postprocessing?: boolean
64
- /** Option to update the scene settings (default: false) */
65
- scene?: boolean,
66
-
67
- // #endregion Properties (7)
68
- }
package/tsconfig.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "extends": "../../tsconfig.json",
3
- "include": [
4
- "./**/*.ts"
5
- ],
6
- "compilerOptions": {
7
- "rootDir": "src",
8
- "outDir": "dist"
9
- },
10
- "exclude": [
11
- "__tests__",
12
- "node_modules",
13
- "dist",
14
- "dist-dev",
15
- "dist-prod"
16
- ]
17
- }