@snaptrude/plugin-core 0.0.0-bimsvg-20260928124803

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 (383) hide show
  1. package/AGENTS.md +231 -0
  2. package/CHANGELOG.md +341 -0
  3. package/CLAUDE.md +11 -0
  4. package/api-manifest.json +9120 -0
  5. package/dist/api/analysis/daylight.d.ts +603 -0
  6. package/dist/api/analysis/daylight.d.ts.map +1 -0
  7. package/dist/api/analysis/heatmaps.d.ts +658 -0
  8. package/dist/api/analysis/heatmaps.d.ts.map +1 -0
  9. package/dist/api/analysis/illuminance.d.ts +145 -0
  10. package/dist/api/analysis/illuminance.d.ts.map +1 -0
  11. package/dist/api/analysis/index.d.ts +59 -0
  12. package/dist/api/analysis/index.d.ts.map +1 -0
  13. package/dist/api/analysis/shadows.d.ts +165 -0
  14. package/dist/api/analysis/shadows.d.ts.map +1 -0
  15. package/dist/api/analysis/solar.d.ts +249 -0
  16. package/dist/api/analysis/solar.d.ts.map +1 -0
  17. package/dist/api/analysis/sunlightHours.d.ts +208 -0
  18. package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
  19. package/dist/api/analysis/sunpath.d.ts +80 -0
  20. package/dist/api/analysis/sunpath.d.ts.map +1 -0
  21. package/dist/api/analysis/weather.d.ts +193 -0
  22. package/dist/api/analysis/weather.d.ts.map +1 -0
  23. package/dist/api/core/buildings.d.ts +427 -0
  24. package/dist/api/core/buildings.d.ts.map +1 -0
  25. package/dist/api/core/camera/index.d.ts +261 -0
  26. package/dist/api/core/camera/index.d.ts.map +1 -0
  27. package/dist/api/core/comment/index.d.ts +333 -0
  28. package/dist/api/core/comment/index.d.ts.map +1 -0
  29. package/dist/api/core/geom/create/index.d.ts +1073 -0
  30. package/dist/api/core/geom/create/index.d.ts.map +1 -0
  31. package/dist/api/core/geom/delete/index.d.ts +78 -0
  32. package/dist/api/core/geom/delete/index.d.ts.map +1 -0
  33. package/dist/api/core/geom/index.d.ts +33 -0
  34. package/dist/api/core/geom/index.d.ts.map +1 -0
  35. package/dist/api/core/geom/query/arc.d.ts +169 -0
  36. package/dist/api/core/geom/query/arc.d.ts.map +1 -0
  37. package/dist/api/core/geom/query/brep.d.ts +514 -0
  38. package/dist/api/core/geom/query/brep.d.ts.map +1 -0
  39. package/dist/api/core/geom/query/circle.d.ts +378 -0
  40. package/dist/api/core/geom/query/circle.d.ts.map +1 -0
  41. package/dist/api/core/geom/query/contour.d.ts +450 -0
  42. package/dist/api/core/geom/query/contour.d.ts.map +1 -0
  43. package/dist/api/core/geom/query/curve.d.ts +918 -0
  44. package/dist/api/core/geom/query/curve.d.ts.map +1 -0
  45. package/dist/api/core/geom/query/edge.d.ts +128 -0
  46. package/dist/api/core/geom/query/edge.d.ts.map +1 -0
  47. package/dist/api/core/geom/query/face.d.ts +363 -0
  48. package/dist/api/core/geom/query/face.d.ts.map +1 -0
  49. package/dist/api/core/geom/query/halfedge.d.ts +206 -0
  50. package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
  51. package/dist/api/core/geom/query/index.d.ts +61 -0
  52. package/dist/api/core/geom/query/index.d.ts.map +1 -0
  53. package/dist/api/core/geom/query/profile.d.ts +410 -0
  54. package/dist/api/core/geom/query/profile.d.ts.map +1 -0
  55. package/dist/api/core/geom/query/vertex.d.ts +187 -0
  56. package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
  57. package/dist/api/core/geom/update/contour.d.ts +272 -0
  58. package/dist/api/core/geom/update/contour.d.ts.map +1 -0
  59. package/dist/api/core/geom/update/curve.d.ts +180 -0
  60. package/dist/api/core/geom/update/curve.d.ts.map +1 -0
  61. package/dist/api/core/geom/update/index.d.ts +27 -0
  62. package/dist/api/core/geom/update/index.d.ts.map +1 -0
  63. package/dist/api/core/geom/update/profile.d.ts +329 -0
  64. package/dist/api/core/geom/update/profile.d.ts.map +1 -0
  65. package/dist/api/core/groups.d.ts +485 -0
  66. package/dist/api/core/groups.d.ts.map +1 -0
  67. package/dist/api/core/handles/index.d.ts +210 -0
  68. package/dist/api/core/handles/index.d.ts.map +1 -0
  69. package/dist/api/core/history/index.d.ts +78 -0
  70. package/dist/api/core/history/index.d.ts.map +1 -0
  71. package/dist/api/core/index.d.ts +97 -0
  72. package/dist/api/core/index.d.ts.map +1 -0
  73. package/dist/api/core/io/export/index.d.ts +134 -0
  74. package/dist/api/core/io/export/index.d.ts.map +1 -0
  75. package/dist/api/core/io/import/index.d.ts +455 -0
  76. package/dist/api/core/io/import/index.d.ts.map +1 -0
  77. package/dist/api/core/io/index.d.ts +40 -0
  78. package/dist/api/core/io/index.d.ts.map +1 -0
  79. package/dist/api/core/io/job/index.d.ts +139 -0
  80. package/dist/api/core/io/job/index.d.ts.map +1 -0
  81. package/dist/api/core/io/query/index.d.ts +74 -0
  82. package/dist/api/core/io/query/index.d.ts.map +1 -0
  83. package/dist/api/core/io/terrain/index.d.ts +341 -0
  84. package/dist/api/core/io/terrain/index.d.ts.map +1 -0
  85. package/dist/api/core/io/underlay/index.d.ts +805 -0
  86. package/dist/api/core/io/underlay/index.d.ts.map +1 -0
  87. package/dist/api/core/layers.d.ts +402 -0
  88. package/dist/api/core/layers.d.ts.map +1 -0
  89. package/dist/api/core/math/index.d.ts +18 -0
  90. package/dist/api/core/math/index.d.ts.map +1 -0
  91. package/dist/api/core/math/quat.d.ts +170 -0
  92. package/dist/api/core/math/quat.d.ts.map +1 -0
  93. package/dist/api/core/math/vec3.d.ts +174 -0
  94. package/dist/api/core/math/vec3.d.ts.map +1 -0
  95. package/dist/api/core/mode/index.d.ts +111 -0
  96. package/dist/api/core/mode/index.d.ts.map +1 -0
  97. package/dist/api/core/project/index.d.ts +466 -0
  98. package/dist/api/core/project/index.d.ts.map +1 -0
  99. package/dist/api/core/proposals/index.d.ts +531 -0
  100. package/dist/api/core/proposals/index.d.ts.map +1 -0
  101. package/dist/api/core/storeys/index.d.ts +265 -0
  102. package/dist/api/core/storeys/index.d.ts.map +1 -0
  103. package/dist/api/core/tags.d.ts +860 -0
  104. package/dist/api/core/tags.d.ts.map +1 -0
  105. package/dist/api/core/units/index.d.ts +175 -0
  106. package/dist/api/core/units/index.d.ts.map +1 -0
  107. package/dist/api/core/user.d.ts +44 -0
  108. package/dist/api/core/user.d.ts.map +1 -0
  109. package/dist/api/core/zoom/index.d.ts +49 -0
  110. package/dist/api/core/zoom/index.d.ts.map +1 -0
  111. package/dist/api/design/boolean/index.d.ts +168 -0
  112. package/dist/api/design/boolean/index.d.ts.map +1 -0
  113. package/dist/api/design/create/bulk-items.d.ts +185 -0
  114. package/dist/api/design/create/bulk-items.d.ts.map +1 -0
  115. package/dist/api/design/create/grids.d.ts +132 -0
  116. package/dist/api/design/create/grids.d.ts.map +1 -0
  117. package/dist/api/design/create/index.d.ts +1747 -0
  118. package/dist/api/design/create/index.d.ts.map +1 -0
  119. package/dist/api/design/create/opening-fields.d.ts +37 -0
  120. package/dist/api/design/create/opening-fields.d.ts.map +1 -0
  121. package/dist/api/design/delete/index.d.ts +70 -0
  122. package/dist/api/design/delete/index.d.ts.map +1 -0
  123. package/dist/api/design/dimensions.d.ts +427 -0
  124. package/dist/api/design/dimensions.d.ts.map +1 -0
  125. package/dist/api/design/doors/index.d.ts +470 -0
  126. package/dist/api/design/doors/index.d.ts.map +1 -0
  127. package/dist/api/design/edit/index.d.ts +49 -0
  128. package/dist/api/design/edit/index.d.ts.map +1 -0
  129. package/dist/api/design/erase/index.d.ts +160 -0
  130. package/dist/api/design/erase/index.d.ts.map +1 -0
  131. package/dist/api/design/family.d.ts +611 -0
  132. package/dist/api/design/family.d.ts.map +1 -0
  133. package/dist/api/design/furniture/index.d.ts +296 -0
  134. package/dist/api/design/furniture/index.d.ts.map +1 -0
  135. package/dist/api/design/grids.d.ts +237 -0
  136. package/dist/api/design/grids.d.ts.map +1 -0
  137. package/dist/api/design/index.d.ts +260 -0
  138. package/dist/api/design/index.d.ts.map +1 -0
  139. package/dist/api/design/lock.d.ts +67 -0
  140. package/dist/api/design/lock.d.ts.map +1 -0
  141. package/dist/api/design/materials/index.d.ts +551 -0
  142. package/dist/api/design/materials/index.d.ts.map +1 -0
  143. package/dist/api/design/query/geometry/index.d.ts +252 -0
  144. package/dist/api/design/query/geometry/index.d.ts.map +1 -0
  145. package/dist/api/design/query/grids.d.ts +287 -0
  146. package/dist/api/design/query/grids.d.ts.map +1 -0
  147. package/dist/api/design/query/index.d.ts +1318 -0
  148. package/dist/api/design/query/index.d.ts.map +1 -0
  149. package/dist/api/design/query/referenceLines.d.ts +45 -0
  150. package/dist/api/design/query/referenceLines.d.ts.map +1 -0
  151. package/dist/api/design/query/spaces.d.ts +394 -0
  152. package/dist/api/design/query/spaces.d.ts.map +1 -0
  153. package/dist/api/design/selection/index.d.ts +282 -0
  154. package/dist/api/design/selection/index.d.ts.map +1 -0
  155. package/dist/api/design/shared.d.ts +38 -0
  156. package/dist/api/design/shared.d.ts.map +1 -0
  157. package/dist/api/design/transform/index.d.ts +249 -0
  158. package/dist/api/design/transform/index.d.ts.map +1 -0
  159. package/dist/api/design/types/index.d.ts +181 -0
  160. package/dist/api/design/types/index.d.ts.map +1 -0
  161. package/dist/api/design/update/index.d.ts +803 -0
  162. package/dist/api/design/update/index.d.ts.map +1 -0
  163. package/dist/api/design/visibility.d.ts +126 -0
  164. package/dist/api/design/visibility.d.ts.map +1 -0
  165. package/dist/api/design/windows/index.d.ts +300 -0
  166. package/dist/api/design/windows/index.d.ts.map +1 -0
  167. package/dist/api/entity/buildableEnvelope.d.ts +265 -0
  168. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
  169. package/dist/api/entity/department.d.ts +1 -0
  170. package/dist/api/entity/department.d.ts.map +1 -0
  171. package/dist/api/entity/index.d.ts +28 -0
  172. package/dist/api/entity/index.d.ts.map +1 -0
  173. package/dist/api/entity/referenceLine.d.ts +210 -0
  174. package/dist/api/entity/referenceLine.d.ts.map +1 -0
  175. package/dist/api/entity/space.d.ts +846 -0
  176. package/dist/api/entity/space.d.ts.map +1 -0
  177. package/dist/api/entity/story.d.ts +476 -0
  178. package/dist/api/entity/story.d.ts.map +1 -0
  179. package/dist/api/index.d.ts +45 -0
  180. package/dist/api/index.d.ts.map +1 -0
  181. package/dist/api/presentation/aiInspiration.d.ts +2400 -0
  182. package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
  183. package/dist/api/presentation/annotate.d.ts +483 -0
  184. package/dist/api/presentation/annotate.d.ts.map +1 -0
  185. package/dist/api/presentation/diagrams.d.ts +184 -0
  186. package/dist/api/presentation/diagrams.d.ts.map +1 -0
  187. package/dist/api/presentation/drawings.d.ts +2900 -0
  188. package/dist/api/presentation/drawings.d.ts.map +1 -0
  189. package/dist/api/presentation/export.d.ts +126 -0
  190. package/dist/api/presentation/export.d.ts.map +1 -0
  191. package/dist/api/presentation/import.d.ts +164 -0
  192. package/dist/api/presentation/import.d.ts.map +1 -0
  193. package/dist/api/presentation/index.d.ts +114 -0
  194. package/dist/api/presentation/index.d.ts.map +1 -0
  195. package/dist/api/presentation/placedViews.d.ts +1232 -0
  196. package/dist/api/presentation/placedViews.d.ts.map +1 -0
  197. package/dist/api/presentation/shapes.d.ts +481 -0
  198. package/dist/api/presentation/shapes.d.ts.map +1 -0
  199. package/dist/api/presentation/sheets.d.ts +643 -0
  200. package/dist/api/presentation/sheets.d.ts.map +1 -0
  201. package/dist/api/presentation/slideshow.d.ts +125 -0
  202. package/dist/api/presentation/slideshow.d.ts.map +1 -0
  203. package/dist/api/presentation/tables.d.ts +81 -0
  204. package/dist/api/presentation/tables.d.ts.map +1 -0
  205. package/dist/api/presentation/viewPresets.d.ts +70 -0
  206. package/dist/api/presentation/viewPresets.d.ts.map +1 -0
  207. package/dist/api/presentation/views.d.ts +741 -0
  208. package/dist/api/presentation/views.d.ts.map +1 -0
  209. package/dist/api/program/adjacency.d.ts +155 -0
  210. package/dist/api/program/adjacency.d.ts.map +1 -0
  211. package/dist/api/program/areas.d.ts +450 -0
  212. package/dist/api/program/areas.d.ts.map +1 -0
  213. package/dist/api/program/classification.d.ts +135 -0
  214. package/dist/api/program/classification.d.ts.map +1 -0
  215. package/dist/api/program/cores.d.ts +78 -0
  216. package/dist/api/program/cores.d.ts.map +1 -0
  217. package/dist/api/program/departments.d.ts +487 -0
  218. package/dist/api/program/departments.d.ts.map +1 -0
  219. package/dist/api/program/index.d.ts +71 -0
  220. package/dist/api/program/index.d.ts.map +1 -0
  221. package/dist/api/program/labels.d.ts +355 -0
  222. package/dist/api/program/labels.d.ts.map +1 -0
  223. package/dist/api/program/layout.d.ts +398 -0
  224. package/dist/api/program/layout.d.ts.map +1 -0
  225. package/dist/api/program/metadata.d.ts +328 -0
  226. package/dist/api/program/metadata.d.ts.map +1 -0
  227. package/dist/api/program/metrics.d.ts +108 -0
  228. package/dist/api/program/metrics.d.ts.map +1 -0
  229. package/dist/api/program/site.d.ts +823 -0
  230. package/dist/api/program/site.d.ts.map +1 -0
  231. package/dist/api/program/spreadsheet.d.ts +2628 -0
  232. package/dist/api/program/spreadsheet.d.ts.map +1 -0
  233. package/dist/api/workspace/index.d.ts +552 -0
  234. package/dist/api/workspace/index.d.ts.map +1 -0
  235. package/dist/errors/codes.d.ts +34 -0
  236. package/dist/errors/codes.d.ts.map +1 -0
  237. package/dist/errors/envelope.d.ts +56 -0
  238. package/dist/errors/envelope.d.ts.map +1 -0
  239. package/dist/errors/index.d.ts +6 -0
  240. package/dist/errors/index.d.ts.map +1 -0
  241. package/dist/errors/plugin-error.d.ts +69 -0
  242. package/dist/errors/plugin-error.d.ts.map +1 -0
  243. package/dist/handles.d.ts +229 -0
  244. package/dist/handles.d.ts.map +1 -0
  245. package/dist/host-utils.d.ts +47 -0
  246. package/dist/host-utils.d.ts.map +1 -0
  247. package/dist/index.cjs +8836 -0
  248. package/dist/index.cjs.map +1 -0
  249. package/dist/index.d.ts +6 -0
  250. package/dist/index.d.ts.map +1 -0
  251. package/dist/index.js +7568 -0
  252. package/dist/index.js.map +1 -0
  253. package/dist/types.d.ts +16 -0
  254. package/dist/types.d.ts.map +1 -0
  255. package/package.json +41 -0
  256. package/scripts/generate-manifest.mjs +238 -0
  257. package/scripts/generate-manifest.test.mjs +292 -0
  258. package/src/api/analysis/daylight.ts +470 -0
  259. package/src/api/analysis/heatmaps.ts +683 -0
  260. package/src/api/analysis/illuminance.ts +155 -0
  261. package/src/api/analysis/index.ts +61 -0
  262. package/src/api/analysis/shadows.ts +183 -0
  263. package/src/api/analysis/solar.ts +237 -0
  264. package/src/api/analysis/sunlightHours.ts +211 -0
  265. package/src/api/analysis/sunpath.ts +83 -0
  266. package/src/api/analysis/weather.ts +179 -0
  267. package/src/api/core/buildings.ts +485 -0
  268. package/src/api/core/camera/index.ts +268 -0
  269. package/src/api/core/comment/index.ts +376 -0
  270. package/src/api/core/geom/create/index.ts +1204 -0
  271. package/src/api/core/geom/delete/index.ts +84 -0
  272. package/src/api/core/geom/index.ts +35 -0
  273. package/src/api/core/geom/query/arc.ts +169 -0
  274. package/src/api/core/geom/query/brep.ts +563 -0
  275. package/src/api/core/geom/query/circle.ts +404 -0
  276. package/src/api/core/geom/query/contour.ts +540 -0
  277. package/src/api/core/geom/query/curve.ts +1078 -0
  278. package/src/api/core/geom/query/edge.ts +130 -0
  279. package/src/api/core/geom/query/face.ts +403 -0
  280. package/src/api/core/geom/query/halfedge.ts +210 -0
  281. package/src/api/core/geom/query/index.ts +63 -0
  282. package/src/api/core/geom/query/profile.ts +473 -0
  283. package/src/api/core/geom/query/vertex.ts +205 -0
  284. package/src/api/core/geom/update/contour.ts +315 -0
  285. package/src/api/core/geom/update/curve.ts +209 -0
  286. package/src/api/core/geom/update/index.ts +29 -0
  287. package/src/api/core/geom/update/profile.ts +377 -0
  288. package/src/api/core/groups.ts +521 -0
  289. package/src/api/core/handles/index.ts +233 -0
  290. package/src/api/core/history/index.ts +84 -0
  291. package/src/api/core/index.ts +99 -0
  292. package/src/api/core/io/export/index.ts +126 -0
  293. package/src/api/core/io/import/index.ts +504 -0
  294. package/src/api/core/io/index.ts +42 -0
  295. package/src/api/core/io/job/index.ts +140 -0
  296. package/src/api/core/io/query/index.ts +71 -0
  297. package/src/api/core/io/terrain/index.ts +360 -0
  298. package/src/api/core/io/underlay/index.ts +705 -0
  299. package/src/api/core/layers.ts +333 -0
  300. package/src/api/core/math/index.ts +20 -0
  301. package/src/api/core/math/quat.ts +172 -0
  302. package/src/api/core/math/vec3.ts +179 -0
  303. package/src/api/core/mode/index.ts +108 -0
  304. package/src/api/core/project/index.ts +479 -0
  305. package/src/api/core/proposals/index.ts +569 -0
  306. package/src/api/core/storeys/index.ts +294 -0
  307. package/src/api/core/tags.ts +911 -0
  308. package/src/api/core/units/index.ts +164 -0
  309. package/src/api/core/user.ts +46 -0
  310. package/src/api/core/zoom/index.ts +51 -0
  311. package/src/api/design/boolean/index.ts +179 -0
  312. package/src/api/design/create/bulk-items.ts +186 -0
  313. package/src/api/design/create/grids.ts +137 -0
  314. package/src/api/design/create/index.ts +1954 -0
  315. package/src/api/design/create/opening-fields.ts +37 -0
  316. package/src/api/design/delete/index.ts +74 -0
  317. package/src/api/design/dimensions.ts +453 -0
  318. package/src/api/design/doors/index.ts +500 -0
  319. package/src/api/design/edit/index.ts +54 -0
  320. package/src/api/design/erase/index.ts +151 -0
  321. package/src/api/design/family.ts +646 -0
  322. package/src/api/design/furniture/index.ts +319 -0
  323. package/src/api/design/grids.ts +237 -0
  324. package/src/api/design/index.ts +274 -0
  325. package/src/api/design/lock.ts +69 -0
  326. package/src/api/design/materials/index.ts +608 -0
  327. package/src/api/design/query/geometry/index.ts +288 -0
  328. package/src/api/design/query/grids.ts +197 -0
  329. package/src/api/design/query/index.ts +1176 -0
  330. package/src/api/design/query/referenceLines.ts +52 -0
  331. package/src/api/design/query/spaces.ts +275 -0
  332. package/src/api/design/selection/index.ts +273 -0
  333. package/src/api/design/shared.ts +40 -0
  334. package/src/api/design/transform/index.ts +254 -0
  335. package/src/api/design/types/index.ts +156 -0
  336. package/src/api/design/update/index.ts +798 -0
  337. package/src/api/design/visibility.ts +143 -0
  338. package/src/api/design/windows/index.ts +333 -0
  339. package/src/api/entity/buildableEnvelope.ts +322 -0
  340. package/src/api/entity/department.ts +0 -0
  341. package/src/api/entity/index.ts +30 -0
  342. package/src/api/entity/referenceLine.ts +235 -0
  343. package/src/api/entity/space.ts +612 -0
  344. package/src/api/entity/story.ts +517 -0
  345. package/src/api/index.ts +47 -0
  346. package/src/api/presentation/aiInspiration.ts +1116 -0
  347. package/src/api/presentation/annotate.ts +417 -0
  348. package/src/api/presentation/diagrams.ts +194 -0
  349. package/src/api/presentation/drawings.ts +529 -0
  350. package/src/api/presentation/export.ts +133 -0
  351. package/src/api/presentation/import.ts +159 -0
  352. package/src/api/presentation/index.ts +129 -0
  353. package/src/api/presentation/placedViews.ts +1203 -0
  354. package/src/api/presentation/shapes.ts +274 -0
  355. package/src/api/presentation/sheets.ts +616 -0
  356. package/src/api/presentation/slideshow.ts +134 -0
  357. package/src/api/presentation/tables.ts +84 -0
  358. package/src/api/presentation/viewPresets.ts +83 -0
  359. package/src/api/presentation/views.ts +698 -0
  360. package/src/api/program/adjacency.ts +164 -0
  361. package/src/api/program/areas.ts +408 -0
  362. package/src/api/program/classification.ts +138 -0
  363. package/src/api/program/cores.ts +83 -0
  364. package/src/api/program/departments.ts +517 -0
  365. package/src/api/program/index.ts +73 -0
  366. package/src/api/program/labels.ts +332 -0
  367. package/src/api/program/layout.ts +422 -0
  368. package/src/api/program/metadata.ts +364 -0
  369. package/src/api/program/metrics.ts +120 -0
  370. package/src/api/program/site.ts +748 -0
  371. package/src/api/program/spreadsheet.ts +2698 -0
  372. package/src/api/workspace/index.ts +612 -0
  373. package/src/errors/codes.ts +136 -0
  374. package/src/errors/envelope.ts +75 -0
  375. package/src/errors/index.ts +21 -0
  376. package/src/errors/plugin-error.ts +134 -0
  377. package/src/handles.ts +282 -0
  378. package/src/host-utils.ts +68 -0
  379. package/src/index.ts +5 -0
  380. package/src/types.ts +16 -0
  381. package/test/errors.test.mjs +184 -0
  382. package/tsconfig.json +22 -0
  383. package/tsup.config.ts +12 -0
