@shapediver/viewer.shared.types 3.3.6 → 3.3.8
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/package.json +5 -5
- package/dist/interfaces/parameter/IDrawingToolsParametersSettings.d.ts +0 -159
- package/dist/interfaces/parameter/IDrawingToolsParametersSettings.d.ts.map +0 -1
- package/dist/interfaces/parameter/IDrawingToolsParametersSettings.js +0 -29
- package/dist/interfaces/parameter/IDrawingToolsParametersSettings.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shapediver/viewer.shared.types",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.8",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "Michael Oppitz <michael@shapediver.com>",
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@shapediver/sdk.geometry-api-sdk-v2": "1.11.0",
|
|
42
42
|
"@shapediver/sdk.sdtf-v1": "1.5.3",
|
|
43
|
-
"@shapediver/viewer.shared.math": "3.3.
|
|
44
|
-
"@shapediver/viewer.shared.node-tree": "3.3.
|
|
45
|
-
"@shapediver/viewer.shared.services": "3.3.
|
|
43
|
+
"@shapediver/viewer.shared.math": "3.3.8",
|
|
44
|
+
"@shapediver/viewer.shared.node-tree": "3.3.8",
|
|
45
|
+
"@shapediver/viewer.shared.services": "3.3.8",
|
|
46
46
|
"gl-matrix": "3.3.0",
|
|
47
47
|
"zod": "^3.23.8"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "cf06b99729915834ec19f2a25d2bdf00c9c186a9"
|
|
50
50
|
}
|
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare type DrawingToolsParameterValue = any;
|
|
3
|
-
/**
|
|
4
|
-
* General properties of a drawing tools parameter.
|
|
5
|
-
*/
|
|
6
|
-
export interface IDrawingToolsParameterProps {
|
|
7
|
-
geometry?: {
|
|
8
|
-
/**
|
|
9
|
-
* The mode of the geometry.
|
|
10
|
-
*
|
|
11
|
-
* If the mode is set to 'lines', the points are connected in the order they are defined.
|
|
12
|
-
* If the mode is set to 'points', the points are not connected.
|
|
13
|
-
*
|
|
14
|
-
* @default 'lines'
|
|
15
|
-
*/
|
|
16
|
-
mode: 'points' | 'lines';
|
|
17
|
-
/**
|
|
18
|
-
* The minimum amount of points, if undefined, the geometry is not restricted.
|
|
19
|
-
* This value is checked whenever the user tries to update or finish the drawing tool.
|
|
20
|
-
*
|
|
21
|
-
* @default undefined
|
|
22
|
-
*/
|
|
23
|
-
minPoints?: number;
|
|
24
|
-
/**
|
|
25
|
-
* The maximum amount of points, if undefined, the geometry is not restricted.
|
|
26
|
-
* This value is checked whenever the user tries to update or finish the drawing tool.
|
|
27
|
-
*
|
|
28
|
-
* @default undefined
|
|
29
|
-
*/
|
|
30
|
-
maxPoints?: number;
|
|
31
|
-
/**
|
|
32
|
-
* If the number of points is strictly checked during the drawing process.
|
|
33
|
-
* If this setting is set to true, once the minimum or maximum amount of points is reached, the user cannot add or remove points that would violate the restriction.
|
|
34
|
-
* If this setting is set to false, the user can add or remove points even if the minimum or maximum amount of points is exceeded temporarily.
|
|
35
|
-
* Once the user tries to update or finish the drawing tool, the amount of points is checked in either case.
|
|
36
|
-
*
|
|
37
|
-
* @default true
|
|
38
|
-
*/
|
|
39
|
-
strictMinMaxPoints?: boolean;
|
|
40
|
-
/**
|
|
41
|
-
* If the mode is set to 'lines', if it is a closed line or not.
|
|
42
|
-
* If the mode is set to 'points', this setting is ignored.
|
|
43
|
-
*
|
|
44
|
-
* A line can be closed by connecting the last point with the first point.
|
|
45
|
-
*
|
|
46
|
-
* @default true
|
|
47
|
-
*/
|
|
48
|
-
close: boolean;
|
|
49
|
-
};
|
|
50
|
-
restrictions?: any[];
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* The definition of an drawing tools parameter.
|
|
54
|
-
*
|
|
55
|
-
* For each type, there is a corresponding set of properties.
|
|
56
|
-
*/
|
|
57
|
-
export interface IDrawingToolsParameterSettings {
|
|
58
|
-
/** Properties of the parameter definition. */
|
|
59
|
-
props: IDrawingToolsParameterProps;
|
|
60
|
-
/** Type of the drawing tools parameters. */
|
|
61
|
-
type: 'Drawing';
|
|
62
|
-
}
|
|
63
|
-
export declare const IDrawingToolsParameterJsonSchema: z.ZodObject<{
|
|
64
|
-
type: z.ZodLiteral<"Drawing">;
|
|
65
|
-
props: z.ZodObject<{
|
|
66
|
-
geometry: z.ZodOptional<z.ZodObject<{
|
|
67
|
-
mode: z.ZodEnum<["points", "lines"]>;
|
|
68
|
-
minPoints: z.ZodOptional<z.ZodNumber>;
|
|
69
|
-
maxPoints: z.ZodOptional<z.ZodNumber>;
|
|
70
|
-
strictMinMaxPoints: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
-
close: z.ZodBoolean;
|
|
72
|
-
}, "strip", z.ZodTypeAny, {
|
|
73
|
-
mode: "points" | "lines";
|
|
74
|
-
close: boolean;
|
|
75
|
-
minPoints?: number | undefined;
|
|
76
|
-
maxPoints?: number | undefined;
|
|
77
|
-
strictMinMaxPoints?: boolean | undefined;
|
|
78
|
-
}, {
|
|
79
|
-
mode: "points" | "lines";
|
|
80
|
-
close: boolean;
|
|
81
|
-
minPoints?: number | undefined;
|
|
82
|
-
maxPoints?: number | undefined;
|
|
83
|
-
strictMinMaxPoints?: boolean | undefined;
|
|
84
|
-
}>>;
|
|
85
|
-
restrictions: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
86
|
-
}, "strip", z.ZodTypeAny, {
|
|
87
|
-
geometry?: {
|
|
88
|
-
mode: "points" | "lines";
|
|
89
|
-
close: boolean;
|
|
90
|
-
minPoints?: number | undefined;
|
|
91
|
-
maxPoints?: number | undefined;
|
|
92
|
-
strictMinMaxPoints?: boolean | undefined;
|
|
93
|
-
} | undefined;
|
|
94
|
-
restrictions?: any[] | undefined;
|
|
95
|
-
}, {
|
|
96
|
-
geometry?: {
|
|
97
|
-
mode: "points" | "lines";
|
|
98
|
-
close: boolean;
|
|
99
|
-
minPoints?: number | undefined;
|
|
100
|
-
maxPoints?: number | undefined;
|
|
101
|
-
strictMinMaxPoints?: boolean | undefined;
|
|
102
|
-
} | undefined;
|
|
103
|
-
restrictions?: any[] | undefined;
|
|
104
|
-
}>;
|
|
105
|
-
}, "strip", z.ZodTypeAny, {
|
|
106
|
-
type: "Drawing";
|
|
107
|
-
props: {
|
|
108
|
-
geometry?: {
|
|
109
|
-
mode: "points" | "lines";
|
|
110
|
-
close: boolean;
|
|
111
|
-
minPoints?: number | undefined;
|
|
112
|
-
maxPoints?: number | undefined;
|
|
113
|
-
strictMinMaxPoints?: boolean | undefined;
|
|
114
|
-
} | undefined;
|
|
115
|
-
restrictions?: any[] | undefined;
|
|
116
|
-
};
|
|
117
|
-
}, {
|
|
118
|
-
type: "Drawing";
|
|
119
|
-
props: {
|
|
120
|
-
geometry?: {
|
|
121
|
-
mode: "points" | "lines";
|
|
122
|
-
close: boolean;
|
|
123
|
-
minPoints?: number | undefined;
|
|
124
|
-
maxPoints?: number | undefined;
|
|
125
|
-
strictMinMaxPoints?: boolean | undefined;
|
|
126
|
-
} | undefined;
|
|
127
|
-
restrictions?: any[] | undefined;
|
|
128
|
-
};
|
|
129
|
-
}>;
|
|
130
|
-
export declare const validateDrawingToolsParameterSettings: (param: unknown) => z.SafeParseReturnType<{
|
|
131
|
-
type: "Drawing";
|
|
132
|
-
props: {
|
|
133
|
-
geometry?: {
|
|
134
|
-
mode: "points" | "lines";
|
|
135
|
-
close: boolean;
|
|
136
|
-
minPoints?: number | undefined;
|
|
137
|
-
maxPoints?: number | undefined;
|
|
138
|
-
strictMinMaxPoints?: boolean | undefined;
|
|
139
|
-
} | undefined;
|
|
140
|
-
restrictions?: any[] | undefined;
|
|
141
|
-
};
|
|
142
|
-
}, {
|
|
143
|
-
type: "Drawing";
|
|
144
|
-
props: {
|
|
145
|
-
geometry?: {
|
|
146
|
-
mode: "points" | "lines";
|
|
147
|
-
close: boolean;
|
|
148
|
-
minPoints?: number | undefined;
|
|
149
|
-
maxPoints?: number | undefined;
|
|
150
|
-
strictMinMaxPoints?: boolean | undefined;
|
|
151
|
-
} | undefined;
|
|
152
|
-
restrictions?: any[] | undefined;
|
|
153
|
-
};
|
|
154
|
-
}>;
|
|
155
|
-
export declare function isDrawingToolsParameterSettings(def?: IDrawingToolsParameterSettings): def is {
|
|
156
|
-
type: 'Drawing';
|
|
157
|
-
props: IDrawingToolsParameterProps;
|
|
158
|
-
};
|
|
159
|
-
//# sourceMappingURL=IDrawingToolsParametersSettings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IDrawingToolsParametersSettings.d.ts","sourceRoot":"","sources":["../../../src/interfaces/parameter/IDrawingToolsParametersSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,oBAAY,0BAA0B,GAAG,GAAG,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAGxC,QAAQ,CAAC,EAAE;QACP;;;;;;;WAOG;QACH,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;QAEzB;;;;;WAKG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;;;;WAKG;QACH,SAAS,CAAC,EAAE,MAAM,CAAC;QAEnB;;;;;;;WAOG;QACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAE7B;;;;;;;WAOG;QACH,KAAK,EAAE,OAAO,CAAC;KAClB,CAAC;IAEF,YAAY,CAAC,EAAE,GAAG,EAAE,CAAA;CAGvB;AAED;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAG3C,8CAA8C;IAC9C,KAAK,EAAE,2BAA2B,CAAC;IACnC,4CAA4C;IAC5C,IAAI,EAAE,SAAS,CAAC;CAGnB;AAMD,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY3C,CAAC;AACH,eAAO,MAAM,qCAAqC,UAAW,OAAO;;;;;;;;;;;;;;;;;;;;;;;;EAEnE,CAAC;AAGF,wBAAgB,+BAA+B,CAAC,GAAG,CAAC,EAAE,8BAA8B,GAAG,GAAG,IAAI;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,2BAA2B,CAAA;CAAE,CAEpJ"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isDrawingToolsParameterSettings = exports.validateDrawingToolsParameterSettings = exports.IDrawingToolsParameterJsonSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
// #endregion Interfaces (2)
|
|
6
|
-
// #region Variables (2)
|
|
7
|
-
exports.IDrawingToolsParameterJsonSchema = zod_1.z.object({
|
|
8
|
-
type: zod_1.z.literal('Drawing'),
|
|
9
|
-
props: zod_1.z.object({
|
|
10
|
-
geometry: zod_1.z.object({
|
|
11
|
-
mode: zod_1.z.enum(['points', 'lines']),
|
|
12
|
-
minPoints: zod_1.z.number().optional(),
|
|
13
|
-
maxPoints: zod_1.z.number().optional(),
|
|
14
|
-
strictMinMaxPoints: zod_1.z.boolean().optional(),
|
|
15
|
-
close: zod_1.z.boolean(),
|
|
16
|
-
}).optional(),
|
|
17
|
-
restrictions: zod_1.z.array(zod_1.z.any()).optional()
|
|
18
|
-
})
|
|
19
|
-
});
|
|
20
|
-
const validateDrawingToolsParameterSettings = (param) => {
|
|
21
|
-
return exports.IDrawingToolsParameterJsonSchema.safeParse(param);
|
|
22
|
-
};
|
|
23
|
-
exports.validateDrawingToolsParameterSettings = validateDrawingToolsParameterSettings;
|
|
24
|
-
function isDrawingToolsParameterSettings(def) {
|
|
25
|
-
return (def === null || def === void 0 ? void 0 : def.type) === 'Drawing';
|
|
26
|
-
}
|
|
27
|
-
exports.isDrawingToolsParameterSettings = isDrawingToolsParameterSettings;
|
|
28
|
-
// #endregion Variables (2)
|
|
29
|
-
//# sourceMappingURL=IDrawingToolsParametersSettings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IDrawingToolsParametersSettings.js","sourceRoot":"","sources":["../../../src/interfaces/parameter/IDrawingToolsParametersSettings.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAiFxB,4BAA4B;AAE5B,wBAAwB;AAEX,QAAA,gCAAgC,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,OAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IAC1B,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC;QACZ,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC;YACf,IAAI,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;YACjC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAChC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;YAChC,kBAAkB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;YAC1C,KAAK,EAAE,OAAC,CAAC,OAAO,EAAE;SACrB,CAAC,CAAC,QAAQ,EAAE;QACb,YAAY,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,GAAG,EAAE,CAAC,CAAC,QAAQ,EAAE;KAC5C,CAAC;CACL,CAAC,CAAC;AACI,MAAM,qCAAqC,GAAG,CAAC,KAAc,EAAE,EAAE;IACpE,OAAO,wCAAgC,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AAC7D,CAAC,CAAC;AAFW,QAAA,qCAAqC,yCAEhD;AAGF,SAAgB,+BAA+B,CAAC,GAAoC;IAChF,OAAO,CAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI,MAAK,SAAS,CAAC;AACnC,CAAC;AAFD,0EAEC;AAED,2BAA2B"}
|