@snaptrude/plugin-core 0.2.3 → 0.2.4

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 (57) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/index.cjs +1 -0
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.js +1 -0
  5. package/dist/index.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/api/entity/space.ts +28 -14
  8. package/dist/api/core/geom/arc.d.ts +0 -81
  9. package/dist/api/core/geom/arc.d.ts.map +0 -1
  10. package/dist/api/core/geom/curve.d.ts +0 -70
  11. package/dist/api/core/geom/curve.d.ts.map +0 -1
  12. package/dist/api/core/geom/index.d.ts +0 -32
  13. package/dist/api/core/geom/index.d.ts.map +0 -1
  14. package/dist/api/core/geom/line.d.ts +0 -56
  15. package/dist/api/core/geom/line.d.ts.map +0 -1
  16. package/dist/api/core/geom/profile.d.ts +0 -121
  17. package/dist/api/core/geom/profile.d.ts.map +0 -1
  18. package/dist/api/core/index.d.ts +0 -18
  19. package/dist/api/core/index.d.ts.map +0 -1
  20. package/dist/api/core/math/index.d.ts +0 -18
  21. package/dist/api/core/math/index.d.ts.map +0 -1
  22. package/dist/api/core/math/quat.d.ts +0 -187
  23. package/dist/api/core/math/quat.d.ts.map +0 -1
  24. package/dist/api/core/math/vec3.d.ts +0 -156
  25. package/dist/api/core/math/vec3.d.ts.map +0 -1
  26. package/dist/api/entity/buildableEnvelope.d.ts +0 -233
  27. package/dist/api/entity/buildableEnvelope.d.ts.map +0 -1
  28. package/dist/api/entity/department.d.ts +0 -99
  29. package/dist/api/entity/department.d.ts.map +0 -1
  30. package/dist/api/entity/index.d.ts +0 -33
  31. package/dist/api/entity/index.d.ts.map +0 -1
  32. package/dist/api/entity/referenceLine.d.ts +0 -259
  33. package/dist/api/entity/referenceLine.d.ts.map +0 -1
  34. package/dist/api/entity/space.d.ts +0 -765
  35. package/dist/api/entity/space.d.ts.map +0 -1
  36. package/dist/api/entity/story.d.ts +0 -239
  37. package/dist/api/entity/story.d.ts.map +0 -1
  38. package/dist/api/index.d.ts +0 -30
  39. package/dist/api/index.d.ts.map +0 -1
  40. package/dist/api/tools/copy.d.ts +0 -59
  41. package/dist/api/tools/copy.d.ts.map +0 -1
  42. package/dist/api/tools/index.d.ts +0 -29
  43. package/dist/api/tools/index.d.ts.map +0 -1
  44. package/dist/api/tools/offset.d.ts +0 -43
  45. package/dist/api/tools/offset.d.ts.map +0 -1
  46. package/dist/api/tools/selection.d.ts +0 -48
  47. package/dist/api/tools/selection.d.ts.map +0 -1
  48. package/dist/api/tools/transform.d.ts +0 -114
  49. package/dist/api/tools/transform.d.ts.map +0 -1
  50. package/dist/api/units/index.d.ts +0 -163
  51. package/dist/api/units/index.d.ts.map +0 -1
  52. package/dist/host-utils.d.ts +0 -41
  53. package/dist/host-utils.d.ts.map +0 -1
  54. package/dist/index.d.ts +0 -4
  55. package/dist/index.d.ts.map +0 -1
  56. package/dist/types.d.ts +0 -16
  57. package/dist/types.d.ts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"department.d.ts","sourceRoot":"","sources":["../../../src/api/entity/department.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;GAQG;AACH,8BAAsB,mBAAmB;;IAGvC;;;;;;;;;;;;;;;;;OAiBG;aACa,MAAM,CACpB,IAAI,EAAE,0BAA0B,GAC/B,eAAe,CAAC,4BAA4B,CAAC;IAEhD;;;;;;;;;;;;;;;OAeG;aACa,MAAM,IAAI,eAAe,CAAC,4BAA4B,CAAC;CACxE;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;iBAGrC,CAAA;AAEF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAC9C,OAAO,0BAA0B,CAClC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B;;iBAEvC,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;iBAIhC,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B;;;;;;iBAEvC,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAA"}