@@ -0,0 +1,798 @@
1
+ import * as z from "zod"
2
+ import { PluginApiReturn } from "../../../types"
3
+ import { ComponentHandle, ProfileHandle } from "../../../handles"
4
+ import {
5
+ PluginSpaceType,
6
+ PluginMassType,
7
+ PluginDepartmentId,
8
+ PluginAreaClass,
9
+ PluginSpaceUpdateResult,
10
+ } from "../../entity/space"
11
+ import { PluginDesignChangeResult } from "../lock"
12
+ import {
13
+ PluginBuildableEnvelopePolygonVertex,
14
+ PluginBuildableEnvelopeSetbackTier,
15
+ PluginBuildableEnvelopeVerticalCap,
16
+ PluginBuildableEnvelopeUpdateResult,
17
+ } from "../../entity/buildableEnvelope"
18
+ import { PluginGridStyleOptions } from "../create/grids"
19
+
20
+ /**
21
+ * Sparse property updates for a space. Only provided fields change.
22
+ *
23
+ * | Property | Type | Description |
24
+ * |---|---|---|
25
+ * | `room_type` | `string`? | Room label |
26
+ * | `massType` | `PluginMassType`? | Mass type |
27
+ * | `spaceType` | `PluginSpaceType`? | Space type |
28
+ * | `areaClass` | `PluginAreaClass`? | Area class (NET/GROSS/EXCLUDED) |
29
+ * | `departmentId` | `PluginDepartmentId`? | Department |
30
+ */
31
+ export const PluginSpacePropertyUpdates = z.object({
32
+ room_type: z.string().optional(),
33
+ massType: PluginMassType.optional(),
34
+ spaceType: PluginSpaceType.optional(),
35
+ areaClass: PluginAreaClass.optional(),
36
+ departmentId: PluginDepartmentId.optional(),
37
+ })
38
+ export type PluginSpacePropertyUpdates = z.infer<
39
+ typeof PluginSpacePropertyUpdates
40
+ >
41
+
42
+ /** Geometry replacement for a space — re-extrude a profile. */
43
+ export const PluginSpaceGeometryUpdate = z.object({
44
+ profile: ProfileHandle,
45
+ extrudeHeight: z.number(),
46
+ })
47
+ export type PluginSpaceGeometryUpdate = z.infer<
48
+ typeof PluginSpaceGeometryUpdate
49
+ >
50
+
51
+ /** One space to update via {@linkcode PluginDesignUpdateApi.spaces}. */
52
+ export const PluginUpdateSpaceItem = z.object({
53
+ space: ComponentHandle,
54
+ properties: PluginSpacePropertyUpdates.optional(),
55
+ geometry: PluginSpaceGeometryUpdate.optional(),
56
+ })
57
+ export type PluginUpdateSpaceItem = z.infer<typeof PluginUpdateSpaceItem>
58
+
59
+ /**
60
+ * Wire schema for {@linkcode PluginDesignUpdateApi.setLabel}.
61
+ *
62
+ * | Property | Type | Description |
63
+ * |---|---|---|
64
+ * | `component` | `ComponentHandle` | The component to relabel |
65
+ * | `label` | `string` | New label (non-empty after trimming) |
66
+ */
67
+ export const PluginDesignSetLabelArgs = z.object({
68
+ component: ComponentHandle,
69
+ label: z.string().trim().min(1),
70
+ })
71
+ export type PluginDesignSetLabelArgs = z.infer<typeof PluginDesignSetLabelArgs>
72
+
73
+ /**
74
+ * Sparse parametric updates for a staircase (all fields optional; at least one
75
+ * required). Only the fields you provide change. Consumed by
76
+ * {@linkcode PluginDesignUpdateApi.staircase}; the paired read is
77
+ * `design.query.getStaircaseParams`.
78
+ *
79
+ * All dimensions are in **engine units** (the same convention as
80
+ * `design.doors.setWidth`); `steps` is a unitless integer count. Height, riser,
81
+ * and step count are **coupled** (`staircaseHeight = steps × riser`); the two
82
+ * lock booleans govern which value recomputes — see the method JSDoc.
83
+ *
84
+ * | Property | Type | Description |
85
+ * |---|---|---|
86
+ * | `isStoreyHeightUnlocked` | `boolean`? | Unlock the staircase height from the storey height |
87
+ * | `isStaircaseHeightUnlocked` | `boolean`? | Unlock the height from `steps × riser` |
88
+ * | `storeyHeight` | `number`? | Storey height the stair sits within (engine units) |
89
+ * | `staircaseHeight` | `number`? | Total rise (engine units) |
90
+ * | `steps` | `number`? | Step count (unitless integer) |
91
+ * | `riser` | `number`? | Riser height (engine units) |
92
+ * | `tread` | `number`? | Tread depth (engine units) |
93
+ * | `width` | `number`? | Flight width (engine units) |
94
+ * | `depth` | `number`? | Slab/waist thickness (engine units) |
95
+ * | `wellSize` | `number`? | Stairwell gap (dogLegged / openWell / square) |
96
+ * | `flightStartDistAfterTurn` | `number`? | Flight offset after a turn (dogLegged / lShaped / square) |
97
+ * | `landingWidth` | `number`? | Landing depth (straight / dogLegged) |
98
+ * | `baseOffset` | `number`? | Vertical offset from the storey base (engine units) |
99
+ */
100
+ export const PluginStaircaseParamUpdates = z
101
+ .object({
102
+ isStoreyHeightUnlocked: z.boolean().optional(),
103
+ isStaircaseHeightUnlocked: z.boolean().optional(),
104
+ storeyHeight: z.number().optional(),
105
+ staircaseHeight: z.number().optional(),
106
+ steps: z.number().int().optional(),
107
+ riser: z.number().optional(),
108
+ tread: z.number().optional(),
109
+ width: z.number().optional(),
110
+ depth: z.number().optional(),
111
+ wellSize: z.number().optional(),
112
+ flightStartDistAfterTurn: z.number().optional(),
113
+ landingWidth: z.number().optional(),
114
+ baseOffset: z.number().optional(),
115
+ })
116
+ .refine((p) => Object.keys(p).length > 0, {
117
+ message:
118
+ "PluginStaircaseParamUpdates requires at least one field to change",
119
+ })
120
+ export type PluginStaircaseParamUpdates = z.infer<
121
+ typeof PluginStaircaseParamUpdates
122
+ >
123
+
124
+ /**
125
+ * Arguments for {@linkcode PluginDesignUpdateApi.staircase}.
126
+ *
127
+ * | Property | Type | Description |
128
+ * |---|---|---|
129
+ * | `staircases` | {@linkcode ComponentHandle}`[]` | The staircases to update |
130
+ * | `params` | {@linkcode PluginStaircaseParamUpdates} | Sparse parametric changes (≥ 1 field) |
131
+ */
132
+ export const PluginDesignUpdateStaircaseArgs = z.object({
133
+ staircases: z.array(ComponentHandle),
134
+ params: PluginStaircaseParamUpdates,
135
+ })
136
+ export type PluginDesignUpdateStaircaseArgs = z.infer<
137
+ typeof PluginDesignUpdateStaircaseArgs
138
+ >
139
+
140
+ /**
141
+ * Sparse edits for a wall (all optional; at least one required). Only the
142
+ * fields you provide change. Dimensions are in **engine units** (the same
143
+ * convention as `design.doors.setWidth`). Consumed by
144
+ * {@linkcode PluginDesignUpdateApi.wall}.
145
+ *
146
+ * | Property | Type | Description |
147
+ * |---|---|---|
148
+ * | `thickness` | `number`? | Wall thickness, engine units (> 0) |
149
+ * | `height` | `number`? | Wall height, engine units (> 0) |
150
+ * | `type` | `string`? | Convert the wall to another wall type — a name (or `wall:`-prefixed id) from `design.types.list("wall")` |
151
+ */
152
+ export const PluginWallUpdates = z
153
+ .object({
154
+ thickness: z.number().positive().optional(),
155
+ height: z.number().positive().optional(),
156
+ type: z.string().trim().min(1).optional(),
157
+ })
158
+ .refine((p) => Object.keys(p).length > 0, {
159
+ message: "PluginWallUpdates requires at least one field to change",
160
+ })
161
+ export type PluginWallUpdates = z.infer<typeof PluginWallUpdates>
162
+
163
+ /**
164
+ * Sparse dimension edits for a slab-family element (slab / floor / roof /
165
+ * ceiling). All values are engine units, the same convention as
166
+ * `design.doors.setWidth`. Consumed by {@linkcode PluginDesignUpdateApi.slab},
167
+ * `floor`, `roof`, and `ceiling`.
168
+ *
169
+ * `overhang` is only available on **slabs and roofs** (the panel's Overhang
170
+ * slider) — floors and ceilings reject it with `PRECONDITION_FAILED`.
171
+ *
172
+ * | Property | Type | Description |
173
+ * |---|---|---|
174
+ * | `thickness` | `number`? | Element thickness, engine units (> 0) |
175
+ * | `overhang` | `number`? | Absolute overhang offset, engine units (slab / roof only) |
176
+ */
177
+ export const PluginSlabUpdates = z
178
+ .object({
179
+ thickness: z.number().positive().optional(),
180
+ overhang: z.number().optional(),
181
+ })
182
+ .refine((p) => Object.keys(p).length > 0, {
183
+ message: "PluginSlabUpdates requires at least one field to change",
184
+ })
185
+ export type PluginSlabUpdates = z.infer<typeof PluginSlabUpdates>
186
+
187
+ /** Arguments for {@linkcode PluginDesignUpdateApi.wall}. */
188
+ export const PluginDesignUpdateWallArgs = z.object({
189
+ component: ComponentHandle,
190
+ updates: PluginWallUpdates,
191
+ })
192
+ export type PluginDesignUpdateWallArgs = z.infer<
193
+ typeof PluginDesignUpdateWallArgs
194
+ >
195
+
196
+ /**
197
+ * Arguments for the slab-family updaters —
198
+ * {@linkcode PluginDesignUpdateApi.slab}, `floor`, `roof`, `ceiling`.
199
+ */
200
+ export const PluginDesignUpdateSlabArgs = z.object({
201
+ component: ComponentHandle,
202
+ updates: PluginSlabUpdates,
203
+ })
204
+ export type PluginDesignUpdateSlabArgs = z.infer<
205
+ typeof PluginDesignUpdateSlabArgs
206
+ >
207
+
208
+ /** Arguments for {@linkcode PluginDesignUpdateApi.setElevation}. */
209
+ export const PluginDesignSetElevationArgs = z.object({
210
+ component: ComponentHandle,
211
+ elevation: z.number(),
212
+ })
213
+ export type PluginDesignSetElevationArgs = z.infer<
214
+ typeof PluginDesignSetElevationArgs
215
+ >
216
+
217
+ /** Arguments for {@linkcode PluginDesignUpdateApi.setBaseOffset}. */
218
+ export const PluginDesignSetBaseOffsetArgs = z.object({
219
+ component: ComponentHandle,
220
+ offset: z.number(),
221
+ })
222
+ export type PluginDesignSetBaseOffsetArgs = z.infer<
223
+ typeof PluginDesignSetBaseOffsetArgs
224
+ >
225
+
226
+ /**
227
+ * Arguments for {@linkcode PluginDesignUpdateApi.setStorey}.
228
+ *
229
+ * | Property | Type | Description |
230
+ * |---|---|---|
231
+ * | `components` | {@linkcode ComponentHandle}`[]` | The components to reassign |
232
+ * | `storey` | `number` | Target integer storey number (`entity.story` convention; must exist) |
233
+ */
234
+ export const PluginDesignSetStoreyArgs = z.object({
235
+ components: z.array(ComponentHandle),
236
+ storey: z.number().int(),
237
+ })
238
+ export type PluginDesignSetStoreyArgs = z.infer<
239
+ typeof PluginDesignSetStoreyArgs
240
+ >
241
+
242
+ /**
243
+ * The sparse GROUP-LEVEL patch accepted by {@linkcode PluginDesignUpdateApi.grid}.
244
+ * Only provided fields change. Wing- and line-level updates live on the grids
245
+ * entity family: `design.grids.updateWings` / `design.grids.updateLines`.
246
+ */
247
+ export const PluginGridPatch = z.object({
248
+ angle: z.number().finite().optional(),
249
+ props: PluginGridStyleOptions.optional(),
250
+ storeyVisibility: z
251
+ .array(z.object({ storey: z.number().int(), visible: z.boolean() }))
252
+ .optional(),
253
+ })
254
+ export type PluginGridPatch = z.infer<typeof PluginGridPatch>
255
+
256
+ /** Arguments for {@linkcode PluginDesignUpdateApi.grid}. */
257
+ export const PluginDesignUpdateGridArgs = z.object({
258
+ grid: ComponentHandle,
259
+ patch: PluginGridPatch,
260
+ })
261
+ export type PluginDesignUpdateGridArgs = z.infer<typeof PluginDesignUpdateGridArgs>
262
+
263
+ /**
264
+ * `snaptrude.design.update` — edit existing scene entities (properties + geometry).
265
+ *
266
+ * Migrated from the removed `entity.space.{update, updateGeometryFromProfile, bulkUpdate}`.
267
+ * Only provided fields change; each call is undoable. Failures throw (RPC rejects).
268
+ */
269
+ export abstract class PluginDesignUpdateApi {
270
+ constructor() {}
271
+
272
+ /**
273
+ * Set a component's **Label** — the same editable Label field the properties
274
+ * panel shows (doors, windows, furniture, spaces, and every other labelled
275
+ * component). The paired read is `design.query.getLabel`. Undoable; the
276
+ * canvas label text updates immediately.
277
+ *
278
+ * Strictly **per component**: labelling one door of a placed family never
279
+ * touches its sibling doors (the panel's Label edit, by contrast, applies to
280
+ * the whole family). On **legacy masses** without a space type, panel parity
281
+ * applies — a label matching a room-type preset with a height can also
282
+ * adjust the mass's height and material, exactly like typing it in the panel.
283
+ *
284
+ * Throws when the component is locked, the handle is gone/forged, the label
285
+ * is empty, or the component has no mesh to label. Re-applying the current
286
+ * label is a no-op that returns `true` without touching the undo stack.
287
+ *
288
+ * @param component - The component to relabel
289
+ * @param label - New label text (non-empty; leading/trailing whitespace trimmed)
290
+ * @returns `true` once the label is applied
291
+ *
292
+ * @examplePrompt Rename this door to D-101
293
+ * @examplePrompt Number all doors on storey 2 with a D-2-XX tag
294
+ * @examplePrompt Set the selected window's label to W-04
295
+ * @examplePrompt Tag every door with its fire rating
296
+ *
297
+ * # Example
298
+ * ```ts
299
+ * // Door tag numbering: label every door as D-<storey>-<n>, numbered per storey
300
+ * await snaptrude.design.selection.setByFilter({ types: ["door"] })
301
+ * const doors = await snaptrude.design.selection.get()
302
+ * const counts = {}
303
+ * for (const door of doors) {
304
+ * const { storey = 0 } = await snaptrude.design.query.getProperties(door)
305
+ * counts[storey] = (counts[storey] ?? 0) + 1
306
+ * await snaptrude.design.update.setLabel(door, `D-${storey}-${String(counts[storey]).padStart(2, "0")}`)
307
+ * }
308
+ * ```
309
+ */
310
+ public abstract setLabel(
311
+ component: ComponentHandle,
312
+ label: string,
313
+ ): PluginApiReturn<boolean>
314
+
315
+ /**
316
+ * Update a structural grid's **group-level** fields with a sparse patch —
317
+ * default line styling, absolute angle, and per-storey 2D visibility. Only
318
+ * provided fields change. Wing- and line-level updates live on the grids
319
+ * entity family: {@linkcode PluginDesignGridsApi.updateWings} /
320
+ * {@linkcode PluginDesignGridsApi.updateLines}.
321
+ *
322
+ * Every change routes through the exact setters the native panel uses —
323
+ * each changed field commits its own undoable command, identical to editing
324
+ * that field in the panel. `angle` is an absolute target in degrees (CCW
325
+ * about +Y).
326
+ *
327
+ * @param grid - The grid group to update
328
+ * @param patch - The sparse {@linkcode PluginGridPatch}
329
+ * @returns `true` once applied
330
+ *
331
+ * @examplePrompt Rotate the grid to 45 degrees
332
+ * @examplePrompt Make this grid's lines dashed and grey
333
+ * @examplePrompt Hide this grid on storey 3's plan
334
+ *
335
+ * # Example
336
+ * ```ts
337
+ * const [grid] = await snaptrude.design.query.listGrids()
338
+ * await snaptrude.design.update.grid(grid, { angle: 45, props: { style: "DASHED" } })
339
+ * ```
340
+ */
341
+ public abstract grid(
342
+ grid: ComponentHandle,
343
+ patch: PluginGridPatch,
344
+ ): PluginApiReturn<boolean>
345
+
346
+ /**
347
+ * Update a single space (room) — change its properties (room label, space
348
+ * type, mass type, area class, department) and/or replace its geometry by
349
+ * re-extruding a profile to a new height. Sparse and undoable: only the
350
+ * fields you provide change.
351
+ *
352
+ * @param space - The space to update
353
+ * @param options - `properties` (sparse) and/or `geometry` ({ profile, extrudeHeight })
354
+ * @returns the updated space's echoed {@linkcode PluginSpaceUpdateResult}
355
+ *
356
+ * @examplePrompt Rename this room to Office
357
+ * @examplePrompt Change this space's room type to Meeting Room
358
+ * @examplePrompt Set the height of this room to 3 metres
359
+ * @examplePrompt Move this space into the Circulation department
360
+ * @examplePrompt Exclude this room from the area calculations
361
+ *
362
+ * @performance For MORE THAN ONE space, call `design.update.spaces(items[])` — the whole
363
+ * batch is one host round-trip. Looping this single-space updater is N round-trips.
364
+ *
365
+ * # Example
366
+ * ```ts
367
+ * await snaptrude.design.update.space("space-id", { properties: { room_type: "Office" } })
368
+ * ```
369
+ */
370
+ public abstract space(
371
+ space: ComponentHandle,
372
+ options: {
373
+ properties?: PluginSpacePropertyUpdates
374
+ geometry?: PluginSpaceGeometryUpdate
375
+ },
376
+ ): PluginApiReturn<PluginSpaceUpdateResult>
377
+
378
+ /**
379
+ * Update many spaces (rooms) in one undoable operation — the bulk form of
380
+ * {@linkcode space}. Each item pairs a space with the sparse property
381
+ * changes and/or geometry re-extrude to apply; every item is validated up
382
+ * front, then all changes are applied as a single command.
383
+ *
384
+ * Migrated from `entity.space.bulkUpdate`.
385
+ *
386
+ * @param items - One {@linkcode PluginUpdateSpaceItem} per space
387
+ * @returns one {@linkcode PluginSpaceUpdateResult} per item, in input order
388
+ *
389
+ * @examplePrompt Label all the selected rooms as Bedrooms
390
+ * @examplePrompt Change the room type of these five spaces at once
391
+ * @examplePrompt Set every room on this floor to a 3m height in one go
392
+ * @examplePrompt Bulk-assign these spaces to the Service department
393
+ * @examplePrompt Mark all of these rooms as excluded from area in one update
394
+ *
395
+ * @performance Bulk update — the whole batch is ONE host round-trip. Prefer over looping
396
+ * `design.update.space`: build the `items[]` array first, then make one call.
397
+ *
398
+ * # Example
399
+ * ```ts
400
+ * // Re-label every selected room and mark it NET area — one undoable bulk update
401
+ * const rooms = await snaptrude.design.query.listSpaces({ isSelected: true })
402
+ * const results = await snaptrude.design.update.spaces(
403
+ * rooms.map((space) => ({
404
+ * space,
405
+ * properties: { room_type: "Bedroom", areaClass: "NET" },
406
+ * })),
407
+ * )
408
+ * // One result per item, in input order
409
+ * console.log(results.map((r) => r.spaceId))
410
+ * ```
411
+ */
412
+ public abstract spaces(
413
+ items: PluginUpdateSpaceItem[],
414
+ ): PluginApiReturn<PluginSpaceUpdateResult[]>
415
+
416
+ /**
417
+ * Update the parameters of one or more staircases — riser, tread, width,
418
+ * depth, step count, total height, well size, landing depth, base offset,
419
+ * and the two height locks — in one undoable operation. Sparse: only the
420
+ * fields you provide change. The paired read is
421
+ * `design.query.getStaircaseParams`.
422
+ *
423
+ * All dimensions are in **engine units** (the same convention as
424
+ * `design.doors.setWidth`); `steps` is a unitless integer count. The height,
425
+ * riser, and step count are **coupled** — `staircaseHeight = steps × riser` —
426
+ * and the two lock booleans govern which value recomputes when another
427
+ * changes. With `isStoreyHeightUnlocked` false the staircase height follows
428
+ * the storey height; unlocking it also unlocks the staircase height. Setting
429
+ * `steps` recomputes `riser` (or the height, once the height is unlocked),
430
+ * and setting `riser` recomputes `steps`/height in turn.
431
+ *
432
+ * Presets-only: this edits the parametric fields of a preset staircase; it
433
+ * does not change the staircase's type/preset (there is no in-place re-type).
434
+ * Every edit rebuilds the staircase geometry, so the call is async.
435
+ *
436
+ * Throws when a handle is not a staircase, when a staircase is locked, or
437
+ * when a value falls outside the engine's accepted range (RPC rejects).
438
+ *
439
+ * @param staircases - the staircases to update
440
+ * @param params - sparse {@linkcode PluginStaircaseParamUpdates} (at least one field)
441
+ * @returns the affected staircases
442
+ *
443
+ * @examplePrompt Set the riser of this staircase to 165mm
444
+ * @examplePrompt Change all the stairs to 14 steps
445
+ * @examplePrompt Make the selected staircase 1200 wide with a 280 tread
446
+ * @examplePrompt Widen every staircase on level 1 to 1 metre
447
+ * @examplePrompt Unlock the height and set this stair to 3200 tall
448
+ *
449
+ * # Example
450
+ * ```ts
451
+ * // Give every ground-floor staircase a common riser + tread (engine units)
452
+ * const stairs = await snaptrude.design.query.listStaircases({ storeys: [1] })
453
+ * const { affected } = await snaptrude.design.update.staircase(stairs, {
454
+ * riser: 165,
455
+ * tread: 280,
456
+ * })
457
+ * console.log("updated", affected.length, "staircases")
458
+ * ```
459
+ */
460
+ public abstract staircase(
461
+ staircases: ComponentHandle[],
462
+ params: PluginStaircaseParamUpdates,
463
+ ): PluginApiReturn<PluginDesignChangeResult>
464
+
465
+ /**
466
+ * Edit a **wall** — its thickness and/or height (the same command the
467
+ * properties panel's Thickness/Height fields drive) and/or its **wall type**
468
+ * (the panel's Wall Types dropdown: converts the wall to another type,
469
+ * rebuilding its layer stack and materials). Sparse: only the fields you
470
+ * provide change. Undoable; the geometry rebuilds and any dimension lines
471
+ * refresh. Stacked-wall companions and hosted fenestration are handled
472
+ * exactly as the panel does.
473
+ *
474
+ * Thickness/height are in **engine units** (the same convention as
475
+ * `design.doors.setWidth`) and must be `> 0`. Shrinking a wall past its
476
+ * openings is rejected by the engine (the wall is skipped with no change).
477
+ * `type` accepts a type name from `design.types.list("wall")` (or its
478
+ * `wall:`-prefixed id); when combined with dimensions, the type conversion
479
+ * is applied first so an explicit thickness/height wins over the type's
480
+ * defaults. Re-applying the wall's current type is a no-op.
481
+ *
482
+ * Throws when the handle is not a wall, when the wall is locked, when the
483
+ * handle is gone/forged, when `type` names an unknown wall type, when the
484
+ * engine rejects the conversion (e.g. a curved wall thinner than the new
485
+ * type's minimum thickness), or when no field is provided.
486
+ *
487
+ * A type conversion (and a thickness edit on a parametric wall) REBUILDS the
488
+ * wall, replacing it with a new component: the input handle is then dead
489
+ * (further calls throw HANDLE_INVALID) and `affected[0]` carries the
490
+ * replacement's handle — use it for any follow-up calls.
491
+ *
492
+ * @param component - The wall to edit
493
+ * @param updates - Sparse {@linkcode PluginWallUpdates} (at least one field)
494
+ * @returns the affected wall — after a rebuild, the REPLACEMENT wall's handle
495
+ *
496
+ * @examplePrompt Make this wall 230mm thick
497
+ * @examplePrompt Set the selected wall's height to 3 metres
498
+ * @examplePrompt Thicken every exterior wall to 300
499
+ * @examplePrompt Change this wall to a Glass Wall
500
+ * @examplePrompt Convert all the partitions on this floor to Brick Wall
501
+ *
502
+ * # Example
503
+ * ```ts
504
+ * // Convert every wall on storey 1 to the first listed wall type
505
+ * const [wallType] = await snaptrude.design.types.list("wall")
506
+ * const walls = await snaptrude.design.query.listWalls({ storeys: [1] })
507
+ * for (const wall of walls) {
508
+ * await snaptrude.design.update.wall(wall, { type: wallType.id })
509
+ * }
510
+ * ```
511
+ */
512
+ public abstract wall(
513
+ component: ComponentHandle,
514
+ updates: PluginWallUpdates,
515
+ ): PluginApiReturn<PluginDesignChangeResult>
516
+
517
+ /**
518
+ * Edit a **slab's** thickness and/or overhang — the same commands the
519
+ * properties panel's Thickness field and Overhang slider drive. Sparse: only
520
+ * the fields you provide change. Undoable; the slab rebuilds and dimension
521
+ * lines refresh. Both values are in **engine units** (the same convention as
522
+ * `design.doors.setWidth`); thickness must be `> 0`, overhang is an absolute
523
+ * offset (negative insets the slab) and re-applying the current overhang is
524
+ * a no-op.
525
+ *
526
+ * Throws when the handle is not a slab, when it is locked, when the handle is
527
+ * gone/forged, when `overhang` is set on a slab that has no overhang (plinth /
528
+ * basement slabs, or overhang disabled), or when no field is provided.
529
+ *
530
+ * @param component - The slab to edit
531
+ * @param updates - Sparse {@linkcode PluginSlabUpdates} (at least one field)
532
+ * @returns the affected slab
533
+ *
534
+ * @examplePrompt Set this slab's thickness to 250mm
535
+ * @examplePrompt Make the floor slab 300 thick
536
+ * @examplePrompt Give this slab a 200 overhang
537
+ * @examplePrompt Remove the overhang on every slab on level 2
538
+ *
539
+ * # Example
540
+ * ```ts
541
+ * const [slab] = await snaptrude.design.query.listSlabs()
542
+ * await snaptrude.design.update.slab(slab, { thickness: 250, overhang: 200 })
543
+ * ```
544
+ */
545
+ public abstract slab(
546
+ component: ComponentHandle,
547
+ updates: PluginSlabUpdates,
548
+ ): PluginApiReturn<PluginDesignChangeResult>
549
+
550
+ /**
551
+ * Edit a **floor's** thickness — the slab-family updater for floors (shares
552
+ * the slab thickness command). Undoable. Thickness is in **engine units**
553
+ * (the `design.doors.setWidth` convention) and must be `> 0`. Floors have no
554
+ * Overhang control, so `overhang` is rejected with `PRECONDITION_FAILED`.
555
+ *
556
+ * Throws when the handle is not a floor, when it is locked, when the handle
557
+ * is gone/forged, when `overhang` is provided, or when no field is provided.
558
+ *
559
+ * @param component - The floor to edit
560
+ * @param updates - {@linkcode PluginSlabUpdates} (a `thickness`)
561
+ * @returns the affected floor
562
+ *
563
+ * @examplePrompt Make this floor 200mm thick
564
+ * @examplePrompt Set every floor to a 250 thickness
565
+ * @examplePrompt Thicken the ground floor slab to 300
566
+ *
567
+ * # Example
568
+ * ```ts
569
+ * const [floor] = await snaptrude.design.query.listFloors()
570
+ * await snaptrude.design.update.floor(floor, { thickness: 200 })
571
+ * ```
572
+ */
573
+ public abstract floor(
574
+ component: ComponentHandle,
575
+ updates: PluginSlabUpdates,
576
+ ): PluginApiReturn<PluginDesignChangeResult>
577
+
578
+ /**
579
+ * Edit a **roof's** thickness and/or overhang — the same commands the roof
580
+ * panel's Thickness field and Overhang slider drive (shares the slab-family
581
+ * machinery). Sparse: only the fields you provide change. Undoable. Both
582
+ * values are in **engine units** (the `design.doors.setWidth` convention);
583
+ * thickness must be `> 0`, overhang is an absolute offset (negative insets
584
+ * the roof) and re-applying the current overhang is a no-op.
585
+ *
586
+ * Throws when the handle is not a roof, when it is locked, when the handle is
587
+ * gone/forged, when `overhang` is set on a roof whose overhang is disabled,
588
+ * or when no field is provided.
589
+ *
590
+ * @param component - The roof to edit
591
+ * @param updates - Sparse {@linkcode PluginSlabUpdates} (at least one field)
592
+ * @returns the affected roof
593
+ *
594
+ * @examplePrompt Make this roof 300mm thick
595
+ * @examplePrompt Set the roof slab thickness to 250
596
+ * @examplePrompt Give the roof a 600 overhang
597
+ * @examplePrompt Pull the roof overhang back to 0
598
+ *
599
+ * # Example
600
+ * ```ts
601
+ * const [roof] = await snaptrude.design.query.listRoofs()
602
+ * await snaptrude.design.update.roof(roof, { overhang: 600 })
603
+ * ```
604
+ */
605
+ public abstract roof(
606
+ component: ComponentHandle,
607
+ updates: PluginSlabUpdates,
608
+ ): PluginApiReturn<PluginDesignChangeResult>
609
+
610
+ /**
611
+ * Edit a **ceiling's** thickness — the slab-family updater for ceilings
612
+ * (shares the slab thickness command). Undoable. Thickness is in **engine
613
+ * units** (the `design.doors.setWidth` convention) and must be `> 0`.
614
+ * Ceilings have no Overhang control, so `overhang` is rejected with
615
+ * `PRECONDITION_FAILED`.
616
+ *
617
+ * Throws when the handle is not a ceiling, when it is locked, when the handle
618
+ * is gone/forged, when `overhang` is provided, or when no field is provided.
619
+ *
620
+ * @param component - The ceiling to edit
621
+ * @param updates - {@linkcode PluginSlabUpdates} (a `thickness`)
622
+ * @returns the affected ceiling
623
+ *
624
+ * @examplePrompt Make this ceiling 150mm thick
625
+ * @examplePrompt Set every ceiling to a 100 thickness
626
+ * @examplePrompt Thicken the ceiling to 200
627
+ *
628
+ * # Example
629
+ * ```ts
630
+ * const [ceiling] = await snaptrude.design.query.listCeilings()
631
+ * await snaptrude.design.update.ceiling(ceiling, { thickness: 150 })
632
+ * ```
633
+ */
634
+ public abstract ceiling(
635
+ component: ComponentHandle,
636
+ updates: PluginSlabUpdates,
637
+ ): PluginApiReturn<PluginDesignChangeResult>
638
+
639
+ /**
640
+ * Set a component's **absolute world elevation** — moves it vertically so its
641
+ * base (the bounding-box bottom, world Y) lands at `elevation`. Composed over
642
+ * the canonical command-backed move machinery, so it is undoable and persisted
643
+ * exactly like dragging the element up or down; per-type invariants (e.g. a
644
+ * staircase's base offset) stay in sync. `elevation` is in **engine units**
645
+ * (the `design.doors.setWidth` convention). Re-applying the current elevation
646
+ * is a no-op.
647
+ *
648
+ * Throws when the component is locked or the handle is gone/forged.
649
+ *
650
+ * @param component - The component to move vertically
651
+ * @param elevation - Target world elevation of the component's base (engine units)
652
+ * @returns the affected component
653
+ *
654
+ * @examplePrompt Set this element's elevation to 3000
655
+ * @examplePrompt Raise this mass so its base sits at 3 metres
656
+ * @examplePrompt Drop the selected slab to elevation 0
657
+ * @examplePrompt Put this staircase's base at 3200
658
+ *
659
+ * # Example
660
+ * ```ts
661
+ * // Sit the roof slab exactly at the top of a 3m storey
662
+ * const [roof] = await snaptrude.design.query.listRoofs()
663
+ * await snaptrude.design.update.setElevation(roof, 3000)
664
+ * ```
665
+ */
666
+ public abstract setElevation(
667
+ component: ComponentHandle,
668
+ elevation: number,
669
+ ): PluginApiReturn<PluginDesignChangeResult>
670
+
671
+ /**
672
+ * Set a component's **base offset** — its vertical distance above its own
673
+ * storey's base level. Moves the component so its base lands at
674
+ * `storeyBase + offset`, composed over the same command-backed move machinery
675
+ * as {@linkcode setElevation} (undoable, persisted, per-type invariants kept
676
+ * in sync). Use this instead of {@linkcode setElevation} when you want an
677
+ * offset relative to the storey rather than an absolute world height.
678
+ * `offset` is in **engine units** (the `design.doors.setWidth` convention);
679
+ * `0` sits the base flush with the storey base. Re-applying the current
680
+ * offset is a no-op.
681
+ *
682
+ * Throws when the component is locked, when it has no storey to offset from,
683
+ * or when the handle is gone/forged.
684
+ *
685
+ * @param component - The component to offset
686
+ * @param offset - Distance of the component's base above its storey base (engine units)
687
+ * @returns the affected component
688
+ *
689
+ * @examplePrompt Lift this element 300 above its floor
690
+ * @examplePrompt Set this staircase's base offset to 0
691
+ * @examplePrompt Raise the selected mass 500 off the storey base
692
+ * @examplePrompt Offset this slab 150 above the floor level
693
+ *
694
+ * # Example
695
+ * ```ts
696
+ * const [stair] = await snaptrude.design.query.listStaircases()
697
+ * await snaptrude.design.update.setBaseOffset(stair, 0)
698
+ * ```
699
+ */
700
+ public abstract setBaseOffset(
701
+ component: ComponentHandle,
702
+ offset: number,
703
+ ): PluginApiReturn<PluginDesignChangeResult>
704
+
705
+ /**
706
+ * Reassign one or more components to another **storey** — the same operation
707
+ * as the properties panel's Story dropdown, and it works across element kinds
708
+ * exactly like the panel (walls, slabs, masses, furniture, staircases, ...).
709
+ * Each component is moved vertically to the target storey's level (per-kind
710
+ * placement rules — e.g. a slab sits at the storey base, a wall on it) and
711
+ * its storey assignment, children, and dimension lines update together as
712
+ * **one undoable operation**.
713
+ *
714
+ * `storey` is an integer storey number in the `entity.story` convention
715
+ * (`1` is the ground storey, `-1` the first basement; `0` does not exist)
716
+ * and **must already exist** in each component's building — this call never
717
+ * creates storeys (use `core.storeys.create` first). Components already on
718
+ * the target storey are skipped (no-op) and are not echoed in `affected`.
719
+ *
720
+ * Throws when the target storey does not exist, when any component is
721
+ * locked, or when a handle is gone/forged — all before anything moves
722
+ * (all-or-nothing).
723
+ *
724
+ * @param components - The components to reassign
725
+ * @param storey - Target storey number (integer, `entity.story` convention)
726
+ * @returns the components actually reassigned
727
+ *
728
+ * @examplePrompt Move this sofa to storey 2
729
+ * @examplePrompt Put the selected walls on the first basement level
730
+ * @examplePrompt Send everything on this storey up one level
731
+ * @examplePrompt Reassign these slabs to storey 3
732
+ *
733
+ * # Example
734
+ * ```ts
735
+ * // Move the current selection up to storey 2
736
+ * const selection = await snaptrude.design.selection.get()
737
+ * const { affected } = await snaptrude.design.update.setStorey(selection, 2)
738
+ * console.log("moved", affected.length, "components")
739
+ * ```
740
+ */
741
+ public abstract setStorey(
742
+ components: ComponentHandle[],
743
+ storey: number,
744
+ ): PluginApiReturn<PluginDesignChangeResult>
745
+
746
+ /**
747
+ * Update an existing parametric buildable envelope — regenerate the zoning
748
+ * volume from a revised site polygon, setbacks, vertical cap, or FAR and
749
+ * lot-coverage limits, keeping the same envelope id. Canonical home of the
750
+ * update formerly at `entity.buildableEnvelope.update` (now deprecated).
751
+ *
752
+ * @param buildableEnvelopeId - Existing envelope ID to update; non-empty and
753
+ * must match an existing envelope on the canvas.
754
+ * @param sitePolygon - Site polygon vertices in `lengthUnit`; minimum 3 vertices.
755
+ * @param lengthUnit - Unit used by all length fields (`"ft" | "m"`).
756
+ * @param setbacks - Setback profile, ground tier first; minimum 1 tier.
757
+ * @param verticalCap - Maximum height or floor count.
758
+ * @param floorToFloor - Required floor-to-floor height in `lengthUnit`.
759
+ * @param farRatio - Optional FAR value, positive when provided.
760
+ * @param lotCoverageMaxPct - Optional lot coverage cap, `0..100`.
761
+ * @returns A {@linkcode PluginBuildableEnvelopeUpdateResult} with the
762
+ * `buildableEnvelopeId` of the updated envelope.
763
+ * @throws If validation fails, the envelope does not exist, or generation
764
+ * produces no renderable geometry.
765
+ *
766
+ * @examplePrompt Change the envelope's height limit to 175 feet
767
+ * @examplePrompt Update the setbacks on the buildable envelope
768
+ * @examplePrompt Regenerate the zoning envelope with a new site boundary
769
+ * @examplePrompt Increase the FAR on the buildable volume
770
+ *
771
+ * # Example
772
+ * ```ts
773
+ * const { buildableEnvelopeId } = await snaptrude.design.update.buildableEnvelope(
774
+ * existingId,
775
+ * [
776
+ * { x: 0, z: 0 },
777
+ * { x: 100, z: 0 },
778
+ * { x: 100, z: 80 },
779
+ * { x: 0, z: 80 },
780
+ * ],
781
+ * "ft",
782
+ * [{ aboveHeight: 0, front: 10, side: 5, rear: 10 }],
783
+ * { kind: "max_height", maxHeight: 175 },
784
+ * 12,
785
+ * )
786
+ * ```
787
+ */
788
+ public abstract buildableEnvelope(
789
+ buildableEnvelopeId: string,
790
+ sitePolygon: PluginBuildableEnvelopePolygonVertex[],
791
+ lengthUnit: "ft" | "m",
792
+ setbacks: PluginBuildableEnvelopeSetbackTier[],
793
+ verticalCap: PluginBuildableEnvelopeVerticalCap,
794
+ floorToFloor: number,
795
+ farRatio?: number,
796
+ lotCoverageMaxPct?: number,
797
+ ): PluginApiReturn<PluginBuildableEnvelopeUpdateResult>
798
+ }