@shapediver/viewer.shared.types 3.1.2 → 3.2.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.ts +6 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/interfaces/parameter/IGumballParameterSettings.d.ts +27 -0
- package/dist/interfaces/parameter/IGumballParameterSettings.d.ts.map +1 -0
- package/dist/interfaces/parameter/IGumballParameterSettings.js +11 -0
- package/dist/interfaces/parameter/IGumballParameterSettings.js.map +1 -0
- package/dist/interfaces/parameter/IInteractionParameterSettings.d.ts +335 -0
- package/dist/interfaces/parameter/IInteractionParameterSettings.d.ts.map +1 -0
- package/dist/interfaces/parameter/IInteractionParameterSettings.js +45 -0
- package/dist/interfaces/parameter/IInteractionParameterSettings.js.map +1 -0
- package/dist/interfaces/parameter/ISelectionParameterSettings.d.ts +20 -0
- package/dist/interfaces/parameter/ISelectionParameterSettings.d.ts.map +1 -0
- package/dist/interfaces/parameter/ISelectionParameterSettings.js +11 -0
- package/dist/interfaces/parameter/ISelectionParameterSettings.js.map +1 -0
- package/package.json +9 -8
- package/src/index.ts +15 -6
- package/src/interfaces/parameter/IGumballParameterSettings.ts +44 -0
- package/src/interfaces/parameter/IInteractionParameterSettings.ts +87 -0
- package/src/interfaces/parameter/ISelectionParameterSettings.ts +37 -0
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { IAttributeData, IGeometryData, IPrimitiveData, PRIMITIVE_MODE } from '.
|
|
|
12
12
|
import { IBoneData } from './interfaces/data/IBoneData';
|
|
13
13
|
import { ICameraEvent } from './interfaces/events/ICameraEvent';
|
|
14
14
|
import { ICustomData } from './interfaces/data/ICustomData';
|
|
15
|
+
import { IGeneralInteractionParameterSettings, IGumballParameterJsonSchema, IInteractionParameterJsonSchema, IInteractionParameterSettings, InteractionParameterSettingsType, ISelectionParameterJsonSchema, validateGumballParameterSettings, validateInteractionParameterSettings, validateSelectionParameterSettings } from './interfaces/parameter/IInteractionParameterSettings';
|
|
15
16
|
import { IMapData, TEXTURE_FILTERING, TEXTURE_WRAPPING } from './interfaces/data/material/IMapData';
|
|
16
17
|
import { IMaterialAbstractData, IMaterialAbstractDataProperties, MATERIAL_ALPHA, MATERIAL_SHADING, MATERIAL_SIDE, MATERIAL_TYPE } from './interfaces/data/material/IMaterialAbstractData';
|
|
17
18
|
import { IMaterialBasicLineData, IMaterialBasicLineDataProperties } from './interfaces/data/material/IMaterialBasicLineData';
|
|
@@ -24,11 +25,14 @@ import { IMaterialStandardData, IMaterialStandardDataProperties } from './interf
|
|
|
24
25
|
import { IMaterialUnlitData, IMaterialUnlitDataProperties } from './interfaces/data/material/IMaterialUnlitData';
|
|
25
26
|
import { IMaterialVariantsData } from './interfaces/data/material/IMaterialVariantsData';
|
|
26
27
|
import { IOutputEvent } from './interfaces/events/IOutputEvent';
|
|
28
|
+
import { IParameterEvent } from './interfaces/events/IParameterEvent';
|
|
29
|
+
import { IRenderingEvent } from './interfaces/events/IRenderingEvent';
|
|
27
30
|
import { ISceneEvent } from './interfaces/events/ISceneEvent';
|
|
28
31
|
import { ISDTFAttributeData, ISDTFAttributesData } from './interfaces/sdtf/ISDTFAttributesData';
|
|
29
32
|
import { ISDTFAttributeVisualizationData } from './interfaces/sdtf/ISDTFAttributeVisualizationData';
|
|
30
33
|
import { ISDTFItemData } from './interfaces/sdtf/ISDTFItemData';
|
|
31
34
|
import { ISDTFOverview, ISDTFOverviewData } from './interfaces/sdtf/ISDTFOverviewData';
|
|
35
|
+
import { ISelectionParameterSettings, isInteractionSelectionParameterSettings, SelectionParameterValue } from './interfaces/parameter/ISelectionParameterSettings';
|
|
32
36
|
import { ISessionEvent } from './interfaces/events/ISessionEvent';
|
|
33
37
|
import { ITaskEvent, TASK_TYPE } from './interfaces/events/ITaskEvent';
|
|
34
38
|
import { IViewportEvent } from './interfaces/events/IViewportEvent';
|
|
@@ -47,8 +51,7 @@ import { SDTFOverviewData } from './implementation/sdtf/SDTFOverviewData';
|
|
|
47
51
|
import { SdtfPrimitiveTypeGuard } from '@shapediver/sdk.sdtf-primitives';
|
|
48
52
|
import { SdtfTypeHintName } from '@shapediver/sdk.sdtf-v1';
|
|
49
53
|
import { MaterialStandardData } from './implementation/material/MaterialStandardData';
|
|
50
|
-
import {
|
|
51
|
-
import { IParameterEvent } from './interfaces/events/IParameterEvent';
|
|
54
|
+
import { IGumballParameterSettings, GumballParameterValue, isInteractionGumballParameterSettings } from './interfaces/parameter/IGumballParameterSettings';
|
|
52
55
|
export { IMaterialStandardData, MaterialStandardData, IMaterialStandardDataProperties, IMaterialAbstractData, IMaterialAbstractDataProperties, AbstractMaterialData, IMaterialUnlitData, MaterialUnlitData, IMaterialUnlitDataProperties, IMaterialShadowData, MaterialShadowData, IMaterialShadowDataProperties, IMaterialSpecularGlossinessData, MaterialSpecularGlossinessData, IMaterialSpecularGlossinessDataProperties, IMaterialGemData, MaterialGemData, IMaterialGemDataProperties, IMaterialPointData, MaterialPointData, IMaterialPointDataProperties, IMaterialMultiPointData, MaterialMultiPointData, IMaterialMultiPointDataProperties, IMaterialBasicLineData, MaterialBasicLineData, IMaterialBasicLineDataProperties, IMapData, MapData, MATERIAL_SIDE, MATERIAL_ALPHA, MATERIAL_SHADING, MATERIAL_TYPE, TEXTURE_WRAPPING, TEXTURE_FILTERING };
|
|
53
56
|
export { IAnimationData, AnimationData, IAnimationTrack, IGeometryData, IAttributeData, IPrimitiveData, IMaterialVariantsData, GeometryData, AttributeData, PrimitiveData, MaterialVariantsData, PRIMITIVE_MODE };
|
|
54
57
|
export { IAnchorDataImage, IAnchorDataText, IHTMLElementAnchorData, HTMLElementAnchorCustomData, HTMLElementAnchorTextData, HTMLElementAnchorImageData, HTMLElementAnchorData };
|
|
@@ -56,4 +59,5 @@ export { ICustomData, CustomData, IBoneData, BoneData };
|
|
|
56
59
|
export { EventResponseMapping, IViewportEvent, ISessionEvent, IOutputEvent, ICameraEvent, IRenderingEvent, IParameterEvent, ISceneEvent, ITaskEvent, TASK_TYPE };
|
|
57
60
|
export { ISDTFOverviewData, SDTFOverviewData, ISDTFOverview, SDTFAttributesData, ISDTFAttributesData, ISDTFAttributeData, SDTFAttributeData, SDTFItemData, ISDTFItemData, ISDTFAttributeVisualizationData, SdtfTypeHintName as SDTF_TYPEHINT, SdtfPrimitiveTypeGuard };
|
|
58
61
|
export { Color, PARAMETER_TYPE, PARAMETER_VISUALIZATION, ISettingsSections, ISessionSettingsSections, IViewportSettingsSections };
|
|
62
|
+
export { InteractionParameterSettingsType, IGeneralInteractionParameterSettings, IInteractionParameterSettings, IInteractionParameterJsonSchema, validateInteractionParameterSettings, ISelectionParameterSettings, SelectionParameterValue, isInteractionSelectionParameterSettings, ISelectionParameterJsonSchema, validateSelectionParameterSettings, IGumballParameterSettings, GumballParameterValue, isInteractionGumballParameterSettings, IGumballParameterJsonSchema, validateGumballParameterSettings };
|
|
59
63
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EACL,KAAK,EACL,wBAAwB,EACxB,iBAAiB,EACjB,yBAAyB,EACzB,cAAc,EACd,uBAAuB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gDAAgD,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,MAA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EAAE,gCAAgC,EACvJ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PARAMETER_VISUALIZATION = exports.PARAMETER_TYPE = exports.SdtfPrimitiveTypeGuard = exports.SDTF_TYPEHINT = exports.SDTFItemData = exports.SDTFAttributeData = exports.SDTFAttributesData = exports.SDTFOverviewData = exports.TASK_TYPE = exports.BoneData = exports.CustomData = exports.HTMLElementAnchorData = exports.HTMLElementAnchorImageData = exports.HTMLElementAnchorTextData = exports.HTMLElementAnchorCustomData = exports.PRIMITIVE_MODE = exports.MaterialVariantsData = exports.PrimitiveData = exports.AttributeData = exports.GeometryData = exports.AnimationData = exports.TEXTURE_FILTERING = exports.TEXTURE_WRAPPING = exports.MATERIAL_TYPE = exports.MATERIAL_SHADING = exports.MATERIAL_ALPHA = exports.MATERIAL_SIDE = exports.MapData = exports.MaterialBasicLineData = exports.MaterialMultiPointData = exports.MaterialPointData = exports.MaterialGemData = exports.MaterialSpecularGlossinessData = exports.MaterialShadowData = exports.MaterialUnlitData = exports.AbstractMaterialData = exports.MaterialStandardData = void 0;
|
|
3
|
+
exports.validateGumballParameterSettings = exports.IGumballParameterJsonSchema = exports.isInteractionGumballParameterSettings = exports.validateSelectionParameterSettings = exports.ISelectionParameterJsonSchema = exports.isInteractionSelectionParameterSettings = exports.validateInteractionParameterSettings = exports.IInteractionParameterJsonSchema = exports.PARAMETER_VISUALIZATION = exports.PARAMETER_TYPE = exports.SdtfPrimitiveTypeGuard = exports.SDTF_TYPEHINT = exports.SDTFItemData = exports.SDTFAttributeData = exports.SDTFAttributesData = exports.SDTFOverviewData = exports.TASK_TYPE = exports.BoneData = exports.CustomData = exports.HTMLElementAnchorData = exports.HTMLElementAnchorImageData = exports.HTMLElementAnchorTextData = exports.HTMLElementAnchorCustomData = exports.PRIMITIVE_MODE = exports.MaterialVariantsData = exports.PrimitiveData = exports.AttributeData = exports.GeometryData = exports.AnimationData = exports.TEXTURE_FILTERING = exports.TEXTURE_WRAPPING = exports.MATERIAL_TYPE = exports.MATERIAL_SHADING = exports.MATERIAL_ALPHA = exports.MATERIAL_SIDE = exports.MapData = exports.MaterialBasicLineData = exports.MaterialMultiPointData = exports.MaterialPointData = exports.MaterialGemData = exports.MaterialSpecularGlossinessData = exports.MaterialShadowData = exports.MaterialUnlitData = exports.AbstractMaterialData = exports.MaterialStandardData = void 0;
|
|
4
4
|
const AbstractMaterialData_1 = require("./implementation/material/AbstractMaterialData");
|
|
5
5
|
Object.defineProperty(exports, "AbstractMaterialData", { enumerable: true, get: function () { return AbstractMaterialData_1.AbstractMaterialData; } });
|
|
6
6
|
const AnimationData_1 = require("./implementation/data/AnimationData");
|
|
@@ -23,6 +23,13 @@ Object.defineProperty(exports, "HTMLElementAnchorImageData", { enumerable: true,
|
|
|
23
23
|
Object.defineProperty(exports, "HTMLElementAnchorTextData", { enumerable: true, get: function () { return HTMLElementAnchorData_1.HTMLElementAnchorTextData; } });
|
|
24
24
|
const IGeometryData_1 = require("./interfaces/data/IGeometryData");
|
|
25
25
|
Object.defineProperty(exports, "PRIMITIVE_MODE", { enumerable: true, get: function () { return IGeometryData_1.PRIMITIVE_MODE; } });
|
|
26
|
+
const IInteractionParameterSettings_1 = require("./interfaces/parameter/IInteractionParameterSettings");
|
|
27
|
+
Object.defineProperty(exports, "IGumballParameterJsonSchema", { enumerable: true, get: function () { return IInteractionParameterSettings_1.IGumballParameterJsonSchema; } });
|
|
28
|
+
Object.defineProperty(exports, "IInteractionParameterJsonSchema", { enumerable: true, get: function () { return IInteractionParameterSettings_1.IInteractionParameterJsonSchema; } });
|
|
29
|
+
Object.defineProperty(exports, "ISelectionParameterJsonSchema", { enumerable: true, get: function () { return IInteractionParameterSettings_1.ISelectionParameterJsonSchema; } });
|
|
30
|
+
Object.defineProperty(exports, "validateGumballParameterSettings", { enumerable: true, get: function () { return IInteractionParameterSettings_1.validateGumballParameterSettings; } });
|
|
31
|
+
Object.defineProperty(exports, "validateInteractionParameterSettings", { enumerable: true, get: function () { return IInteractionParameterSettings_1.validateInteractionParameterSettings; } });
|
|
32
|
+
Object.defineProperty(exports, "validateSelectionParameterSettings", { enumerable: true, get: function () { return IInteractionParameterSettings_1.validateSelectionParameterSettings; } });
|
|
26
33
|
const IMapData_1 = require("./interfaces/data/material/IMapData");
|
|
27
34
|
Object.defineProperty(exports, "TEXTURE_FILTERING", { enumerable: true, get: function () { return IMapData_1.TEXTURE_FILTERING; } });
|
|
28
35
|
Object.defineProperty(exports, "TEXTURE_WRAPPING", { enumerable: true, get: function () { return IMapData_1.TEXTURE_WRAPPING; } });
|
|
@@ -31,6 +38,8 @@ Object.defineProperty(exports, "MATERIAL_ALPHA", { enumerable: true, get: functi
|
|
|
31
38
|
Object.defineProperty(exports, "MATERIAL_SHADING", { enumerable: true, get: function () { return IMaterialAbstractData_1.MATERIAL_SHADING; } });
|
|
32
39
|
Object.defineProperty(exports, "MATERIAL_SIDE", { enumerable: true, get: function () { return IMaterialAbstractData_1.MATERIAL_SIDE; } });
|
|
33
40
|
Object.defineProperty(exports, "MATERIAL_TYPE", { enumerable: true, get: function () { return IMaterialAbstractData_1.MATERIAL_TYPE; } });
|
|
41
|
+
const ISelectionParameterSettings_1 = require("./interfaces/parameter/ISelectionParameterSettings");
|
|
42
|
+
Object.defineProperty(exports, "isInteractionSelectionParameterSettings", { enumerable: true, get: function () { return ISelectionParameterSettings_1.isInteractionSelectionParameterSettings; } });
|
|
34
43
|
const ITaskEvent_1 = require("./interfaces/events/ITaskEvent");
|
|
35
44
|
Object.defineProperty(exports, "TASK_TYPE", { enumerable: true, get: function () { return ITaskEvent_1.TASK_TYPE; } });
|
|
36
45
|
const MapData_1 = require("./implementation/material/MapData");
|
|
@@ -64,4 +73,6 @@ const sdk_sdtf_v1_1 = require("@shapediver/sdk.sdtf-v1");
|
|
|
64
73
|
Object.defineProperty(exports, "SDTF_TYPEHINT", { enumerable: true, get: function () { return sdk_sdtf_v1_1.SdtfTypeHintName; } });
|
|
65
74
|
const MaterialStandardData_1 = require("./implementation/material/MaterialStandardData");
|
|
66
75
|
Object.defineProperty(exports, "MaterialStandardData", { enumerable: true, get: function () { return MaterialStandardData_1.MaterialStandardData; } });
|
|
76
|
+
const IGumballParameterSettings_1 = require("./interfaces/parameter/IGumballParameterSettings");
|
|
77
|
+
Object.defineProperty(exports, "isInteractionGumballParameterSettings", { enumerable: true, get: function () { return IGumballParameterSettings_1.isInteractionGumballParameterSettings; } });
|
|
67
78
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yFAAsF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yFAAsF;AAmF5B,qGAnFjD,2CAAoB,OAmFiD;AAlF9E,uEAAoE;AA8FlD,8FA9FT,6BAAa,OA8FS;AA7F/B,qEAAgG;AA6FsC,8FA7F7H,4BAAa,OA6F6H;AAA3B,6FA7FhG,2BAAY,OA6FgG;AAAiB,8FA7F/G,4BAAa,OA6F+G;AA5FlK,6DAA0D;AAoGpB,yFApG7B,mBAAQ,OAoG6B;AAnG9C,mCAOmB;AAyGV,+FA3GP,sBAAc,OA2GO;AAAE,wGA1GvB,+BAAuB,OA0GuB;AAxGhD,iEAA8D;AA2F/C,2FA3FN,uBAAU,OA2FM;AAzFzB,uFAKuD;AAgFM,4GApF3D,mDAA2B,OAoF2D;AAAyD,sGAnF/I,6CAAqB,OAmF+I;AAAjD,2GAlFnH,kDAA0B,OAkFmH;AAArD,0GAjFxF,iDAAyB,OAiFwF;AA7EnH,mEAK2C;AAoE+I,+FArExL,8BAAc,OAqEwL;AAhExM,wGAAsX;AA2F3R,4GA3F5C,2DAA2B,OA2F4C;AAFb,gHAzF7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/B,qGALvB,2CAAoB,OAKuB;AAH7C,gGAA2J;AA2CvG,sHA3CO,iEAAqC,OA2CP"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IGeneralInteractionParameterSettings, IInteractionParameterSettings } from './IInteractionParameterSettings';
|
|
2
|
+
export declare type GumballParameterValue = {
|
|
3
|
+
names: string[];
|
|
4
|
+
transformations: number[][];
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Properties of a selection parameter.
|
|
8
|
+
*/
|
|
9
|
+
export interface IGumballParameterSettings extends IGeneralInteractionParameterSettings {
|
|
10
|
+
/** If the rotation is enabled. (default: true) */
|
|
11
|
+
enableRotation?: boolean;
|
|
12
|
+
/** If the scaling is enabled. (default: false) */
|
|
13
|
+
enableScaling?: boolean;
|
|
14
|
+
/** If the translation is enabled. (default: true) */
|
|
15
|
+
enableTranslation?: boolean;
|
|
16
|
+
/** The scale of the controls. The scale divides the scene bounding sphere to get the actual size. (default: 0.005) */
|
|
17
|
+
scale?: number;
|
|
18
|
+
/** The space in which the controls operate. In world space, scaling is not available. (default: 'local') */
|
|
19
|
+
space?: 'local' | 'world';
|
|
20
|
+
/** The color of the objects when selected. (default: '#0d44f0') */
|
|
21
|
+
selectionColor?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function isInteractionGumballParameterSettings(def?: IInteractionParameterSettings): def is {
|
|
24
|
+
type: 'gumball';
|
|
25
|
+
props: IGumballParameterSettings;
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=IGumballParameterSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IGumballParameterSettings.d.ts","sourceRoot":"","sources":["../../../src/interfaces/parameter/IGumballParameterSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAItH,oBAAY,qBAAqB,GAAG;IAChC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,eAAe,EAAE,MAAM,EAAE,EAAE,CAAA;CAC9B,CAAC;AAMF;;GAEG;AACH,MAAM,WAAW,yBAA0B,SAAQ,oCAAoC;IAGnF,kDAAkD;IAClD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kDAAkD;IAClD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qDAAqD;IACrD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,sHAAsH;IACtH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4GAA4G;IAC5G,KAAK,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC1B,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAC;CAG3B;AAMD,wBAAgB,qCAAqC,CAAC,GAAG,CAAC,EAAE,6BAA6B,GAAG,GAAG,IAAI;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,yBAAyB,CAAA;CAAE,CAEvJ"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isInteractionGumballParameterSettings = void 0;
|
|
4
|
+
// #endregion Interfaces (1)
|
|
5
|
+
// #region Functions (1)
|
|
6
|
+
function isInteractionGumballParameterSettings(def) {
|
|
7
|
+
return (def === null || def === void 0 ? void 0 : def.type) === 'gumball';
|
|
8
|
+
}
|
|
9
|
+
exports.isInteractionGumballParameterSettings = isInteractionGumballParameterSettings;
|
|
10
|
+
// #endregion Functions (1)
|
|
11
|
+
//# sourceMappingURL=IGumballParameterSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IGumballParameterSettings.js","sourceRoot":"","sources":["../../../src/interfaces/parameter/IGumballParameterSettings.ts"],"names":[],"mappings":";;;AAmCA,4BAA4B;AAE5B,wBAAwB;AAExB,SAAgB,qCAAqC,CAAC,GAAmC;IACrF,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,MAAK,SAAS,CAAC;AACnC,CAAC;AAFD,sFAEC;AAED,2BAA2B"}
|
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ISelectionParameterSettings } from './ISelectionParameterSettings';
|
|
3
|
+
import { IGumballParameterSettings } from './IGumballParameterSettings';
|
|
4
|
+
export declare type InteractionParameterSettingsType = 'selection' | 'gumball';
|
|
5
|
+
/**
|
|
6
|
+
* General properties of an interaction parameter.
|
|
7
|
+
*/
|
|
8
|
+
export interface IGeneralInteractionParameterSettings {
|
|
9
|
+
/** If the objects are hoverable. (default: true) */
|
|
10
|
+
hover?: boolean;
|
|
11
|
+
/** The color of the objects when hovered. (default: '#00ff78') */
|
|
12
|
+
hoverColor?: string;
|
|
13
|
+
/** The names of the objects that can be interacted with. (see Jira document and discussion result) */
|
|
14
|
+
nameFilter?: string[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The definition of an interaction parameter.
|
|
18
|
+
*
|
|
19
|
+
* For each type, there is a corresponding set of properties.
|
|
20
|
+
*/
|
|
21
|
+
export interface IInteractionParameterSettings {
|
|
22
|
+
/** Properties of the parameter definition. */
|
|
23
|
+
props: ISelectionParameterSettings | IGumballParameterSettings;
|
|
24
|
+
/** Type of the interaction parameters. */
|
|
25
|
+
type: InteractionParameterSettingsType;
|
|
26
|
+
}
|
|
27
|
+
export declare const ISelectionParameterJsonSchema: z.ZodObject<{
|
|
28
|
+
type: z.ZodLiteral<"selection">;
|
|
29
|
+
props: z.ZodObject<z.objectUtil.extendShape<{
|
|
30
|
+
maximumSelection: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
minimumSelection: z.ZodOptional<z.ZodNumber>;
|
|
32
|
+
selectionColor: z.ZodOptional<z.ZodString>;
|
|
33
|
+
}, {
|
|
34
|
+
hover: z.ZodOptional<z.ZodBoolean>;
|
|
35
|
+
hoverColor: z.ZodOptional<z.ZodString>;
|
|
36
|
+
nameFilter: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
37
|
+
}>, "strip", z.ZodTypeAny, {
|
|
38
|
+
maximumSelection?: number | undefined;
|
|
39
|
+
minimumSelection?: number | undefined;
|
|
40
|
+
selectionColor?: string | undefined;
|
|
41
|
+
hover?: boolean | undefined;
|
|
42
|
+
hoverColor?: string | undefined;
|
|
43
|
+
nameFilter?: string[] | undefined;
|
|
44
|
+
}, {
|
|
45
|
+
maximumSelection?: number | undefined;
|
|
46
|
+
minimumSelection?: number | undefined;
|
|
47
|
+
selectionColor?: string | undefined;
|
|
48
|
+
hover?: boolean | undefined;
|
|
49
|
+
hoverColor?: string | undefined;
|
|
50
|
+
nameFilter?: string[] | undefined;
|
|
51
|
+
}>;
|
|
52
|
+
}, "strip", z.ZodTypeAny, {
|
|
53
|
+
type: "selection";
|
|
54
|
+
props: {
|
|
55
|
+
maximumSelection?: number | undefined;
|
|
56
|
+
minimumSelection?: number | undefined;
|
|
57
|
+
selectionColor?: string | undefined;
|
|
58
|
+
hover?: boolean | undefined;
|
|
59
|
+
hoverColor?: string | undefined;
|
|
60
|
+
nameFilter?: string[] | undefined;
|
|
61
|
+
};
|
|
62
|
+
}, {
|
|
63
|
+
type: "selection";
|
|
64
|
+
props: {
|
|
65
|
+
maximumSelection?: number | undefined;
|
|
66
|
+
minimumSelection?: number | undefined;
|
|
67
|
+
selectionColor?: string | undefined;
|
|
68
|
+
hover?: boolean | undefined;
|
|
69
|
+
hoverColor?: string | undefined;
|
|
70
|
+
nameFilter?: string[] | undefined;
|
|
71
|
+
};
|
|
72
|
+
}>;
|
|
73
|
+
export declare const IGumballParameterJsonSchema: z.ZodObject<{
|
|
74
|
+
type: z.ZodLiteral<"gumball">;
|
|
75
|
+
props: z.ZodObject<z.objectUtil.extendShape<{
|
|
76
|
+
enableRotation: z.ZodOptional<z.ZodBoolean>;
|
|
77
|
+
enableScaling: z.ZodOptional<z.ZodBoolean>;
|
|
78
|
+
enableTranslation: z.ZodOptional<z.ZodBoolean>;
|
|
79
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
space: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"local">, z.ZodLiteral<"world">]>>;
|
|
81
|
+
selectionColor: z.ZodOptional<z.ZodString>;
|
|
82
|
+
}, {
|
|
83
|
+
hover: z.ZodOptional<z.ZodBoolean>;
|
|
84
|
+
hoverColor: z.ZodOptional<z.ZodString>;
|
|
85
|
+
nameFilter: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
86
|
+
}>, "strip", z.ZodTypeAny, {
|
|
87
|
+
scale?: number | undefined;
|
|
88
|
+
selectionColor?: string | undefined;
|
|
89
|
+
enableRotation?: boolean | undefined;
|
|
90
|
+
enableScaling?: boolean | undefined;
|
|
91
|
+
enableTranslation?: boolean | undefined;
|
|
92
|
+
space?: "local" | "world" | undefined;
|
|
93
|
+
hover?: boolean | undefined;
|
|
94
|
+
hoverColor?: string | undefined;
|
|
95
|
+
nameFilter?: string[] | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
scale?: number | undefined;
|
|
98
|
+
selectionColor?: string | undefined;
|
|
99
|
+
enableRotation?: boolean | undefined;
|
|
100
|
+
enableScaling?: boolean | undefined;
|
|
101
|
+
enableTranslation?: boolean | undefined;
|
|
102
|
+
space?: "local" | "world" | undefined;
|
|
103
|
+
hover?: boolean | undefined;
|
|
104
|
+
hoverColor?: string | undefined;
|
|
105
|
+
nameFilter?: string[] | undefined;
|
|
106
|
+
}>;
|
|
107
|
+
}, "strip", z.ZodTypeAny, {
|
|
108
|
+
type: "gumball";
|
|
109
|
+
props: {
|
|
110
|
+
scale?: number | undefined;
|
|
111
|
+
selectionColor?: string | undefined;
|
|
112
|
+
enableRotation?: boolean | undefined;
|
|
113
|
+
enableScaling?: boolean | undefined;
|
|
114
|
+
enableTranslation?: boolean | undefined;
|
|
115
|
+
space?: "local" | "world" | undefined;
|
|
116
|
+
hover?: boolean | undefined;
|
|
117
|
+
hoverColor?: string | undefined;
|
|
118
|
+
nameFilter?: string[] | undefined;
|
|
119
|
+
};
|
|
120
|
+
}, {
|
|
121
|
+
type: "gumball";
|
|
122
|
+
props: {
|
|
123
|
+
scale?: number | undefined;
|
|
124
|
+
selectionColor?: string | undefined;
|
|
125
|
+
enableRotation?: boolean | undefined;
|
|
126
|
+
enableScaling?: boolean | undefined;
|
|
127
|
+
enableTranslation?: boolean | undefined;
|
|
128
|
+
space?: "local" | "world" | undefined;
|
|
129
|
+
hover?: boolean | undefined;
|
|
130
|
+
hoverColor?: string | undefined;
|
|
131
|
+
nameFilter?: string[] | undefined;
|
|
132
|
+
};
|
|
133
|
+
}>;
|
|
134
|
+
export declare const IInteractionParameterJsonSchema: z.ZodUnion<[z.ZodObject<{
|
|
135
|
+
type: z.ZodLiteral<"selection">;
|
|
136
|
+
props: z.ZodObject<z.objectUtil.extendShape<{
|
|
137
|
+
maximumSelection: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
minimumSelection: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
selectionColor: z.ZodOptional<z.ZodString>;
|
|
140
|
+
}, {
|
|
141
|
+
hover: z.ZodOptional<z.ZodBoolean>;
|
|
142
|
+
hoverColor: z.ZodOptional<z.ZodString>;
|
|
143
|
+
nameFilter: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
144
|
+
}>, "strip", z.ZodTypeAny, {
|
|
145
|
+
maximumSelection?: number | undefined;
|
|
146
|
+
minimumSelection?: number | undefined;
|
|
147
|
+
selectionColor?: string | undefined;
|
|
148
|
+
hover?: boolean | undefined;
|
|
149
|
+
hoverColor?: string | undefined;
|
|
150
|
+
nameFilter?: string[] | undefined;
|
|
151
|
+
}, {
|
|
152
|
+
maximumSelection?: number | undefined;
|
|
153
|
+
minimumSelection?: number | undefined;
|
|
154
|
+
selectionColor?: string | undefined;
|
|
155
|
+
hover?: boolean | undefined;
|
|
156
|
+
hoverColor?: string | undefined;
|
|
157
|
+
nameFilter?: string[] | undefined;
|
|
158
|
+
}>;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
type: "selection";
|
|
161
|
+
props: {
|
|
162
|
+
maximumSelection?: number | undefined;
|
|
163
|
+
minimumSelection?: number | undefined;
|
|
164
|
+
selectionColor?: string | undefined;
|
|
165
|
+
hover?: boolean | undefined;
|
|
166
|
+
hoverColor?: string | undefined;
|
|
167
|
+
nameFilter?: string[] | undefined;
|
|
168
|
+
};
|
|
169
|
+
}, {
|
|
170
|
+
type: "selection";
|
|
171
|
+
props: {
|
|
172
|
+
maximumSelection?: number | undefined;
|
|
173
|
+
minimumSelection?: number | undefined;
|
|
174
|
+
selectionColor?: string | undefined;
|
|
175
|
+
hover?: boolean | undefined;
|
|
176
|
+
hoverColor?: string | undefined;
|
|
177
|
+
nameFilter?: string[] | undefined;
|
|
178
|
+
};
|
|
179
|
+
}>, z.ZodObject<{
|
|
180
|
+
type: z.ZodLiteral<"gumball">;
|
|
181
|
+
props: z.ZodObject<z.objectUtil.extendShape<{
|
|
182
|
+
enableRotation: z.ZodOptional<z.ZodBoolean>;
|
|
183
|
+
enableScaling: z.ZodOptional<z.ZodBoolean>;
|
|
184
|
+
enableTranslation: z.ZodOptional<z.ZodBoolean>;
|
|
185
|
+
scale: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
space: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"local">, z.ZodLiteral<"world">]>>;
|
|
187
|
+
selectionColor: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, {
|
|
189
|
+
hover: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
+
hoverColor: z.ZodOptional<z.ZodString>;
|
|
191
|
+
nameFilter: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
192
|
+
}>, "strip", z.ZodTypeAny, {
|
|
193
|
+
scale?: number | undefined;
|
|
194
|
+
selectionColor?: string | undefined;
|
|
195
|
+
enableRotation?: boolean | undefined;
|
|
196
|
+
enableScaling?: boolean | undefined;
|
|
197
|
+
enableTranslation?: boolean | undefined;
|
|
198
|
+
space?: "local" | "world" | undefined;
|
|
199
|
+
hover?: boolean | undefined;
|
|
200
|
+
hoverColor?: string | undefined;
|
|
201
|
+
nameFilter?: string[] | undefined;
|
|
202
|
+
}, {
|
|
203
|
+
scale?: number | undefined;
|
|
204
|
+
selectionColor?: string | undefined;
|
|
205
|
+
enableRotation?: boolean | undefined;
|
|
206
|
+
enableScaling?: boolean | undefined;
|
|
207
|
+
enableTranslation?: boolean | undefined;
|
|
208
|
+
space?: "local" | "world" | undefined;
|
|
209
|
+
hover?: boolean | undefined;
|
|
210
|
+
hoverColor?: string | undefined;
|
|
211
|
+
nameFilter?: string[] | undefined;
|
|
212
|
+
}>;
|
|
213
|
+
}, "strip", z.ZodTypeAny, {
|
|
214
|
+
type: "gumball";
|
|
215
|
+
props: {
|
|
216
|
+
scale?: number | undefined;
|
|
217
|
+
selectionColor?: string | undefined;
|
|
218
|
+
enableRotation?: boolean | undefined;
|
|
219
|
+
enableScaling?: boolean | undefined;
|
|
220
|
+
enableTranslation?: boolean | undefined;
|
|
221
|
+
space?: "local" | "world" | undefined;
|
|
222
|
+
hover?: boolean | undefined;
|
|
223
|
+
hoverColor?: string | undefined;
|
|
224
|
+
nameFilter?: string[] | undefined;
|
|
225
|
+
};
|
|
226
|
+
}, {
|
|
227
|
+
type: "gumball";
|
|
228
|
+
props: {
|
|
229
|
+
scale?: number | undefined;
|
|
230
|
+
selectionColor?: string | undefined;
|
|
231
|
+
enableRotation?: boolean | undefined;
|
|
232
|
+
enableScaling?: boolean | undefined;
|
|
233
|
+
enableTranslation?: boolean | undefined;
|
|
234
|
+
space?: "local" | "world" | undefined;
|
|
235
|
+
hover?: boolean | undefined;
|
|
236
|
+
hoverColor?: string | undefined;
|
|
237
|
+
nameFilter?: string[] | undefined;
|
|
238
|
+
};
|
|
239
|
+
}>]>;
|
|
240
|
+
export declare const validateInteractionParameterSettings: (param: unknown) => z.SafeParseReturnType<{
|
|
241
|
+
type: "selection";
|
|
242
|
+
props: {
|
|
243
|
+
maximumSelection?: number | undefined;
|
|
244
|
+
minimumSelection?: number | undefined;
|
|
245
|
+
selectionColor?: string | undefined;
|
|
246
|
+
hover?: boolean | undefined;
|
|
247
|
+
hoverColor?: string | undefined;
|
|
248
|
+
nameFilter?: string[] | undefined;
|
|
249
|
+
};
|
|
250
|
+
} | {
|
|
251
|
+
type: "gumball";
|
|
252
|
+
props: {
|
|
253
|
+
scale?: number | undefined;
|
|
254
|
+
selectionColor?: string | undefined;
|
|
255
|
+
enableRotation?: boolean | undefined;
|
|
256
|
+
enableScaling?: boolean | undefined;
|
|
257
|
+
enableTranslation?: boolean | undefined;
|
|
258
|
+
space?: "local" | "world" | undefined;
|
|
259
|
+
hover?: boolean | undefined;
|
|
260
|
+
hoverColor?: string | undefined;
|
|
261
|
+
nameFilter?: string[] | undefined;
|
|
262
|
+
};
|
|
263
|
+
}, {
|
|
264
|
+
type: "selection";
|
|
265
|
+
props: {
|
|
266
|
+
maximumSelection?: number | undefined;
|
|
267
|
+
minimumSelection?: number | undefined;
|
|
268
|
+
selectionColor?: string | undefined;
|
|
269
|
+
hover?: boolean | undefined;
|
|
270
|
+
hoverColor?: string | undefined;
|
|
271
|
+
nameFilter?: string[] | undefined;
|
|
272
|
+
};
|
|
273
|
+
} | {
|
|
274
|
+
type: "gumball";
|
|
275
|
+
props: {
|
|
276
|
+
scale?: number | undefined;
|
|
277
|
+
selectionColor?: string | undefined;
|
|
278
|
+
enableRotation?: boolean | undefined;
|
|
279
|
+
enableScaling?: boolean | undefined;
|
|
280
|
+
enableTranslation?: boolean | undefined;
|
|
281
|
+
space?: "local" | "world" | undefined;
|
|
282
|
+
hover?: boolean | undefined;
|
|
283
|
+
hoverColor?: string | undefined;
|
|
284
|
+
nameFilter?: string[] | undefined;
|
|
285
|
+
};
|
|
286
|
+
}>;
|
|
287
|
+
export declare const validateSelectionParameterSettings: (param: unknown) => z.SafeParseReturnType<{
|
|
288
|
+
type: "selection";
|
|
289
|
+
props: {
|
|
290
|
+
maximumSelection?: number | undefined;
|
|
291
|
+
minimumSelection?: number | undefined;
|
|
292
|
+
selectionColor?: string | undefined;
|
|
293
|
+
hover?: boolean | undefined;
|
|
294
|
+
hoverColor?: string | undefined;
|
|
295
|
+
nameFilter?: string[] | undefined;
|
|
296
|
+
};
|
|
297
|
+
}, {
|
|
298
|
+
type: "selection";
|
|
299
|
+
props: {
|
|
300
|
+
maximumSelection?: number | undefined;
|
|
301
|
+
minimumSelection?: number | undefined;
|
|
302
|
+
selectionColor?: string | undefined;
|
|
303
|
+
hover?: boolean | undefined;
|
|
304
|
+
hoverColor?: string | undefined;
|
|
305
|
+
nameFilter?: string[] | undefined;
|
|
306
|
+
};
|
|
307
|
+
}>;
|
|
308
|
+
export declare const validateGumballParameterSettings: (param: unknown) => z.SafeParseReturnType<{
|
|
309
|
+
type: "gumball";
|
|
310
|
+
props: {
|
|
311
|
+
scale?: number | undefined;
|
|
312
|
+
selectionColor?: string | undefined;
|
|
313
|
+
enableRotation?: boolean | undefined;
|
|
314
|
+
enableScaling?: boolean | undefined;
|
|
315
|
+
enableTranslation?: boolean | undefined;
|
|
316
|
+
space?: "local" | "world" | undefined;
|
|
317
|
+
hover?: boolean | undefined;
|
|
318
|
+
hoverColor?: string | undefined;
|
|
319
|
+
nameFilter?: string[] | undefined;
|
|
320
|
+
};
|
|
321
|
+
}, {
|
|
322
|
+
type: "gumball";
|
|
323
|
+
props: {
|
|
324
|
+
scale?: number | undefined;
|
|
325
|
+
selectionColor?: string | undefined;
|
|
326
|
+
enableRotation?: boolean | undefined;
|
|
327
|
+
enableScaling?: boolean | undefined;
|
|
328
|
+
enableTranslation?: boolean | undefined;
|
|
329
|
+
space?: "local" | "world" | undefined;
|
|
330
|
+
hover?: boolean | undefined;
|
|
331
|
+
hoverColor?: string | undefined;
|
|
332
|
+
nameFilter?: string[] | undefined;
|
|
333
|
+
};
|
|
334
|
+
}>;
|
|
335
|
+
//# sourceMappingURL=IInteractionParameterSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IInteractionParameterSettings.d.ts","sourceRoot":"","sources":["../../../src/interfaces/parameter/IInteractionParameterSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AAIxE,oBAAY,gCAAgC,GAAG,WAAW,GAAG,SAAS,CAAC;AAMvE;;GAEG;AACH,MAAM,WAAW,oCAAoC;IAGjD,oDAAoD;IACpD,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sGAAsG;IACtG,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CAGxB;AAED;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAG1C,8CAA8C;IAC9C,KAAK,EAAE,2BAA2B,GAAG,yBAAyB,CAAC;IAC/D,0CAA0C;IAC1C,IAAI,EAAE,gCAAgC,CAAC;CAG1C;AAYD,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOxC,CAAC;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUtC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAgE,CAAC;AAE7G,eAAO,MAAM,oCAAoC,UAAW,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAElE,CAAC;AACF,eAAO,MAAM,kCAAkC,UAAW,OAAO;;;;;;;;;;;;;;;;;;;;EAEhE,CAAC;AACF,eAAO,MAAM,gCAAgC,UAAW,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;EAE9D,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.validateGumballParameterSettings = exports.validateSelectionParameterSettings = exports.validateInteractionParameterSettings = exports.IInteractionParameterJsonSchema = exports.IGumballParameterJsonSchema = exports.ISelectionParameterJsonSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
// #endregion Interfaces (2)
|
|
6
|
+
// #region Variables (7)
|
|
7
|
+
const IGeneralInteractionParameterJsonSchema = zod_1.z.object({
|
|
8
|
+
hover: zod_1.z.boolean().optional(),
|
|
9
|
+
hoverColor: zod_1.z.string().optional(),
|
|
10
|
+
nameFilter: zod_1.z.array(zod_1.z.string()).optional(),
|
|
11
|
+
});
|
|
12
|
+
exports.ISelectionParameterJsonSchema = zod_1.z.object({
|
|
13
|
+
type: zod_1.z.literal('selection'),
|
|
14
|
+
props: zod_1.z.object({
|
|
15
|
+
maximumSelection: zod_1.z.number().optional(),
|
|
16
|
+
minimumSelection: zod_1.z.number().optional(),
|
|
17
|
+
selectionColor: zod_1.z.string().optional(),
|
|
18
|
+
}).merge(IGeneralInteractionParameterJsonSchema),
|
|
19
|
+
});
|
|
20
|
+
exports.IGumballParameterJsonSchema = zod_1.z.object({
|
|
21
|
+
type: zod_1.z.literal('gumball'),
|
|
22
|
+
props: zod_1.z.object({
|
|
23
|
+
enableRotation: zod_1.z.boolean().optional(),
|
|
24
|
+
enableScaling: zod_1.z.boolean().optional(),
|
|
25
|
+
enableTranslation: zod_1.z.boolean().optional(),
|
|
26
|
+
scale: zod_1.z.number().optional(),
|
|
27
|
+
space: zod_1.z.literal('local').or(zod_1.z.literal('world')).optional(),
|
|
28
|
+
selectionColor: zod_1.z.string().optional(),
|
|
29
|
+
}).merge(IGeneralInteractionParameterJsonSchema),
|
|
30
|
+
});
|
|
31
|
+
exports.IInteractionParameterJsonSchema = exports.ISelectionParameterJsonSchema.or(exports.IGumballParameterJsonSchema);
|
|
32
|
+
const validateInteractionParameterSettings = (param) => {
|
|
33
|
+
return exports.IInteractionParameterJsonSchema.safeParse(param);
|
|
34
|
+
};
|
|
35
|
+
exports.validateInteractionParameterSettings = validateInteractionParameterSettings;
|
|
36
|
+
const validateSelectionParameterSettings = (param) => {
|
|
37
|
+
return exports.ISelectionParameterJsonSchema.safeParse(param);
|
|
38
|
+
};
|
|
39
|
+
exports.validateSelectionParameterSettings = validateSelectionParameterSettings;
|
|
40
|
+
const validateGumballParameterSettings = (param) => {
|
|
41
|
+
return exports.IGumballParameterJsonSchema.safeParse(param);
|
|
42
|
+
};
|
|
43
|
+
exports.validateGumballParameterSettings = validateGumballParameterSettings;
|
|
44
|
+
// #endregion Variables (7)
|
|
45
|
+
//# sourceMappingURL=IInteractionParameterSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IInteractionParameterSettings.js","sourceRoot":"","sources":["../../../src/interfaces/parameter/IInteractionParameterSettings.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AA4CxB,4BAA4B;AAE5B,wBAAwB;AAExB,MAAM,sCAAsC,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,KAAK,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC7B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC7C,CAAC,CAAC;AAEU,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IAClD,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IAC5B,KAAK,EAAE,OAAC,CAAC,MAAM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AAK,CAAC,CAAC;AAC1D,CAAC,CAAC;AAFW,QAAA,kCAAkC,sCAE7C;AACK,MAAM,gCAAgC,GAAG,CAAC,KAAc,EAAE,EAAE;IAC/D,OAAO,mCAA2B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC,CAAC;AAFW,QAAA,gCAAgC,oCAE3C;AAEF,2BAA2B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { IGeneralInteractionParameterSettings, IInteractionParameterSettings } from './IInteractionParameterSettings';
|
|
2
|
+
export declare type SelectionParameterValue = {
|
|
3
|
+
names: string[];
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Properties of a selection parameter.
|
|
7
|
+
*/
|
|
8
|
+
export interface ISelectionParameterSettings extends IGeneralInteractionParameterSettings {
|
|
9
|
+
/** The maximum number of objects that can be selected. (default: 1) */
|
|
10
|
+
maximumSelection?: number;
|
|
11
|
+
/** The minimum number of objects that can be selected. (default: 1) */
|
|
12
|
+
minimumSelection?: number;
|
|
13
|
+
/** The color of the objects when selected. (default: '#0d44f0') */
|
|
14
|
+
selectionColor?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function isInteractionSelectionParameterSettings(def?: IInteractionParameterSettings): def is {
|
|
17
|
+
type: 'selection';
|
|
18
|
+
props: ISelectionParameterSettings;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=ISelectionParameterSettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISelectionParameterSettings.d.ts","sourceRoot":"","sources":["../../../src/interfaces/parameter/ISelectionParameterSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oCAAoC,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAItH,oBAAY,uBAAuB,GAAG;IAClC,KAAK,EAAE,MAAM,EAAE,CAAA;CAClB,CAAC;AAMF;;GAEG;AACH,MAAM,WAAW,2BAA4B,SAAQ,oCAAoC;IAGrF,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uEAAuE;IACvE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mEAAmE;IACnE,cAAc,CAAC,EAAE,MAAM,CAAC;CAG3B;AAMD,wBAAgB,uCAAuC,CAAC,GAAG,CAAC,EAAE,6BAA6B,GAAG,GAAG,IAAI;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,2BAA2B,CAAA;CAAE,CAE7J"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isInteractionSelectionParameterSettings = void 0;
|
|
4
|
+
// #endregion Interfaces (1)
|
|
5
|
+
// #region Functions (1)
|
|
6
|
+
function isInteractionSelectionParameterSettings(def) {
|
|
7
|
+
return (def === null || def === void 0 ? void 0 : def.type) === 'selection';
|
|
8
|
+
}
|
|
9
|
+
exports.isInteractionSelectionParameterSettings = isInteractionSelectionParameterSettings;
|
|
10
|
+
// #endregion Functions (1)
|
|
11
|
+
//# sourceMappingURL=ISelectionParameterSettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ISelectionParameterSettings.js","sourceRoot":"","sources":["../../../src/interfaces/parameter/ISelectionParameterSettings.ts"],"names":[],"mappings":";;;AA4BA,4BAA4B;AAE5B,wBAAwB;AAExB,SAAgB,uCAAuC,CAAC,GAAmC;IACvF,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,MAAK,WAAW,CAAC;AACrC,CAAC;AAFD,0FAEC;AAED,2BAA2B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapediver/viewer.shared.types",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Michael Oppitz <michael@shapediver.com>",
|
|
@@ -39,12 +39,13 @@
|
|
|
39
39
|
"testEnvironment": "node"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@shapediver/sdk.geometry-api-sdk-v2": "1.
|
|
43
|
-
"@shapediver/sdk.sdtf-v1": "1.5.
|
|
44
|
-
"@shapediver/viewer.shared.math": "3.
|
|
45
|
-
"@shapediver/viewer.shared.node-tree": "3.
|
|
46
|
-
"@shapediver/viewer.shared.services": "3.
|
|
47
|
-
"gl-matrix": "3.3.0"
|
|
42
|
+
"@shapediver/sdk.geometry-api-sdk-v2": "1.9.1",
|
|
43
|
+
"@shapediver/sdk.sdtf-v1": "1.5.1",
|
|
44
|
+
"@shapediver/viewer.shared.math": "3.2.0",
|
|
45
|
+
"@shapediver/viewer.shared.node-tree": "3.2.0",
|
|
46
|
+
"@shapediver/viewer.shared.services": "3.2.0",
|
|
47
|
+
"gl-matrix": "3.3.0",
|
|
48
|
+
"zod": "^3.23.8"
|
|
48
49
|
},
|
|
49
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "36007f976342f0390133d7e5cecf4ebf79905c8a"
|
|
50
51
|
}
|
package/src/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
IViewportSettingsSections,
|
|
10
10
|
PARAMETER_TYPE,
|
|
11
11
|
PARAMETER_VISUALIZATION
|
|
12
|
-
} from './types';
|
|
12
|
+
} from './types';
|
|
13
13
|
import { CustomData } from './implementation/data/CustomData';
|
|
14
14
|
import { EventResponseMapping } from './interfaces/events/EventResponseMapping';
|
|
15
15
|
import {
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
HTMLElementAnchorData,
|
|
18
18
|
HTMLElementAnchorImageData,
|
|
19
19
|
HTMLElementAnchorTextData
|
|
20
|
-
} from './implementation/data/HTMLElementAnchorData';
|
|
20
|
+
} from './implementation/data/HTMLElementAnchorData';
|
|
21
21
|
import { IAnchorDataImage, IAnchorDataText, IHTMLElementAnchorData } from './interfaces/data/IHTMLElementAnchorData';
|
|
22
22
|
import { IAnimationData, IAnimationTrack } from './interfaces/data/IAnimationData';
|
|
23
23
|
import {
|
|
@@ -25,10 +25,11 @@ import {
|
|
|
25
25
|
IGeometryData,
|
|
26
26
|
IPrimitiveData,
|
|
27
27
|
PRIMITIVE_MODE
|
|
28
|
-
} from './interfaces/data/IGeometryData';
|
|
28
|
+
} from './interfaces/data/IGeometryData';
|
|
29
29
|
import { IBoneData } from './interfaces/data/IBoneData';
|
|
30
30
|
import { ICameraEvent } from './interfaces/events/ICameraEvent';
|
|
31
31
|
import { ICustomData } from './interfaces/data/ICustomData';
|
|
32
|
+
import { IGeneralInteractionParameterSettings, IGumballParameterJsonSchema, IInteractionParameterJsonSchema, IInteractionParameterSettings, InteractionParameterSettingsType, ISelectionParameterJsonSchema, validateGumballParameterSettings, validateInteractionParameterSettings, validateSelectionParameterSettings } from './interfaces/parameter/IInteractionParameterSettings';
|
|
32
33
|
import { IMapData, TEXTURE_FILTERING, TEXTURE_WRAPPING } from './interfaces/data/material/IMapData';
|
|
33
34
|
import {
|
|
34
35
|
IMaterialAbstractData,
|
|
@@ -37,7 +38,7 @@ import {
|
|
|
37
38
|
MATERIAL_SHADING,
|
|
38
39
|
MATERIAL_SIDE,
|
|
39
40
|
MATERIAL_TYPE
|
|
40
|
-
} from './interfaces/data/material/IMaterialAbstractData';
|
|
41
|
+
} from './interfaces/data/material/IMaterialAbstractData';
|
|
41
42
|
import { IMaterialBasicLineData, IMaterialBasicLineDataProperties } from './interfaces/data/material/IMaterialBasicLineData';
|
|
42
43
|
import { IMaterialGemData, IMaterialGemDataProperties } from './interfaces/data/material/IMaterialGemDataProperties';
|
|
43
44
|
import { IMaterialMultiPointData, IMaterialMultiPointDataProperties } from './interfaces/data/material/IMaterialMultiPointData';
|
|
@@ -48,11 +49,14 @@ import { IMaterialStandardData, IMaterialStandardDataProperties } from './interf
|
|
|
48
49
|
import { IMaterialUnlitData, IMaterialUnlitDataProperties } from './interfaces/data/material/IMaterialUnlitData';
|
|
49
50
|
import { IMaterialVariantsData } from './interfaces/data/material/IMaterialVariantsData';
|
|
50
51
|
import { IOutputEvent } from './interfaces/events/IOutputEvent';
|
|
52
|
+
import { IParameterEvent } from './interfaces/events/IParameterEvent';
|
|
53
|
+
import { IRenderingEvent } from './interfaces/events/IRenderingEvent';
|
|
51
54
|
import { ISceneEvent } from './interfaces/events/ISceneEvent';
|
|
52
55
|
import { ISDTFAttributeData, ISDTFAttributesData } from './interfaces/sdtf/ISDTFAttributesData';
|
|
53
56
|
import { ISDTFAttributeVisualizationData } from './interfaces/sdtf/ISDTFAttributeVisualizationData';
|
|
54
57
|
import { ISDTFItemData } from './interfaces/sdtf/ISDTFItemData';
|
|
55
58
|
import { ISDTFOverview, ISDTFOverviewData } from './interfaces/sdtf/ISDTFOverviewData';
|
|
59
|
+
import { ISelectionParameterSettings, isInteractionSelectionParameterSettings, SelectionParameterValue } from './interfaces/parameter/ISelectionParameterSettings';
|
|
56
60
|
import { ISessionEvent } from './interfaces/events/ISessionEvent';
|
|
57
61
|
import { ITaskEvent, TASK_TYPE } from './interfaces/events/ITaskEvent';
|
|
58
62
|
import { IViewportEvent } from './interfaces/events/IViewportEvent';
|
|
@@ -73,8 +77,7 @@ import { SdtfTypeHintName } from '@shapediver/sdk.sdtf-v1';
|
|
|
73
77
|
import {
|
|
74
78
|
MaterialStandardData,
|
|
75
79
|
} from './implementation/material/MaterialStandardData';
|
|
76
|
-
import {
|
|
77
|
-
import { IParameterEvent } from './interfaces/events/IParameterEvent';
|
|
80
|
+
import { IGumballParameterSettings, GumballParameterValue, isInteractionGumballParameterSettings } from './interfaces/parameter/IGumballParameterSettings';
|
|
78
81
|
|
|
79
82
|
export {
|
|
80
83
|
IMaterialStandardData, MaterialStandardData, IMaterialStandardDataProperties,
|
|
@@ -112,4 +115,10 @@ export {
|
|
|
112
115
|
|
|
113
116
|
export {
|
|
114
117
|
Color, PARAMETER_TYPE, PARAMETER_VISUALIZATION, ISettingsSections, ISessionSettingsSections, IViewportSettingsSections
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export {
|
|
121
|
+
InteractionParameterSettingsType, IGeneralInteractionParameterSettings, IInteractionParameterSettings, IInteractionParameterJsonSchema, validateInteractionParameterSettings,
|
|
122
|
+
ISelectionParameterSettings, SelectionParameterValue, isInteractionSelectionParameterSettings, ISelectionParameterJsonSchema, validateSelectionParameterSettings,
|
|
123
|
+
IGumballParameterSettings, GumballParameterValue, isInteractionGumballParameterSettings, IGumballParameterJsonSchema, validateGumballParameterSettings
|
|
115
124
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { IGeneralInteractionParameterSettings, 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 IGumballParameterSettings extends IGeneralInteractionParameterSettings {
|
|
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: IGumballParameterSettings } {
|
|
41
|
+
return def?.type === 'gumball';
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// #endregion Functions (1)
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { ISelectionParameterSettings } from './ISelectionParameterSettings';
|
|
3
|
+
import { IGumballParameterSettings } from './IGumballParameterSettings';
|
|
4
|
+
|
|
5
|
+
// #region Type aliases (1)
|
|
6
|
+
|
|
7
|
+
export type InteractionParameterSettingsType = 'selection' | 'gumball';
|
|
8
|
+
|
|
9
|
+
// #endregion Type aliases (1)
|
|
10
|
+
|
|
11
|
+
// #region Interfaces (2)
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* General properties of an interaction parameter.
|
|
15
|
+
*/
|
|
16
|
+
export interface IGeneralInteractionParameterSettings {
|
|
17
|
+
// #region Properties (2)
|
|
18
|
+
|
|
19
|
+
/** If the objects are hoverable. (default: true) */
|
|
20
|
+
hover?: boolean,
|
|
21
|
+
/** The color of the objects when hovered. (default: '#00ff78') */
|
|
22
|
+
hoverColor?: string,
|
|
23
|
+
/** The names of the objects that can be interacted with. (see Jira document and discussion result) */
|
|
24
|
+
nameFilter?: string[]
|
|
25
|
+
|
|
26
|
+
// #endregion Properties (2)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The definition of an interaction parameter.
|
|
31
|
+
*
|
|
32
|
+
* For each type, there is a corresponding set of properties.
|
|
33
|
+
*/
|
|
34
|
+
export interface IInteractionParameterSettings {
|
|
35
|
+
// #region Properties (2)
|
|
36
|
+
|
|
37
|
+
/** Properties of the parameter definition. */
|
|
38
|
+
props: ISelectionParameterSettings | IGumballParameterSettings,
|
|
39
|
+
/** Type of the interaction parameters. */
|
|
40
|
+
type: InteractionParameterSettingsType,
|
|
41
|
+
|
|
42
|
+
// #endregion Properties (2)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// #endregion Interfaces (2)
|
|
46
|
+
|
|
47
|
+
// #region Variables (7)
|
|
48
|
+
|
|
49
|
+
const IGeneralInteractionParameterJsonSchema = z.object({
|
|
50
|
+
hover: z.boolean().optional(),
|
|
51
|
+
hoverColor: z.string().optional(),
|
|
52
|
+
nameFilter: z.array(z.string()).optional(),
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const ISelectionParameterJsonSchema = z.object({
|
|
56
|
+
type: z.literal('selection'),
|
|
57
|
+
props: z.object({
|
|
58
|
+
maximumSelection: z.number().optional(),
|
|
59
|
+
minimumSelection: z.number().optional(),
|
|
60
|
+
selectionColor: z.string().optional(),
|
|
61
|
+
}).merge(IGeneralInteractionParameterJsonSchema),
|
|
62
|
+
});
|
|
63
|
+
export const IGumballParameterJsonSchema = z.object({
|
|
64
|
+
type: z.literal('gumball'),
|
|
65
|
+
props: z.object({
|
|
66
|
+
enableRotation: z.boolean().optional(),
|
|
67
|
+
enableScaling: z.boolean().optional(),
|
|
68
|
+
enableTranslation: z.boolean().optional(),
|
|
69
|
+
scale: z.number().optional(),
|
|
70
|
+
space: z.literal('local').or(z.literal('world')).optional(),
|
|
71
|
+
selectionColor: z.string().optional(),
|
|
72
|
+
}).merge(IGeneralInteractionParameterJsonSchema),
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
export const IInteractionParameterJsonSchema = ISelectionParameterJsonSchema.or(IGumballParameterJsonSchema);
|
|
76
|
+
|
|
77
|
+
export const validateInteractionParameterSettings = (param: unknown) => {
|
|
78
|
+
return IInteractionParameterJsonSchema.safeParse(param);
|
|
79
|
+
};
|
|
80
|
+
export const validateSelectionParameterSettings = (param: unknown) => {
|
|
81
|
+
return ISelectionParameterJsonSchema.safeParse(param);
|
|
82
|
+
};
|
|
83
|
+
export const validateGumballParameterSettings = (param: unknown) => {
|
|
84
|
+
return IGumballParameterJsonSchema.safeParse(param);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
// #endregion Variables (7)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { IGeneralInteractionParameterSettings, 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 ISelectionParameterSettings extends IGeneralInteractionParameterSettings {
|
|
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: ISelectionParameterSettings } {
|
|
34
|
+
return def?.type === 'selection';
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// #endregion Functions (1)
|