@@ -1,33 +0,0 @@
1
- import { PluginBuildableEnvelopeApi } from "./buildableEnvelope";
2
- import { PluginDepartmentApi } from "./department";
3
- import { PluginReferenceLineApi } from "./referenceLine";
4
- import { PluginSpaceApi } from "./space";
5
- import { PluginStoryApi } from "./story";
6
- /**
7
- * CRUD operations on Snaptrude building entities.
8
- *
9
- * - {@linkcode PluginEntityApi.space} — Create, query, and delete spaces (rooms/masses)
10
- * - {@linkcode PluginEntityApi.story} — Create, query, and update stories (floors)
11
- * - {@linkcode PluginEntityApi.referenceLine} — Create, query, and delete reference lines
12
- * - {@linkcode PluginEntityApi.department} — Create and query departments
13
- * - {@linkcode PluginEntityApi.buildableEnvelope} — Create or update parametric buildable envelopes
14
- */
15
- export declare abstract class PluginEntityApi {
16
- /** Space (room/mass) operations. See {@linkcode PluginSpaceApi}. */
17
- abstract space: PluginSpaceApi;
18
- /** Story (floor/storey) operations. See {@linkcode PluginStoryApi}. */
19
- abstract story: PluginStoryApi;
20
- /** Reference line operations. See {@linkcode PluginReferenceLineApi}. */
21
- abstract referenceLine: PluginReferenceLineApi;
22
- /** Department operations. See {@linkcode PluginDepartmentApi}. */
23
- abstract department: PluginDepartmentApi;
24
- /** Buildable Envelope operations. See {@linkcode PluginBuildableEnvelopeApi}. */
25
- abstract buildableEnvelope: PluginBuildableEnvelopeApi;
26
- constructor();
27
- }
28
- export * from "./buildableEnvelope";
29
- export * from "./department";
30
- export * from "./referenceLine";
31
- export * from "./space";
32
- export * from "./story";
33
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/entity/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC;;;;;;;;GAQG;AACH,8BAAsB,eAAe;IACnC,oEAAoE;IACpE,SAAgB,KAAK,EAAE,cAAc,CAAA;IACrC,uEAAuE;IACvE,SAAgB,KAAK,EAAE,cAAc,CAAA;IACrC,yEAAyE;IACzE,SAAgB,aAAa,EAAE,sBAAsB,CAAA;IACrD,kEAAkE;IAClE,SAAgB,UAAU,EAAE,mBAAmB,CAAA;IAC/C,iFAAiF;IACjF,SAAgB,iBAAiB,EAAE,0BAA0B,CAAA;;CAG9D;AAED,cAAc,qBAAqB,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
@@ -1,259 +0,0 @@
1
- import * as z from "zod";
2
- import { PluginApiReturn } from "../../types";
3
- /**
4
- * Reference line management — create, query, and delete reference lines.
5
- *
6
- * A **reference line** is a 2D guide line (or arc) in the Snaptrude scene,
7
- * typically used for grid lines and alignment guides. Reference lines
8
- * carry properties such as grid tags, labels, and line styles.
9
- *
10
- * All methods are **host API calls** that return Promises and support
11
- * undo/redo via Snaptrude's command system.
12
- *
13
- * Accessed via `snaptrude.entity.referenceLine`.
14
- */
15
- export declare abstract class PluginReferenceLineApi {
16
- constructor();
17
- /**
18
- * Create multiple reference lines from a profile.
19
- *
20
- * Each {@linkcode PCurve} in the given {@linkcode PProfile} becomes
21
- * a separate reference line. Uses `ReferenceLineConstructor.createFromProfile`
22
- * internally.
23
- *
24
- * @param args - An object containing:
25
- * - {@linkcode PluginReferenceLineCreateMultiArgs.profile args.profile} — A
26
- * {@linkcode PProfile} whose curves define the reference lines to create
27
- * @returns A {@linkcode PluginReferenceLineCreateMultiResult} with the
28
- * `referenceLineIds` of the created reference lines
29
- * @throws If reference line creation fails
30
- *
31
- * # Example
32
- * ```ts
33
- * const { vec3 } = snaptrude.core.math
34
- *
35
- * const l1 = snaptrude.core.geom.line.new(vec3.new(0, 0, 0), vec3.new(10, 0, 0))
36
- * const l2 = snaptrude.core.geom.line.new(vec3.new(10, 0, 0), vec3.new(10, 0, 10))
37
- * const profile = snaptrude.core.geom.profile.new([l1, l2])
38
- *
39
- * const { referenceLineIds } = await snaptrude.entity.referenceLine.createMulti({
40
- * profile,
41
- * })
42
- * ```
43
- */
44
- abstract createMulti(args: PluginReferenceLineCreateMultiArgs): PluginApiReturn<PluginReferenceLineCreateMultiResult>;
45
- /**
46
- * Get properties of a reference line by its ID.
47
- *
48
- * Only the properties listed in {@linkcode PluginReferenceLineGetArgs.properties
49
- * args.properties} are returned — unlisted properties will be `undefined`
50
- * in the result.
51
- *
52
- * @param args - An object containing:
53
- * - {@linkcode PluginReferenceLineGetArgs.referenceLineId args.referenceLineId} —
54
- * The unique reference line ID
55
- * - {@linkcode PluginReferenceLineGetArgs.properties args.properties} — Array of
56
- * property names to retrieve. See {@linkcode PluginReferenceLineGetProperty}.
57
- * @returns A partial {@linkcode PluginReferenceLineGetResult} containing only the
58
- * requested properties
59
- * @throws If the reference line does not exist
60
- *
61
- * # Example
62
- * ```ts
63
- * const result = await snaptrude.entity.referenceLine.get({
64
- * referenceLineId: "some-ref-line-id",
65
- * properties: ["curve"],
66
- * })
67
- * console.log(result.curve) // PCurve
68
- * ```
69
- */
70
- abstract get(args: PluginReferenceLineGetArgs): PluginApiReturn<PluginReferenceLineGetResult>;
71
- /**
72
- * Get the IDs of all reference lines in the current project.
73
- *
74
- * Returns every reference line across all stories.
75
- * Use the returned IDs with {@linkcode PluginReferenceLineApi.get} to query
76
- * individual reference line properties.
77
- *
78
- * @returns A {@linkcode PluginReferenceLineGetAllResult} with a
79
- * `referenceLineIds` array
80
- *
81
- * # Example
82
- * ```ts
83
- * const { referenceLineIds } = await snaptrude.entity.referenceLine.getAll()
84
- * console.log(`Project has ${referenceLineIds.length} reference lines`)
85
- * ```
86
- */
87
- abstract getAll(): PluginApiReturn<PluginReferenceLineGetAllResult>;
88
- /**
89
- * Delete a reference line by its ID.
90
- *
91
- * Permanently removes the reference line and its associated mesh from
92
- * the scene. This operation is undoable via Snaptrude's command system.
93
- *
94
- * @param args - An object containing:
95
- * - {@linkcode PluginReferenceLineDeleteArgs.referenceLineId args.referenceLineId} —
96
- * The unique reference line ID to delete
97
- * @throws If the reference line does not exist
98
- *
99
- * # Example
100
- * ```ts
101
- * await snaptrude.entity.referenceLine.delete({
102
- * referenceLineId: "some-ref-line-id",
103
- * })
104
- * ```
105
- */
106
- abstract delete(args: PluginReferenceLineDeleteArgs): PluginApiReturn<PluginReferenceLineDeleteResult>;
107
- }
108
- /**
109
- * Arguments for {@linkcode PluginReferenceLineApi.createMulti}.
110
- *
111
- * | Property | Type | Description |
112
- * |---|---|---|
113
- * | `profile` | {@linkcode PProfile} | Profile whose curves define reference lines |
114
- */
115
- export declare const PluginReferenceLineCreateMultiArgs: z.ZodObject<{
116
- profile: z.ZodObject<{
117
- curves: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
118
- curveType: z.ZodLiteral<"Line">;
119
- startPoint: z.ZodObject<{
120
- x: z.ZodNumber;
121
- y: z.ZodNumber;
122
- z: z.ZodNumber;
123
- }, z.core.$strip>;
124
- endPoint: z.ZodObject<{
125
- x: z.ZodNumber;
126
- y: z.ZodNumber;
127
- z: z.ZodNumber;
128
- }, z.core.$strip>;
129
- }, z.core.$strip>, z.ZodObject<{
130
- curveType: z.ZodLiteral<"Arc">;
131
- startPoint: z.ZodObject<{
132
- x: z.ZodNumber;
133
- y: z.ZodNumber;
134
- z: z.ZodNumber;
135
- }, z.core.$strip>;
136
- endPoint: z.ZodObject<{
137
- x: z.ZodNumber;
138
- y: z.ZodNumber;
139
- z: z.ZodNumber;
140
- }, z.core.$strip>;
141
- centrePoint: z.ZodObject<{
142
- x: z.ZodNumber;
143
- y: z.ZodNumber;
144
- z: z.ZodNumber;
145
- }, z.core.$strip>;
146
- axis: z.ZodObject<{
147
- x: z.ZodNumber;
148
- y: z.ZodNumber;
149
- z: z.ZodNumber;
150
- }, z.core.$strip>;
151
- }, z.core.$strip>], "curveType">>;
152
- }, z.core.$strip>;
153
- }, z.core.$strip>;
154
- export type PluginReferenceLineCreateMultiArgs = z.infer<typeof PluginReferenceLineCreateMultiArgs>;
155
- /**
156
- * Result of {@linkcode PluginReferenceLineApi.createMulti}.
157
- *
158
- * | Property | Type | Description |
159
- * |---|---|---|
160
- * | `referenceLineIds` | `string[]` | IDs of the created reference lines |
161
- */
162
- export declare const PluginReferenceLineCreateMultiResult: z.ZodObject<{
163
- referenceLineIds: z.ZodArray<z.ZodString>;
164
- }, z.core.$strip>;
165
- export type PluginReferenceLineCreateMultiResult = z.infer<typeof PluginReferenceLineCreateMultiResult>;
166
- /**
167
- * Available properties that can be queried on a reference line.
168
- *
169
- * | Value | Return Type | Description |
170
- * |---|---|---|
171
- * | `"curve"` | {@linkcode PCurve} | The curve geometry of the reference line |
172
- */
173
- export declare const PluginReferenceLineGetProperty: z.ZodEnum<{
174
- curve: "curve";
175
- }>;
176
- /**
177
- * Arguments for {@linkcode PluginReferenceLineApi.get}.
178
- *
179
- * | Property | Type | Description |
180
- * |---|---|---|
181
- * | `referenceLineId` | `string` | The reference line ID to query |
182
- * | `properties` | {@linkcode PluginReferenceLineGetProperty}`[]` | Properties to retrieve |
183
- */
184
- export declare const PluginReferenceLineGetArgs: z.ZodObject<{
185
- referenceLineId: z.ZodString;
186
- properties: z.ZodArray<z.ZodEnum<{
187
- curve: "curve";
188
- }>>;
189
- }, z.core.$strip>;
190
- export type PluginReferenceLineGetArgs = z.infer<typeof PluginReferenceLineGetArgs>;
191
- /**
192
- * Result of {@linkcode PluginReferenceLineApi.get}.
193
- *
194
- * A partial object — only the properties that were requested in
195
- * {@linkcode PluginReferenceLineGetArgs.properties} will be present.
196
- */
197
- export declare const PluginReferenceLineGetResult: z.ZodObject<{
198
- curve: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
199
- curveType: z.ZodLiteral<"Line">;
200
- startPoint: z.ZodObject<{
201
- x: z.ZodNumber;
202
- y: z.ZodNumber;
203
- z: z.ZodNumber;
204
- }, z.core.$strip>;
205
- endPoint: z.ZodObject<{
206
- x: z.ZodNumber;
207
- y: z.ZodNumber;
208
- z: z.ZodNumber;
209
- }, z.core.$strip>;
210
- }, z.core.$strip>, z.ZodObject<{
211
- curveType: z.ZodLiteral<"Arc">;
212
- startPoint: z.ZodObject<{
213
- x: z.ZodNumber;
214
- y: z.ZodNumber;
215
- z: z.ZodNumber;
216
- }, z.core.$strip>;
217
- endPoint: z.ZodObject<{
218
- x: z.ZodNumber;
219
- y: z.ZodNumber;
220
- z: z.ZodNumber;
221
- }, z.core.$strip>;
222
- centrePoint: z.ZodObject<{
223
- x: z.ZodNumber;
224
- y: z.ZodNumber;
225
- z: z.ZodNumber;
226
- }, z.core.$strip>;
227
- axis: z.ZodObject<{
228
- x: z.ZodNumber;
229
- y: z.ZodNumber;
230
- z: z.ZodNumber;
231
- }, z.core.$strip>;
232
- }, z.core.$strip>], "curveType">>;
233
- }, z.core.$strip>;
234
- export type PluginReferenceLineGetResult = z.infer<typeof PluginReferenceLineGetResult>;
235
- /**
236
- * Result of {@linkcode PluginReferenceLineApi.getAll}.
237
- *
238
- * | Property | Type | Description |
239
- * |---|---|---|
240
- * | `referenceLineIds` | `string[]` | IDs of all reference lines in the project |
241
- */
242
- export declare const PluginReferenceLineGetAllResult: z.ZodObject<{
243
- referenceLineIds: z.ZodArray<z.ZodString>;
244
- }, z.core.$strip>;
245
- export type PluginReferenceLineGetAllResult = z.infer<typeof PluginReferenceLineGetAllResult>;
246
- /**
247
- * Arguments for {@linkcode PluginReferenceLineApi.delete}.
248
- *
249
- * | Property | Type | Description |
250
- * |---|---|---|
251
- * | `referenceLineId` | `string` | The reference line ID to delete |
252
- */
253
- export declare const PluginReferenceLineDeleteArgs: z.ZodObject<{
254
- referenceLineId: z.ZodString;
255
- }, z.core.$strip>;
256
- export type PluginReferenceLineDeleteArgs = z.infer<typeof PluginReferenceLineDeleteArgs>;
257
- /** Result type for {@linkcode PluginReferenceLineApi.delete} — returns nothing on success. */
258
- export type PluginReferenceLineDeleteResult = void;
259
- //# sourceMappingURL=referenceLine.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"referenceLine.d.ts","sourceRoot":"","sources":["../../../src/api/entity/referenceLine.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAI7C;;;;;;;;;;;GAWG;AACH,8BAAsB,sBAAsB;;IAG1C;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;aACa,WAAW,CACzB,IAAI,EAAE,kCAAkC,GACvC,eAAe,CAAC,oCAAoC,CAAC;IAExD;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,GAAG,CACjB,IAAI,EAAE,0BAA0B,GAC/B,eAAe,CAAC,4BAA4B,CAAC;IAEhD;;;;;;;;;;;;;;;OAeG;aACa,MAAM,IAAI,eAAe,CAAC,+BAA+B,CAAC;IAE1E;;;;;;;;;;;;;;;;;OAiBG;aACa,MAAM,CACpB,IAAI,EAAE,6BAA6B,GAClC,eAAe,CAAC,+BAA+B,CAAC;CACpD;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAE7C,CAAA;AAEF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAA;AAEnG;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC;;iBAE/C,CAAA;AAEF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAA;AAEvG;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;;EAEzC,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B;;;;;iBAGrC,CAAA;AAEF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI7B,CAAA;AAEZ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AAEvF;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B;;iBAE1C,CAAA;AAEF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAE7F;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6B;;iBAExC,CAAA;AAEF,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAA;AAEzF,8FAA8F;AAC9F,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAA"}