@snaptrude/plugin-core 0.7.1 → 0.8.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.
Files changed (130) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/api-manifest.full.json +6442 -0
  3. package/api-manifest.json +2029 -128
  4. package/dist/api/core/camera/index.d.ts +208 -0
  5. package/dist/api/core/camera/index.d.ts.map +1 -0
  6. package/dist/api/core/comment/index.d.ts +105 -2
  7. package/dist/api/core/comment/index.d.ts.map +1 -1
  8. package/dist/api/core/geom/create/index.d.ts +13 -13
  9. package/dist/api/core/geom/delete/index.d.ts +8 -2
  10. package/dist/api/core/geom/delete/index.d.ts.map +1 -1
  11. package/dist/api/core/geom/query/arc.d.ts +5 -5
  12. package/dist/api/core/geom/query/brep.d.ts +18 -18
  13. package/dist/api/core/geom/query/circle.d.ts +18 -18
  14. package/dist/api/core/geom/query/contour.d.ts +20 -20
  15. package/dist/api/core/geom/query/curve.d.ts +49 -49
  16. package/dist/api/core/geom/query/edge.d.ts +5 -5
  17. package/dist/api/core/geom/query/face.d.ts +16 -16
  18. package/dist/api/core/geom/query/halfedge.d.ts +8 -8
  19. package/dist/api/core/geom/query/profile.d.ts +19 -19
  20. package/dist/api/core/geom/query/vertex.d.ts +8 -8
  21. package/dist/api/core/geom/update/contour.d.ts +14 -14
  22. package/dist/api/core/geom/update/curve.d.ts +7 -7
  23. package/dist/api/core/geom/update/profile.d.ts +16 -16
  24. package/dist/api/core/handles/index.d.ts +210 -0
  25. package/dist/api/core/handles/index.d.ts.map +1 -0
  26. package/dist/api/core/index.d.ts +15 -0
  27. package/dist/api/core/index.d.ts.map +1 -1
  28. package/dist/api/core/io/export/index.d.ts +132 -0
  29. package/dist/api/core/io/export/index.d.ts.map +1 -0
  30. package/dist/api/core/io/import/index.d.ts +1 -1
  31. package/dist/api/core/io/index.d.ts +5 -0
  32. package/dist/api/core/io/index.d.ts.map +1 -1
  33. package/dist/api/core/layers.d.ts +7 -7
  34. package/dist/api/core/proposals/index.d.ts +65 -9
  35. package/dist/api/core/proposals/index.d.ts.map +1 -1
  36. package/dist/api/core/user.d.ts +44 -0
  37. package/dist/api/core/user.d.ts.map +1 -0
  38. package/dist/api/design/boolean/index.d.ts +4 -4
  39. package/dist/api/design/create/index.d.ts +139 -44
  40. package/dist/api/design/create/index.d.ts.map +1 -1
  41. package/dist/api/design/doors/index.d.ts +36 -0
  42. package/dist/api/design/doors/index.d.ts.map +1 -1
  43. package/dist/api/design/edit/index.d.ts +1 -1
  44. package/dist/api/design/erase/index.d.ts +2 -2
  45. package/dist/api/design/furniture/index.d.ts +114 -3
  46. package/dist/api/design/furniture/index.d.ts.map +1 -1
  47. package/dist/api/design/index.d.ts +10 -0
  48. package/dist/api/design/index.d.ts.map +1 -1
  49. package/dist/api/design/materials/index.d.ts +111 -14
  50. package/dist/api/design/materials/index.d.ts.map +1 -1
  51. package/dist/api/design/query/index.d.ts +31 -1
  52. package/dist/api/design/query/index.d.ts.map +1 -1
  53. package/dist/api/design/query/spaces.d.ts +5 -5
  54. package/dist/api/design/transform/index.d.ts +83 -14
  55. package/dist/api/design/transform/index.d.ts.map +1 -1
  56. package/dist/api/design/types/index.d.ts +181 -0
  57. package/dist/api/design/types/index.d.ts.map +1 -0
  58. package/dist/api/design/update/index.d.ts +335 -2
  59. package/dist/api/design/update/index.d.ts.map +1 -1
  60. package/dist/api/design/visibility.d.ts +98 -0
  61. package/dist/api/design/visibility.d.ts.map +1 -0
  62. package/dist/api/entity/referenceLine.d.ts +2 -2
  63. package/dist/api/entity/space.d.ts +19 -19
  64. package/dist/api/entity/story.d.ts +128 -15
  65. package/dist/api/entity/story.d.ts.map +1 -1
  66. package/dist/api/presentation/annotate.d.ts +448 -0
  67. package/dist/api/presentation/annotate.d.ts.map +1 -0
  68. package/dist/api/presentation/diagrams.d.ts +49 -8
  69. package/dist/api/presentation/diagrams.d.ts.map +1 -1
  70. package/dist/api/presentation/export.d.ts +104 -0
  71. package/dist/api/presentation/export.d.ts.map +1 -0
  72. package/dist/api/presentation/index.d.ts +38 -0
  73. package/dist/api/presentation/index.d.ts.map +1 -1
  74. package/dist/api/presentation/sheets.d.ts +410 -13
  75. package/dist/api/presentation/sheets.d.ts.map +1 -1
  76. package/dist/api/presentation/views.d.ts +165 -10
  77. package/dist/api/presentation/views.d.ts.map +1 -1
  78. package/dist/api/program/areas.d.ts +63 -3
  79. package/dist/api/program/areas.d.ts.map +1 -1
  80. package/dist/api/program/cores.d.ts +3 -99
  81. package/dist/api/program/cores.d.ts.map +1 -1
  82. package/dist/api/program/index.d.ts +2 -2
  83. package/dist/api/program/index.d.ts.map +1 -1
  84. package/dist/api/program/layout.d.ts +172 -12
  85. package/dist/api/program/layout.d.ts.map +1 -1
  86. package/dist/api/program/site.d.ts +11 -8
  87. package/dist/api/program/site.d.ts.map +1 -1
  88. package/dist/api/program/spreadsheet.d.ts +105 -13
  89. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  90. package/dist/handles.d.ts +64 -25
  91. package/dist/handles.d.ts.map +1 -1
  92. package/dist/index.cjs +2316 -1644
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/index.js +2224 -1639
  95. package/dist/index.js.map +1 -1
  96. package/package.json +1 -1
  97. package/src/api/core/camera/index.ts +212 -0
  98. package/src/api/core/comment/index.ts +120 -2
  99. package/src/api/core/geom/delete/index.ts +6 -0
  100. package/src/api/core/handles/index.ts +233 -0
  101. package/src/api/core/index.ts +15 -0
  102. package/src/api/core/io/export/index.ts +124 -0
  103. package/src/api/core/io/index.ts +5 -0
  104. package/src/api/core/proposals/index.ts +71 -11
  105. package/src/api/core/user.ts +46 -0
  106. package/src/api/design/create/index.ts +166 -36
  107. package/src/api/design/doors/index.ts +40 -0
  108. package/src/api/design/furniture/index.ts +127 -3
  109. package/src/api/design/index.ts +10 -0
  110. package/src/api/design/materials/index.ts +157 -30
  111. package/src/api/design/query/index.ts +33 -7
  112. package/src/api/design/transform/index.ts +89 -12
  113. package/src/api/design/types/index.ts +156 -0
  114. package/src/api/design/update/index.ts +402 -6
  115. package/src/api/design/visibility.ts +109 -0
  116. package/src/api/entity/story.ts +141 -15
  117. package/src/api/presentation/annotate.ts +360 -0
  118. package/src/api/presentation/diagrams.ts +53 -8
  119. package/src/api/presentation/export.ts +104 -0
  120. package/src/api/presentation/index.ts +46 -0
  121. package/src/api/presentation/sheets.ts +346 -13
  122. package/src/api/presentation/views.ts +164 -12
  123. package/src/api/program/areas.ts +57 -6
  124. package/src/api/program/cores.ts +3 -91
  125. package/src/api/program/index.ts +2 -2
  126. package/src/api/program/layout.ts +182 -12
  127. package/src/api/program/site.ts +11 -8
  128. package/src/api/program/spreadsheet.ts +125 -29
  129. package/src/handles.ts +77 -13
  130. package/tsconfig.json +7 -2
@@ -87,8 +87,8 @@ export type PluginDesignQueryGetFootprintArgs = z.infer<typeof PluginDesignQuery
87
87
  export declare const PluginDesignQuerySpacesGetProperty: z.ZodEnum<{
88
88
  profile: "profile";
89
89
  type: "type";
90
- position: "position";
91
90
  id: "id";
91
+ position: "position";
92
92
  name: "name";
93
93
  storey: "storey";
94
94
  height: "height";
@@ -123,8 +123,8 @@ export declare const PluginDesignQuerySpacesGetArgs: z.ZodObject<{
123
123
  properties: z.ZodArray<z.ZodEnum<{
124
124
  profile: "profile";
125
125
  type: "type";
126
- position: "position";
127
126
  id: "id";
127
+ position: "position";
128
128
  name: "name";
129
129
  storey: "storey";
130
130
  height: "height";
@@ -153,19 +153,19 @@ export type PluginDesignQuerySpacesGetArgs = z.infer<typeof PluginDesignQuerySpa
153
153
  * requested properties are present.
154
154
  */
155
155
  export declare const PluginDesignQuerySpacesGetResult: z.ZodObject<{
156
- profile: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<import("../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<import("../../..").Handle<"arc">, string>>]>>>;
156
+ profile: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"arc">, string>>]>>>;
157
157
  type: z.ZodOptional<z.ZodString>;
158
+ id: z.ZodOptional<z.ZodString>;
158
159
  position: z.ZodOptional<z.ZodObject<{
159
160
  x: z.ZodNumber;
160
161
  y: z.ZodNumber;
161
162
  z: z.ZodNumber;
162
163
  }, z.core.$strip>>;
163
- id: z.ZodOptional<z.ZodString>;
164
164
  name: z.ZodOptional<z.ZodString>;
165
165
  storey: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
166
166
  height: z.ZodOptional<z.ZodNumber>;
167
167
  depth: z.ZodOptional<z.ZodNumber>;
168
- innerProfiles: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<import("../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<import("../../..").Handle<"arc">, string>>]>>>>;
168
+ innerProfiles: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"arc">, string>>]>>>>;
169
169
  room_type: z.ZodOptional<z.ZodString>;
170
170
  area: z.ZodOptional<z.ZodNumber>;
171
171
  breadth: z.ZodOptional<z.ZodNumber>;
@@ -6,12 +6,12 @@ import { PluginDesignChangeResult } from "../lock";
6
6
  * `snaptrude.design.transform` — rigid transforms on scene entities.
7
7
  *
8
8
  * `move` / `rotate` migrated from the removed `tools.transform.*`; `align` snaps a
9
- * set of components' bounding-box edges to each other (or to a reference). All ops
10
- * are undoable and return {@linkcode PluginDesignChangeResult} `{ affected }`;
11
- * failures throw (RPC rejects).
9
+ * set of components' bounding-box edges to each other (or to a reference); `mirror`
10
+ * flips components in place about a horizontal axis. All ops are undoable and return
11
+ * {@linkcode PluginDesignChangeResult} `{ affected }`; failures throw (RPC rejects).
12
12
  *
13
- * `mirror` / `getPosition` / `setPosition` (and `scale`, an engine gap) are NOT in
14
- * this surface yet — they are a later, non-migration pass.
13
+ * `getPosition` / `setPosition` (and `scale`, an engine gap) are NOT in this surface
14
+ * yet — they are a later pass.
15
15
  */
16
16
  export declare abstract class PluginDesignTransformApi {
17
17
  constructor();
@@ -41,28 +41,36 @@ export declare abstract class PluginDesignTransformApi {
41
41
  trackParentChange?: boolean;
42
42
  }): PluginApiReturn<PluginDesignChangeResult>;
43
43
  /**
44
- * Rotate entities by a **signed angle in DEGREES**, anchored at the combined
45
- * bounding-box centre (positive = CCW about +Y). NOTE: unlike the removed
46
- * `tools.transform.rotate` (radians + caller pivot), this canonical form takes
47
- * DEGREES and has NO caller pivot — the pivot is always the bbox centre. Undoable.
44
+ * Rotate entities by a **signed angle in DEGREES** (positive = CCW about +Y).
45
+ * The pivot defaults to the combined bounding-box centre; pass `options.pivot`
46
+ * to rotate about an explicit world-space point instead. NOTE: unlike the
47
+ * removed `tools.transform.rotate` (radians), this canonical form takes
48
+ * DEGREES. Undoable.
48
49
  *
49
50
  * @param components - Entities to rotate
50
51
  * @param angleInDegrees - Signed rotation angle in degrees
51
- * @param options - `axis` (defaults to world +Y), `is2D`
52
+ * @param options - `axis` (defaults to world +Y), `pivot` (world-space rotation
53
+ * centre as a {@linkcode Vec3Handle}; defaults to the combined bbox centre),
54
+ * `is2D`
52
55
  * @returns {@linkcode PluginDesignChangeResult}
53
56
  *
54
57
  * @examplePrompt Rotate the selected building 90 degrees
55
58
  * @examplePrompt Turn this room 45 degrees clockwise
56
59
  * @examplePrompt Spin the furniture block 180 degrees about its centre
57
60
  * @examplePrompt Rotate these masses 30 degrees around the vertical axis
61
+ * @examplePrompt Rotate these walls 90 degrees about the origin
58
62
  *
59
63
  * # Example
60
64
  * ```ts
61
65
  * await snaptrude.design.transform.rotate(["space-id"], 90)
66
+ * // …or rotate about an explicit pivot point
67
+ * const { vec3 } = snaptrude.core.math
68
+ * await snaptrude.design.transform.rotate(["space-id"], 90, { pivot: vec3.new(0, 0, 0) })
62
69
  * ```
63
70
  */
64
71
  abstract rotate(components: ComponentHandle[], angleInDegrees: number, options?: {
65
72
  axis?: Vec3Handle;
73
+ pivot?: Vec3Handle;
66
74
  is2D?: boolean;
67
75
  }): PluginApiReturn<PluginDesignChangeResult>;
68
76
  /**
@@ -108,7 +116,51 @@ export declare abstract class PluginDesignTransformApi {
108
116
  abstract align(components: ComponentHandle[], edge: PluginAlignEdge, options?: {
109
117
  reference?: ComponentHandle;
110
118
  }): PluginApiReturn<PluginDesignChangeResult>;
119
+ /**
120
+ * Mirror components **in place** about a horizontal axis, flipping their geometry
121
+ * across that axis through the combined bounding-box centre (the mesh's
122
+ * world-matrix flip + brep inversion + CAD/dimension-line/parametric handling
123
+ * commit atomically). Nothing moves off-centre — this is the toolbar "flip", not
124
+ * a translate-and-reflect. Undoable.
125
+ *
126
+ * `axis` names the axis the geometry mirrors **across** (world axes, Y is up):
127
+ * - `'x'` — mirror across world X (a front↔back flip in plan; reflects the Z coord)
128
+ * - `'z'` — mirror across world Z (a left↔right flip in plan; reflects the X coord)
129
+ *
130
+ * Vertical (`'y'`) mirroring is intentionally not exposed. Locked, bucket-locked
131
+ * and ineligible entries (terrain, plinths, reference/dimension lines,
132
+ * neighbourhood buildings) are **silently dropped**; the call only throws if
133
+ * nothing mirrorable remains. `affected` echoes the supplied handles.
134
+ *
135
+ * @param components - Entities to mirror (≥1)
136
+ * @param axis - Axis to mirror across ({@linkcode PluginTransformMirrorAxis})
137
+ * @returns {@linkcode PluginDesignChangeResult}
138
+ *
139
+ * @examplePrompt Mirror the selected building across the x axis
140
+ * @examplePrompt Flip these rooms left to right
141
+ * @examplePrompt Mirror this furniture block horizontally
142
+ * @examplePrompt Flip the selected walls front to back
143
+ * @examplePrompt Create a mirror image of these masses about the z axis
144
+ *
145
+ * # Example
146
+ * ```ts
147
+ * const rooms = await snaptrude.design.selection.get()
148
+ * await snaptrude.design.transform.mirror(rooms, "x")
149
+ * ```
150
+ */
151
+ abstract mirror(components: ComponentHandle[], axis: PluginTransformMirrorAxis): PluginApiReturn<PluginDesignChangeResult>;
111
152
  }
153
+ /**
154
+ * The horizontal axis a {@linkcode PluginDesignTransformApi.mirror} flips **across**
155
+ * (world axes, Y up): `'x'` mirrors across world X (front↔back in plan; reflects Z),
156
+ * `'z'` mirrors across world Z (left↔right in plan; reflects X). Vertical (`'y'`)
157
+ * mirroring is not exposed.
158
+ */
159
+ export declare const PluginTransformMirrorAxis: z.ZodEnum<{
160
+ x: "x";
161
+ z: "z";
162
+ }>;
163
+ export type PluginTransformMirrorAxis = z.infer<typeof PluginTransformMirrorAxis>;
112
164
  /**
113
165
  * The bounding-box edge an {@linkcode PluginDesignTransformApi.align} snaps to.
114
166
  * Mirrors the engine's align `DirectionType`. World-axis mapping: `left`/`right`/`center`
@@ -116,9 +168,9 @@ export declare abstract class PluginDesignTransformApi {
116
168
  */
117
169
  export declare const PluginAlignEdge: z.ZodEnum<{
118
170
  center: "center";
171
+ top: "top";
119
172
  left: "left";
120
173
  right: "right";
121
- top: "top";
122
174
  bottom: "bottom";
123
175
  middle: "middle";
124
176
  }>;
@@ -128,7 +180,7 @@ export type PluginAlignEdge = z.infer<typeof PluginAlignEdge>;
128
180
  */
129
181
  export declare const PluginDesignMoveArgs: z.ZodObject<{
130
182
  components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
131
- displacement: z.ZodPipe<z.ZodString, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
183
+ displacement: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>;
132
184
  is2D: z.ZodOptional<z.ZodBoolean>;
133
185
  trackParentChange: z.ZodOptional<z.ZodBoolean>;
134
186
  }, z.core.$strip>;
@@ -139,8 +191,9 @@ export type PluginDesignMoveArgs = z.infer<typeof PluginDesignMoveArgs>;
139
191
  export declare const PluginDesignRotateArgs: z.ZodObject<{
140
192
  components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
141
193
  angleInDegrees: z.ZodNumber;
142
- axis: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
194
+ axis: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
143
195
  is2D: z.ZodOptional<z.ZodBoolean>;
196
+ pivot: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../../..").Handle<"vec3">, string>>>;
144
197
  }, z.core.$strip>;
145
198
  export type PluginDesignRotateArgs = z.infer<typeof PluginDesignRotateArgs>;
146
199
  /**
@@ -156,13 +209,29 @@ export declare const PluginDesignAlignArgs: z.ZodObject<{
156
209
  components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
157
210
  edge: z.ZodEnum<{
158
211
  center: "center";
212
+ top: "top";
159
213
  left: "left";
160
214
  right: "right";
161
- top: "top";
162
215
  bottom: "bottom";
163
216
  middle: "middle";
164
217
  }>;
165
218
  reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
166
219
  }, z.core.$strip>;
167
220
  export type PluginDesignAlignArgs = z.infer<typeof PluginDesignAlignArgs>;
221
+ /**
222
+ * Arguments for {@linkcode PluginDesignTransformApi.mirror}.
223
+ *
224
+ * | Property | Type | Description |
225
+ * |---|---|---|
226
+ * | `components` | {@linkcode ComponentHandle}`[]` | Entities to mirror (≥1) |
227
+ * | `axis` | {@linkcode PluginTransformMirrorAxis} | Horizontal axis to mirror across (`'x'` \| `'z'`) |
228
+ */
229
+ export declare const PluginDesignMirrorArgs: z.ZodObject<{
230
+ components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
231
+ axis: z.ZodEnum<{
232
+ x: "x";
233
+ z: "z";
234
+ }>;
235
+ }, z.core.$strip>;
236
+ export type PluginDesignMirrorArgs = z.infer<typeof PluginDesignMirrorArgs>;
168
237
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/transform/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;;;;;;GAUG;AACH,8BAAsB,wBAAwB;;IAG5C;;;;;;;;;;;;;;;;;;;;OAoBG;aACa,IAAI,CAClB,UAAU,EAAE,eAAe,EAAE,EAC7B,YAAY,EAAE,UAAU,EACxB,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAAE,GACxD,eAAe,CAAC,wBAAwB,CAAC;IAE5C;;;;;;;;;;;;;;;;;;;;OAoBG;aACa,MAAM,CACpB,UAAU,EAAE,eAAe,EAAE,EAC7B,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,UAAU,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAC9C,eAAe,CAAC,wBAAwB,CAAC;IAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;aACa,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MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;iBAIhC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE;;;;;;;GAOG;AACH,eAAO,MAAM,sBAAsB;;;;;;iBAGjC,CAAA;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA"}
@@ -0,0 +1,181 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../../types";
3
+ /**
4
+ * `snaptrude.design.types` — READ-ONLY reference over the project's building
5
+ * **type / assembly** system (the Project Properties layer stacks: External /
6
+ * Internal walls, slabs, floors, ceilings, roofs). A type bundles a labelled
7
+ * layer stack — each layer's role, thickness (engine units) and material — plus a
8
+ * summed total thickness. Both the built-in defaults and any team/user-added types
9
+ * are surfaced.
10
+ *
11
+ * Types are plain value records ({@linkcode PluginBuildingType}) — NOT scene
12
+ * entities/handles. A type's `id` is a stable `"<kind>:<name>"` token
13
+ * (e.g. `"wall:brickWithPlasterAndPaint"`) returned by
14
+ * {@linkcode PluginDesignTypesApi.list} and consumed by
15
+ * {@linkcode PluginDesignTypesApi.get}. Reads never throw — an unknown id yields
16
+ * `null`; a kind with no types yields `[]`.
17
+ *
18
+ * These are reads only: there is no engine seam to author a type from a plugin
19
+ * (types are created through the construction/project-properties UI).
20
+ */
21
+ export declare abstract class PluginDesignTypesApi {
22
+ constructor();
23
+ /**
24
+ * List the building types of one `kind` (wall / slab / floor / ceiling / roof)
25
+ * — the built-in defaults plus any team/user-added types. Returns lightweight
26
+ * summaries; call {@linkcode PluginDesignTypesApi.get} for the full layer stack.
27
+ *
28
+ * @param kind Which family of types to list
29
+ * @returns The type summaries as {@linkcode PluginBuildingTypeSummary}`[]` (`[]` when none)
30
+ *
31
+ * @examplePrompt What wall types does this project have?
32
+ * @examplePrompt List the available slab assemblies
33
+ * @examplePrompt Show me every roof type in the project
34
+ * @examplePrompt Which floor types can I use?
35
+ *
36
+ * # Example
37
+ * ```ts
38
+ * const wallTypes = await snaptrude.design.types.list("wall")
39
+ * for (const t of wallTypes) console.log(t.id, t.label, t.thickness)
40
+ * ```
41
+ */
42
+ abstract list(kind: PluginBuildingTypeKind): PluginApiReturn<PluginBuildingTypeSummary[]>;
43
+ /**
44
+ * Get one building type by its `"<kind>:<name>"` id — its labelled layer stack
45
+ * (each layer's role, thickness and material) plus the summed total thickness.
46
+ *
47
+ * @param typeId The type id from {@linkcode PluginDesignTypesApi.list} (e.g. `"wall:exposedConcrete"`)
48
+ * @returns The full type, or `null` if no type matches
49
+ *
50
+ * @examplePrompt What layers make up this wall type?
51
+ * @examplePrompt Show the construction of the exposed-concrete wall
52
+ * @examplePrompt What's the total thickness of this slab type?
53
+ * @examplePrompt Which materials are in this roof assembly?
54
+ *
55
+ * # Example
56
+ * ```ts
57
+ * const [first] = await snaptrude.design.types.list("wall")
58
+ * const type = await snaptrude.design.types.get(first.id)
59
+ * if (type) for (const layer of type.layers) console.log(layer.name, layer.thickness)
60
+ * ```
61
+ */
62
+ abstract get(typeId: string): PluginApiReturn<PluginBuildingType | null>;
63
+ }
64
+ /** The building-type families exposed by {@linkcode PluginDesignTypesApi}. */
65
+ export declare const PluginBuildingTypeKind: z.ZodEnum<{
66
+ floor: "floor";
67
+ wall: "wall";
68
+ ceiling: "ceiling";
69
+ slab: "slab";
70
+ roof: "roof";
71
+ }>;
72
+ export type PluginBuildingTypeKind = z.infer<typeof PluginBuildingTypeKind>;
73
+ /**
74
+ * One layer of a building type's assembly.
75
+ *
76
+ * | Property | Type | Description |
77
+ * |---|---|---|
78
+ * | `name` | `string` | Layer name (e.g. `"RCC"`, `"Paint"`) |
79
+ * | `role` | `string` | Layer role (e.g. `"Structure"`, `"Finish"`) |
80
+ * | `thickness` | `number` | Layer thickness in engine units (project's active unit mode) |
81
+ * | `material` | `object`? | Layer material — `{ name, type }` (optional) |
82
+ */
83
+ export declare const PluginTypeLayer: z.ZodObject<{
84
+ name: z.ZodString;
85
+ role: z.ZodString;
86
+ thickness: z.ZodNumber;
87
+ material: z.ZodOptional<z.ZodObject<{
88
+ name: z.ZodString;
89
+ type: z.ZodString;
90
+ }, z.core.$strip>>;
91
+ }, z.core.$strip>;
92
+ export type PluginTypeLayer = z.infer<typeof PluginTypeLayer>;
93
+ /**
94
+ * A lightweight building-type summary (no layer stack).
95
+ *
96
+ * | Property | Type | Description |
97
+ * |---|---|---|
98
+ * | `id` | `string` | Stable `"<kind>:<name>"` token — pass to `design.types.get` |
99
+ * | `kind` | {@linkcode PluginBuildingTypeKind} | Which family it belongs to |
100
+ * | `label` | `string` | Human-readable label |
101
+ * | `isDefault` | `boolean` | `true` for a built-in type, `false` for a team/user type |
102
+ * | `thickness` | `number` | Summed layer thickness in engine units |
103
+ */
104
+ export declare const PluginBuildingTypeSummary: z.ZodObject<{
105
+ id: z.ZodString;
106
+ kind: z.ZodEnum<{
107
+ floor: "floor";
108
+ wall: "wall";
109
+ ceiling: "ceiling";
110
+ slab: "slab";
111
+ roof: "roof";
112
+ }>;
113
+ label: z.ZodString;
114
+ isDefault: z.ZodBoolean;
115
+ thickness: z.ZodNumber;
116
+ }, z.core.$strip>;
117
+ export type PluginBuildingTypeSummary = z.infer<typeof PluginBuildingTypeSummary>;
118
+ /**
119
+ * A full building type — a {@linkcode PluginBuildingTypeSummary} plus its layer stack.
120
+ *
121
+ * | Property | Type | Description |
122
+ * |---|---|---|
123
+ * | `id` | `string` | Stable `"<kind>:<name>"` token |
124
+ * | `kind` | {@linkcode PluginBuildingTypeKind} | Which family it belongs to |
125
+ * | `label` | `string` | Human-readable label |
126
+ * | `isDefault` | `boolean` | `true` for a built-in type |
127
+ * | `thickness` | `number` | Summed layer thickness in engine units |
128
+ * | `layers` | {@linkcode PluginTypeLayer}`[]` | The ordered layer stack |
129
+ */
130
+ export declare const PluginBuildingType: z.ZodObject<{
131
+ id: z.ZodString;
132
+ kind: z.ZodEnum<{
133
+ floor: "floor";
134
+ wall: "wall";
135
+ ceiling: "ceiling";
136
+ slab: "slab";
137
+ roof: "roof";
138
+ }>;
139
+ label: z.ZodString;
140
+ isDefault: z.ZodBoolean;
141
+ thickness: z.ZodNumber;
142
+ layers: z.ZodArray<z.ZodObject<{
143
+ name: z.ZodString;
144
+ role: z.ZodString;
145
+ thickness: z.ZodNumber;
146
+ material: z.ZodOptional<z.ZodObject<{
147
+ name: z.ZodString;
148
+ type: z.ZodString;
149
+ }, z.core.$strip>>;
150
+ }, z.core.$strip>>;
151
+ }, z.core.$strip>;
152
+ export type PluginBuildingType = z.infer<typeof PluginBuildingType>;
153
+ /**
154
+ * Arguments for {@linkcode PluginDesignTypesApi.list}.
155
+ *
156
+ * | Property | Type | Description |
157
+ * |---|---|---|
158
+ * | `kind` | {@linkcode PluginBuildingTypeKind} | Which family of types to list |
159
+ */
160
+ export declare const PluginDesignTypesListArgs: z.ZodObject<{
161
+ kind: z.ZodEnum<{
162
+ floor: "floor";
163
+ wall: "wall";
164
+ ceiling: "ceiling";
165
+ slab: "slab";
166
+ roof: "roof";
167
+ }>;
168
+ }, z.core.$strip>;
169
+ export type PluginDesignTypesListArgs = z.infer<typeof PluginDesignTypesListArgs>;
170
+ /**
171
+ * Arguments for {@linkcode PluginDesignTypesApi.get}.
172
+ *
173
+ * | Property | Type | Description |
174
+ * |---|---|---|
175
+ * | `typeId` | `string` | The `"<kind>:<name>"` id from `design.types.list` |
176
+ */
177
+ export declare const PluginDesignTypesGetArgs: z.ZodObject<{
178
+ typeId: z.ZodString;
179
+ }, z.core.$strip>;
180
+ export type PluginDesignTypesGetArgs = z.infer<typeof PluginDesignTypesGetArgs>;
181
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src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