@snaptrude/plugin-core 0.3.0 → 0.6.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 (302) hide show
  1. package/AGENTS.md +130 -48
  2. package/CHANGELOG.md +163 -0
  3. package/api-manifest.full.json +5600 -0
  4. package/api-manifest.json +5502 -0
  5. package/dist/api/analysis/heatmaps.d.ts +234 -0
  6. package/dist/api/analysis/heatmaps.d.ts.map +1 -0
  7. package/dist/api/analysis/illuminance.d.ts +145 -0
  8. package/dist/api/analysis/illuminance.d.ts.map +1 -0
  9. package/dist/api/analysis/index.d.ts +44 -0
  10. package/dist/api/analysis/index.d.ts.map +1 -0
  11. package/dist/api/analysis/shadows.d.ts +165 -0
  12. package/dist/api/analysis/shadows.d.ts.map +1 -0
  13. package/dist/api/analysis/sunlightHours.d.ts +208 -0
  14. package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
  15. package/dist/api/analysis/sunpath.d.ts +80 -0
  16. package/dist/api/analysis/sunpath.d.ts.map +1 -0
  17. package/dist/api/core/buildings.d.ts +427 -0
  18. package/dist/api/core/buildings.d.ts.map +1 -0
  19. package/dist/api/core/comment/index.d.ts +230 -0
  20. package/dist/api/core/comment/index.d.ts.map +1 -0
  21. package/dist/api/core/geom/create/index.d.ts +247 -0
  22. package/dist/api/core/geom/create/index.d.ts.map +1 -0
  23. package/dist/api/core/geom/delete/index.d.ts +72 -0
  24. package/dist/api/core/geom/delete/index.d.ts.map +1 -0
  25. package/dist/api/core/geom/index.d.ts +24 -23
  26. package/dist/api/core/geom/index.d.ts.map +1 -1
  27. package/dist/api/core/geom/query/arc.d.ts +169 -0
  28. package/dist/api/core/geom/query/arc.d.ts.map +1 -0
  29. package/dist/api/core/geom/query/brep.d.ts +402 -0
  30. package/dist/api/core/geom/query/brep.d.ts.map +1 -0
  31. package/dist/api/core/geom/query/circle.d.ts +378 -0
  32. package/dist/api/core/geom/query/circle.d.ts.map +1 -0
  33. package/dist/api/core/geom/query/contour.d.ts +450 -0
  34. package/dist/api/core/geom/query/contour.d.ts.map +1 -0
  35. package/dist/api/core/geom/query/curve.d.ts +918 -0
  36. package/dist/api/core/geom/query/curve.d.ts.map +1 -0
  37. package/dist/api/core/geom/query/edge.d.ts +128 -0
  38. package/dist/api/core/geom/query/edge.d.ts.map +1 -0
  39. package/dist/api/core/geom/query/face.d.ts +363 -0
  40. package/dist/api/core/geom/query/face.d.ts.map +1 -0
  41. package/dist/api/core/geom/query/halfedge.d.ts +206 -0
  42. package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
  43. package/dist/api/core/geom/query/index.d.ts +61 -0
  44. package/dist/api/core/geom/query/index.d.ts.map +1 -0
  45. package/dist/api/core/geom/query/profile.d.ts +410 -0
  46. package/dist/api/core/geom/query/profile.d.ts.map +1 -0
  47. package/dist/api/core/geom/query/vertex.d.ts +187 -0
  48. package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
  49. package/dist/api/core/geom/update/contour.d.ts +272 -0
  50. package/dist/api/core/geom/update/contour.d.ts.map +1 -0
  51. package/dist/api/core/geom/update/curve.d.ts +180 -0
  52. package/dist/api/core/geom/update/curve.d.ts.map +1 -0
  53. package/dist/api/core/geom/update/index.d.ts +27 -0
  54. package/dist/api/core/geom/update/index.d.ts.map +1 -0
  55. package/dist/api/core/geom/update/profile.d.ts +329 -0
  56. package/dist/api/core/geom/update/profile.d.ts.map +1 -0
  57. package/dist/api/core/groups.d.ts +485 -0
  58. package/dist/api/core/groups.d.ts.map +1 -0
  59. package/dist/api/core/history/index.d.ts +78 -0
  60. package/dist/api/core/history/index.d.ts.map +1 -0
  61. package/dist/api/core/index.d.ts +51 -1
  62. package/dist/api/core/index.d.ts.map +1 -1
  63. package/dist/api/core/io/import/index.d.ts +392 -0
  64. package/dist/api/core/io/import/index.d.ts.map +1 -0
  65. package/dist/api/core/io/index.d.ts +35 -0
  66. package/dist/api/core/io/index.d.ts.map +1 -0
  67. package/dist/api/core/io/job/index.d.ts +139 -0
  68. package/dist/api/core/io/job/index.d.ts.map +1 -0
  69. package/dist/api/core/io/query/index.d.ts +74 -0
  70. package/dist/api/core/io/query/index.d.ts.map +1 -0
  71. package/dist/api/core/io/terrain/index.d.ts +206 -0
  72. package/dist/api/core/io/terrain/index.d.ts.map +1 -0
  73. package/dist/api/core/io/underlay/index.d.ts +286 -0
  74. package/dist/api/core/io/underlay/index.d.ts.map +1 -0
  75. package/dist/api/core/layers.d.ts +402 -0
  76. package/dist/api/core/layers.d.ts.map +1 -0
  77. package/dist/api/core/math/quat.d.ts +111 -128
  78. package/dist/api/core/math/quat.d.ts.map +1 -1
  79. package/dist/api/core/math/vec3.d.ts +120 -102
  80. package/dist/api/core/math/vec3.d.ts.map +1 -1
  81. package/dist/api/core/project/index.d.ts +399 -0
  82. package/dist/api/core/project/index.d.ts.map +1 -0
  83. package/dist/api/core/tags.d.ts +755 -0
  84. package/dist/api/core/tags.d.ts.map +1 -0
  85. package/dist/api/core/units/index.d.ts +175 -0
  86. package/dist/api/core/units/index.d.ts.map +1 -0
  87. package/dist/api/core/zoom/index.d.ts +45 -0
  88. package/dist/api/core/zoom/index.d.ts.map +1 -0
  89. package/dist/api/design/boolean/index.d.ts +168 -0
  90. package/dist/api/design/boolean/index.d.ts.map +1 -0
  91. package/dist/api/design/create/index.d.ts +837 -0
  92. package/dist/api/design/create/index.d.ts.map +1 -0
  93. package/dist/api/design/delete/index.d.ts +63 -0
  94. package/dist/api/design/delete/index.d.ts.map +1 -0
  95. package/dist/api/design/doors/index.d.ts +268 -0
  96. package/dist/api/design/doors/index.d.ts.map +1 -0
  97. package/dist/api/design/edit/index.d.ts +49 -0
  98. package/dist/api/design/edit/index.d.ts.map +1 -0
  99. package/dist/api/design/erase/index.d.ts +160 -0
  100. package/dist/api/design/erase/index.d.ts.map +1 -0
  101. package/dist/api/design/furniture/index.d.ts +123 -0
  102. package/dist/api/design/furniture/index.d.ts.map +1 -0
  103. package/dist/api/design/index.d.ts +153 -0
  104. package/dist/api/design/index.d.ts.map +1 -0
  105. package/dist/api/design/lock.d.ts +41 -0
  106. package/dist/api/design/lock.d.ts.map +1 -0
  107. package/dist/api/design/materials/index.d.ts +297 -0
  108. package/dist/api/design/materials/index.d.ts.map +1 -0
  109. package/dist/api/design/query/geometry/index.d.ts +140 -0
  110. package/dist/api/design/query/geometry/index.d.ts.map +1 -0
  111. package/dist/api/design/query/index.d.ts +1011 -0
  112. package/dist/api/design/query/index.d.ts.map +1 -0
  113. package/dist/api/design/query/spaces.d.ts +221 -0
  114. package/dist/api/design/query/spaces.d.ts.map +1 -0
  115. package/dist/api/design/selection/index.d.ts +282 -0
  116. package/dist/api/design/selection/index.d.ts.map +1 -0
  117. package/dist/api/design/shared.d.ts +38 -0
  118. package/dist/api/design/shared.d.ts.map +1 -0
  119. package/dist/api/design/transform/index.d.ts +87 -0
  120. package/dist/api/design/transform/index.d.ts.map +1 -0
  121. package/dist/api/design/update/index.d.ts +178 -0
  122. package/dist/api/design/update/index.d.ts.map +1 -0
  123. package/dist/api/design/windows/index.d.ts +189 -0
  124. package/dist/api/design/windows/index.d.ts.map +1 -0
  125. package/dist/api/entity/buildableEnvelope.d.ts +261 -0
  126. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
  127. package/dist/api/entity/department.d.ts +0 -98
  128. package/dist/api/entity/department.d.ts.map +1 -1
  129. package/dist/api/entity/index.d.ts +9 -9
  130. package/dist/api/entity/index.d.ts.map +1 -1
  131. package/dist/api/entity/referenceLine.d.ts +49 -106
  132. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  133. package/dist/api/entity/space.d.ts +484 -251
  134. package/dist/api/entity/space.d.ts.map +1 -1
  135. package/dist/api/entity/story.d.ts +49 -39
  136. package/dist/api/entity/story.d.ts.map +1 -1
  137. package/dist/api/index.d.ts +22 -12
  138. package/dist/api/index.d.ts.map +1 -1
  139. package/dist/api/presentation/aiInspiration.d.ts +440 -0
  140. package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
  141. package/dist/api/presentation/diagrams.d.ts +81 -0
  142. package/dist/api/presentation/diagrams.d.ts.map +1 -0
  143. package/dist/api/presentation/import.d.ts +113 -0
  144. package/dist/api/presentation/import.d.ts.map +1 -0
  145. package/dist/api/presentation/index.d.ts +46 -0
  146. package/dist/api/presentation/index.d.ts.map +1 -0
  147. package/dist/api/presentation/sheets.d.ts +176 -0
  148. package/dist/api/presentation/sheets.d.ts.map +1 -0
  149. package/dist/api/presentation/views.d.ts +296 -0
  150. package/dist/api/presentation/views.d.ts.map +1 -0
  151. package/dist/api/program/adjacency.d.ts +155 -0
  152. package/dist/api/program/adjacency.d.ts.map +1 -0
  153. package/dist/api/program/areas.d.ts +360 -0
  154. package/dist/api/program/areas.d.ts.map +1 -0
  155. package/dist/api/program/classification.d.ts +135 -0
  156. package/dist/api/program/classification.d.ts.map +1 -0
  157. package/dist/api/program/cores.d.ts +174 -0
  158. package/dist/api/program/cores.d.ts.map +1 -0
  159. package/dist/api/program/departments.d.ts +431 -0
  160. package/dist/api/program/departments.d.ts.map +1 -0
  161. package/dist/api/program/index.d.ts +69 -0
  162. package/dist/api/program/index.d.ts.map +1 -0
  163. package/dist/api/program/layout.d.ts +63 -0
  164. package/dist/api/program/layout.d.ts.map +1 -0
  165. package/dist/api/program/metrics.d.ts +108 -0
  166. package/dist/api/program/metrics.d.ts.map +1 -0
  167. package/dist/api/program/site.d.ts +451 -0
  168. package/dist/api/program/site.d.ts.map +1 -0
  169. package/dist/api/program/spreadsheet.d.ts +2041 -0
  170. package/dist/api/program/spreadsheet.d.ts.map +1 -0
  171. package/dist/handles.d.ts +171 -0
  172. package/dist/handles.d.ts.map +1 -0
  173. package/dist/host-utils.d.ts +7 -5
  174. package/dist/host-utils.d.ts.map +1 -1
  175. package/dist/index.cjs +4344 -899
  176. package/dist/index.cjs.map +1 -1
  177. package/dist/index.d.ts +1 -0
  178. package/dist/index.d.ts.map +1 -1
  179. package/dist/index.js +3682 -865
  180. package/dist/index.js.map +1 -1
  181. package/package.json +6 -2
  182. package/scripts/generate-manifest.mjs +193 -0
  183. package/scripts/generate-manifest.test.mjs +215 -0
  184. package/src/api/analysis/heatmaps.ts +256 -0
  185. package/src/api/analysis/illuminance.ts +155 -0
  186. package/src/api/analysis/index.ts +46 -0
  187. package/src/api/analysis/shadows.ts +183 -0
  188. package/src/api/analysis/sunlightHours.ts +211 -0
  189. package/src/api/analysis/sunpath.ts +83 -0
  190. package/src/api/core/buildings.ts +485 -0
  191. package/src/api/core/comment/index.ts +258 -0
  192. package/src/api/core/geom/create/index.ts +293 -0
  193. package/src/api/core/geom/delete/index.ts +78 -0
  194. package/src/api/core/geom/index.ts +24 -23
  195. package/src/api/core/geom/query/arc.ts +169 -0
  196. package/src/api/core/geom/query/brep.ts +444 -0
  197. package/src/api/core/geom/query/circle.ts +404 -0
  198. package/src/api/core/geom/query/contour.ts +540 -0
  199. package/src/api/core/geom/query/curve.ts +1078 -0
  200. package/src/api/core/geom/query/edge.ts +130 -0
  201. package/src/api/core/geom/query/face.ts +403 -0
  202. package/src/api/core/geom/query/halfedge.ts +210 -0
  203. package/src/api/core/geom/query/index.ts +63 -0
  204. package/src/api/core/geom/query/profile.ts +473 -0
  205. package/src/api/core/geom/query/vertex.ts +205 -0
  206. package/src/api/core/geom/update/contour.ts +315 -0
  207. package/src/api/core/geom/update/curve.ts +209 -0
  208. package/src/api/core/geom/update/index.ts +29 -0
  209. package/src/api/core/geom/update/profile.ts +377 -0
  210. package/src/api/core/groups.ts +521 -0
  211. package/src/api/core/history/index.ts +84 -0
  212. package/src/api/core/index.ts +51 -1
  213. package/src/api/core/io/import/index.ts +432 -0
  214. package/src/api/core/io/index.ts +37 -0
  215. package/src/api/core/io/job/index.ts +140 -0
  216. package/src/api/core/io/query/index.ts +71 -0
  217. package/src/api/core/io/terrain/index.ts +214 -0
  218. package/src/api/core/io/underlay/index.ts +295 -0
  219. package/src/api/core/layers.ts +333 -0
  220. package/src/api/core/math/quat.ts +112 -235
  221. package/src/api/core/math/vec3.ts +124 -159
  222. package/src/api/core/project/index.ts +418 -0
  223. package/src/api/core/tags.ts +808 -0
  224. package/src/api/core/units/index.ts +164 -0
  225. package/src/api/core/zoom/index.ts +47 -0
  226. package/src/api/design/boolean/index.ts +179 -0
  227. package/src/api/design/create/index.ts +895 -0
  228. package/src/api/design/delete/index.ts +67 -0
  229. package/src/api/design/doors/index.ts +285 -0
  230. package/src/api/design/edit/index.ts +54 -0
  231. package/src/api/design/erase/index.ts +151 -0
  232. package/src/api/design/furniture/index.ts +130 -0
  233. package/src/api/design/index.ts +162 -0
  234. package/src/api/design/lock.ts +42 -0
  235. package/src/api/design/materials/index.ts +301 -0
  236. package/src/api/design/query/geometry/index.ts +166 -0
  237. package/src/api/design/query/index.ts +937 -0
  238. package/src/api/design/query/spaces.ts +132 -0
  239. package/src/api/design/selection/index.ts +273 -0
  240. package/src/api/design/shared.ts +40 -0
  241. package/src/api/design/transform/index.ts +93 -0
  242. package/src/api/design/update/index.ts +117 -0
  243. package/src/api/design/windows/index.ts +207 -0
  244. package/src/api/entity/buildableEnvelope.ts +318 -0
  245. package/src/api/entity/department.ts +0 -113
  246. package/src/api/entity/index.ts +9 -9
  247. package/src/api/entity/referenceLine.ts +50 -38
  248. package/src/api/entity/space.ts +285 -226
  249. package/src/api/entity/story.ts +53 -42
  250. package/src/api/index.ts +22 -12
  251. package/src/api/presentation/aiInspiration.ts +362 -0
  252. package/src/api/presentation/diagrams.ts +84 -0
  253. package/src/api/presentation/import.ts +112 -0
  254. package/src/api/presentation/index.ts +48 -0
  255. package/src/api/presentation/sheets.ts +198 -0
  256. package/src/api/presentation/views.ts +303 -0
  257. package/src/api/program/adjacency.ts +164 -0
  258. package/src/api/program/areas.ts +335 -0
  259. package/src/api/program/classification.ts +138 -0
  260. package/src/api/program/cores.ts +171 -0
  261. package/src/api/program/departments.ts +465 -0
  262. package/src/api/program/index.ts +71 -0
  263. package/src/api/program/layout.ts +68 -0
  264. package/src/api/program/metrics.ts +120 -0
  265. package/src/api/program/site.ts +419 -0
  266. package/src/api/program/spreadsheet.ts +2075 -0
  267. package/src/handles.ts +194 -0
  268. package/src/host-utils.ts +10 -6
  269. package/src/index.ts +1 -0
  270. package/dist/api/core/geom/arc.d.ts +0 -81
  271. package/dist/api/core/geom/arc.d.ts.map +0 -1
  272. package/dist/api/core/geom/curve.d.ts +0 -70
  273. package/dist/api/core/geom/curve.d.ts.map +0 -1
  274. package/dist/api/core/geom/line.d.ts +0 -56
  275. package/dist/api/core/geom/line.d.ts.map +0 -1
  276. package/dist/api/core/geom/profile.d.ts +0 -121
  277. package/dist/api/core/geom/profile.d.ts.map +0 -1
  278. package/dist/api/tools/copy.d.ts +0 -59
  279. package/dist/api/tools/copy.d.ts.map +0 -1
  280. package/dist/api/tools/index.d.ts +0 -33
  281. package/dist/api/tools/index.d.ts.map +0 -1
  282. package/dist/api/tools/material.d.ts +0 -51
  283. package/dist/api/tools/material.d.ts.map +0 -1
  284. package/dist/api/tools/offset.d.ts +0 -43
  285. package/dist/api/tools/offset.d.ts.map +0 -1
  286. package/dist/api/tools/selection.d.ts +0 -48
  287. package/dist/api/tools/selection.d.ts.map +0 -1
  288. package/dist/api/tools/transform.d.ts +0 -114
  289. package/dist/api/tools/transform.d.ts.map +0 -1
  290. package/dist/api/units/index.d.ts +0 -163
  291. package/dist/api/units/index.d.ts.map +0 -1
  292. package/src/api/core/geom/arc.ts +0 -70
  293. package/src/api/core/geom/curve.ts +0 -41
  294. package/src/api/core/geom/line.ts +0 -53
  295. package/src/api/core/geom/profile.ts +0 -94
  296. package/src/api/tools/copy.ts +0 -55
  297. package/src/api/tools/index.ts +0 -39
  298. package/src/api/tools/material.ts +0 -49
  299. package/src/api/tools/offset.ts +0 -43
  300. package/src/api/tools/selection.ts +0 -51
  301. package/src/api/tools/transform.ts +0 -117
  302. package/src/api/units/index.ts +0 -163
@@ -0,0 +1,485 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ import { ComponentHandle } from "../../handles";
4
+ /**
5
+ * Groups — read and edit the group hierarchy of the active project.
6
+ *
7
+ * A **group** is a named, lockable container that bundles components (and other
8
+ * groups) so they can be selected and transformed as one. This is the
9
+ * plugin-facing view of that hierarchy: a group's identity, name, member count,
10
+ * lock state, and parent — never the underlying meshes.
11
+ *
12
+ * Reads return plain records and never throw for a missing group (`get` returns
13
+ * `null`, `list` returns `[]`, `isLocked` returns `false`). Ids are stable public
14
+ * strings, never engine mesh handles.
15
+ *
16
+ * Members are moved and copied through the design operations by group id — use
17
+ * {@linkcode PluginDesignApi.transform}`.move` and `design.create.copy`, not a method here.
18
+ * Locking likewise routes through `design.lock`.
19
+ *
20
+ * Sub-namespace members typed as optional (`?`) are **authored ahead of the
21
+ * host** — declared so plugins and codegen can see the shape, but kept out of the
22
+ * discovery manifest until the host lands them (at which point they are promoted
23
+ * to required `abstract` members).
24
+ *
25
+ * Accessed via `snaptrude.core.groups`.
26
+ */
27
+ export declare abstract class PluginCoreGroupsApi {
28
+ constructor();
29
+ /**
30
+ * List every group in the active project.
31
+ *
32
+ * Returns each group's identity, member count, lock state, and parent group
33
+ * (when nested), for the whole project.
34
+ *
35
+ * @returns A {@linkcode PluginCoreGroupsListResult} with a `groups` array
36
+ * (empty when the project has none).
37
+ *
38
+ * @examplePrompt List all the groups in my project
39
+ * @examplePrompt What groups do I have and how many things are in each?
40
+ * @examplePrompt Show every group with its lock state
41
+ * @examplePrompt How many groups are in this model?
42
+ *
43
+ * # Example
44
+ * ```ts
45
+ * const { groups } = await snaptrude.core.groups.list()
46
+ * for (const g of groups) console.log(g.name, g.memberCount, g.isLocked)
47
+ * ```
48
+ */
49
+ abstract list(): PluginApiReturn<PluginCoreGroupsListResult>;
50
+ /**
51
+ * Get a single group by id.
52
+ *
53
+ * @param groupId - The id of the group to read.
54
+ * @returns The matching {@linkcode PluginCoreGroupRef}, or `null` if no group
55
+ * has that id.
56
+ *
57
+ * @examplePrompt Get the group with id group-12
58
+ * @examplePrompt Look up a single group by its id
59
+ * @examplePrompt Is group-3 locked and how many members does it have?
60
+ *
61
+ * # Example
62
+ * ```ts
63
+ * const group = await snaptrude.core.groups.get("group-12")
64
+ * if (group) console.log(group.name, group.memberCount)
65
+ * ```
66
+ */
67
+ abstract get(groupId: string): PluginApiReturn<PluginCoreGroupsGetResult>;
68
+ /**
69
+ * Get the group a component belongs to.
70
+ *
71
+ * Returns the **innermost** group directly containing the component, or `null`
72
+ * if the component is ungrouped or does not exist.
73
+ *
74
+ * @param componentId - The `Component.id` of the component to look up.
75
+ * @returns The innermost {@linkcode PluginCoreGroupRef} containing the
76
+ * component, or `null`.
77
+ *
78
+ * @examplePrompt Which group is this wall in?
79
+ * @examplePrompt Find the group that contains component cmp_42
80
+ * @examplePrompt Is this element grouped, and if so which group?
81
+ *
82
+ * # Example
83
+ * ```ts
84
+ * const group = await snaptrude.core.groups.getForComponent("cmp_42")
85
+ * console.log(group ? group.name : "ungrouped")
86
+ * ```
87
+ */
88
+ abstract getForComponent(componentId: ComponentHandle): PluginApiReturn<PluginCoreGroupsGetForComponentResult>;
89
+ /**
90
+ * List the direct members of a group.
91
+ *
92
+ * Returns each direct child as an id + kind (`component` or a nested `group`).
93
+ * Nested groups are returned as members, not flattened.
94
+ *
95
+ * @param groupId - The id of the group whose members to read.
96
+ * @returns A {@linkcode PluginCoreGroupsListMembersResult} with a `members`
97
+ * array (empty when the group is empty or missing).
98
+ *
99
+ * @examplePrompt What's inside group-12?
100
+ * @examplePrompt List the members of this group
101
+ * @examplePrompt Show the components and subgroups in group-3
102
+ *
103
+ * # Example
104
+ * ```ts
105
+ * const { members } = await snaptrude.core.groups.listMembers("group-12")
106
+ * for (const m of members) console.log(m.type, m.id)
107
+ * ```
108
+ */
109
+ abstract listMembers(groupId: string): PluginApiReturn<PluginCoreGroupsListMembersResult>;
110
+ /**
111
+ * Report whether a group is locked.
112
+ *
113
+ * A predicate: it never mutates and never throws — an unknown group id returns
114
+ * `false`.
115
+ *
116
+ * @param groupId - The id of the group to test.
117
+ * @returns `true` if the group exists and is locked, otherwise `false`.
118
+ *
119
+ * @examplePrompt Is group-12 locked?
120
+ * @examplePrompt Check whether this group is locked before editing it
121
+ * @examplePrompt Tell me if the group is locked
122
+ *
123
+ * # Example
124
+ * ```ts
125
+ * if (await snaptrude.core.groups.isLocked("group-12")) {
126
+ * console.log("locked — unlock it first")
127
+ * }
128
+ * ```
129
+ */
130
+ abstract isLocked(groupId: string): PluginApiReturn<PluginCoreGroupsIsLockedResult>;
131
+ /**
132
+ * Get the axis-aligned bounds of a group.
133
+ *
134
+ * Returns the world-space bounding box of everything in the group — its `min`
135
+ * and `max` corners and the `center` — in internal units, or `null` when the
136
+ * group is empty (has no meshes) or does not exist. `null` is distinct from a
137
+ * real group at the origin, whose box is centered on `{0,0,0}`.
138
+ *
139
+ * @param groupId - The id of the group to measure.
140
+ * @returns A {@linkcode PluginCoreGroupsGetBoundsResult} with `min`, `max`, and
141
+ * `center` points, or `null` if the group is empty or gone.
142
+ *
143
+ * @examplePrompt How big is this group?
144
+ * @examplePrompt Get the bounding box of group-12
145
+ * @examplePrompt Where is the center of this group?
146
+ *
147
+ * # Example
148
+ * ```ts
149
+ * const bounds = await snaptrude.core.groups.getBounds("group-12")
150
+ * if (bounds) console.log(bounds.center.x, bounds.center.y, bounds.center.z)
151
+ * ```
152
+ */
153
+ abstract getBounds(groupId: string): PluginApiReturn<PluginCoreGroupsGetBoundsResult>;
154
+ /**
155
+ * Group components into a new group.
156
+ *
157
+ * Bundles the given components under a new group. Pass a `name` to label it;
158
+ * otherwise it gets an auto-generated fallback name that you can change later
159
+ * with {@linkcode PluginCoreGroupsApi.update}.
160
+ *
161
+ * @param componentIds - The ids of the components to group (at least one).
162
+ * @param name - Display name for the new group (auto-generated if omitted).
163
+ * @returns The new group's id (read the full record back with
164
+ * {@linkcode PluginCoreGroupsApi.get}).
165
+ * @throws If a component id is invalid or the group could not be created.
166
+ *
167
+ * @examplePrompt Group the selected components
168
+ * @examplePrompt Make a group called Kitchen from these elements
169
+ * @examplePrompt Bundle components cmp_1 and cmp_2 into a group
170
+ *
171
+ * # Example
172
+ * ```ts
173
+ * const { groupId } = await snaptrude.core.groups.create(["cmp_1", "cmp_2"], "Kitchen")
174
+ * ```
175
+ */
176
+ abstract create(componentIds: ComponentHandle[], name?: string): PluginApiReturn<PluginCoreGroupsCreateResult>;
177
+ /**
178
+ * Update a group's name and/or membership.
179
+ *
180
+ * A **sparse** update: omitted fields are left unchanged. `addComponentIds`
181
+ * and `removeComponentIds` are applied as membership deltas (add before
182
+ * remove); `name` renames the group.
183
+ *
184
+ * @param groupId - The id of the group to update.
185
+ * @param options - Any of `name`, `addComponentIds`, `removeComponentIds`;
186
+ * omitted fields are left unchanged.
187
+ * @returns The updated {@linkcode PluginCoreGroupRef}.
188
+ * @throws If no group has the given id, or a component id is invalid.
189
+ *
190
+ * @examplePrompt Rename group-12 to Kitchen
191
+ * @examplePrompt Add these two walls to the group
192
+ * @examplePrompt Remove cmp_7 from group-3
193
+ *
194
+ * # Example
195
+ * ```ts
196
+ * const group = await snaptrude.core.groups.update("group-12", {
197
+ * name: "Kitchen",
198
+ * addComponentIds: ["cmp_9"],
199
+ * })
200
+ * ```
201
+ */
202
+ abstract update(groupId: string, options?: {
203
+ name?: string;
204
+ addComponentIds?: ComponentHandle[];
205
+ removeComponentIds?: ComponentHandle[];
206
+ }): PluginApiReturn<PluginCoreGroupsUpdateResult>;
207
+ /**
208
+ * Delete (dissolve) a group.
209
+ *
210
+ * Dissolves the group container. The member elements are **not** deleted —
211
+ * they are returned to the group's parent (or ungrouped at the top level).
212
+ *
213
+ * @param groupId - The id of the group to dissolve.
214
+ * @returns Confirmation that the group was dissolved.
215
+ * @throws If no group has the given id.
216
+ *
217
+ * @examplePrompt Ungroup group-12
218
+ * @examplePrompt Dissolve this group but keep its contents
219
+ * @examplePrompt Delete the group without deleting its members
220
+ *
221
+ * # Example
222
+ * ```ts
223
+ * await snaptrude.core.groups.delete("group-12")
224
+ * ```
225
+ */
226
+ abstract delete(groupId: string): PluginApiReturn<PluginCoreGroupsDeleteResult>;
227
+ }
228
+ /**
229
+ * A group in the active project.
230
+ *
231
+ * | Property | Type | Description |
232
+ * |---|---|---|
233
+ * | `id` | `string` | Stable public group id (e.g. `"group-12"`) — never a mesh handle |
234
+ * | `name` | `string` | Display name (auto-generated fallback until the user sets one) |
235
+ * | `memberCount` | `number` | Number of direct members (components + nested groups) |
236
+ * | `isLocked` | `boolean` | Whether the group is locked against edits |
237
+ * | `parentId` | `string \| undefined` | Parent group id when this group is nested, else absent |
238
+ */
239
+ export declare const PluginCoreGroupRef: z.ZodObject<{
240
+ id: z.ZodString;
241
+ name: z.ZodString;
242
+ memberCount: z.ZodNumber;
243
+ isLocked: z.ZodBoolean;
244
+ parentId: z.ZodOptional<z.ZodString>;
245
+ }, z.core.$strip>;
246
+ export type PluginCoreGroupRef = z.infer<typeof PluginCoreGroupRef>;
247
+ /**
248
+ * A direct member of a group.
249
+ *
250
+ * | Property | Type | Description |
251
+ * |---|---|---|
252
+ * | `id` | `string` | `Component.id` for a component member, or the group id for a nested group |
253
+ * | `type` | `"component" \| "group"` | Whether this member is a component or a nested group |
254
+ */
255
+ export declare const PluginCoreGroupMember: z.ZodObject<{
256
+ id: z.ZodString;
257
+ type: z.ZodEnum<{
258
+ component: "component";
259
+ group: "group";
260
+ }>;
261
+ }, z.core.$strip>;
262
+ export type PluginCoreGroupMember = z.infer<typeof PluginCoreGroupMember>;
263
+ /**
264
+ * Result of {@linkcode PluginCoreGroupsApi.list}.
265
+ *
266
+ * | Property | Type | Description |
267
+ * |---|---|---|
268
+ * | `groups` | {@linkcode PluginCoreGroupRef}`[]` | Every group in the active project |
269
+ */
270
+ export declare const PluginCoreGroupsListResult: z.ZodObject<{
271
+ groups: z.ZodArray<z.ZodObject<{
272
+ id: z.ZodString;
273
+ name: z.ZodString;
274
+ memberCount: z.ZodNumber;
275
+ isLocked: z.ZodBoolean;
276
+ parentId: z.ZodOptional<z.ZodString>;
277
+ }, z.core.$strip>>;
278
+ }, z.core.$strip>;
279
+ export type PluginCoreGroupsListResult = z.infer<typeof PluginCoreGroupsListResult>;
280
+ /**
281
+ * Arguments for {@linkcode PluginCoreGroupsApi.get}.
282
+ *
283
+ * | Property | Type | Description |
284
+ * |---|---|---|
285
+ * | `groupId` | `string` | The id of the group to read |
286
+ */
287
+ export declare const PluginCoreGroupsGetArgs: z.ZodObject<{
288
+ groupId: z.ZodString;
289
+ }, z.core.$strip>;
290
+ export type PluginCoreGroupsGetArgs = z.infer<typeof PluginCoreGroupsGetArgs>;
291
+ /**
292
+ * Result of {@linkcode PluginCoreGroupsApi.get} — the group, or `null` when no
293
+ * group has the given id.
294
+ */
295
+ export declare const PluginCoreGroupsGetResult: z.ZodNullable<z.ZodObject<{
296
+ id: z.ZodString;
297
+ name: z.ZodString;
298
+ memberCount: z.ZodNumber;
299
+ isLocked: z.ZodBoolean;
300
+ parentId: z.ZodOptional<z.ZodString>;
301
+ }, z.core.$strip>>;
302
+ export type PluginCoreGroupsGetResult = z.infer<typeof PluginCoreGroupsGetResult>;
303
+ /**
304
+ * Arguments for {@linkcode PluginCoreGroupsApi.getForComponent}.
305
+ *
306
+ * | Property | Type | Description |
307
+ * |---|---|---|
308
+ * | `componentId` | `ComponentHandle` | The `Component.id` to look up |
309
+ */
310
+ export declare const PluginCoreGroupsGetForComponentArgs: z.ZodObject<{
311
+ componentId: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
312
+ }, z.core.$strip>;
313
+ export type PluginCoreGroupsGetForComponentArgs = z.infer<typeof PluginCoreGroupsGetForComponentArgs>;
314
+ /**
315
+ * Result of {@linkcode PluginCoreGroupsApi.getForComponent} — the innermost
316
+ * group containing the component, or `null`.
317
+ */
318
+ export declare const PluginCoreGroupsGetForComponentResult: z.ZodNullable<z.ZodObject<{
319
+ id: z.ZodString;
320
+ name: z.ZodString;
321
+ memberCount: z.ZodNumber;
322
+ isLocked: z.ZodBoolean;
323
+ parentId: z.ZodOptional<z.ZodString>;
324
+ }, z.core.$strip>>;
325
+ export type PluginCoreGroupsGetForComponentResult = z.infer<typeof PluginCoreGroupsGetForComponentResult>;
326
+ /**
327
+ * Arguments for {@linkcode PluginCoreGroupsApi.listMembers}.
328
+ *
329
+ * | Property | Type | Description |
330
+ * |---|---|---|
331
+ * | `groupId` | `string` | The id of the group whose members to read |
332
+ */
333
+ export declare const PluginCoreGroupsListMembersArgs: z.ZodObject<{
334
+ groupId: z.ZodString;
335
+ }, z.core.$strip>;
336
+ export type PluginCoreGroupsListMembersArgs = z.infer<typeof PluginCoreGroupsListMembersArgs>;
337
+ /**
338
+ * Result of {@linkcode PluginCoreGroupsApi.listMembers}.
339
+ *
340
+ * | Property | Type | Description |
341
+ * |---|---|---|
342
+ * | `members` | {@linkcode PluginCoreGroupMember}`[]` | The group's direct members (empty when the group is empty or missing) |
343
+ */
344
+ export declare const PluginCoreGroupsListMembersResult: z.ZodObject<{
345
+ members: z.ZodArray<z.ZodObject<{
346
+ id: z.ZodString;
347
+ type: z.ZodEnum<{
348
+ component: "component";
349
+ group: "group";
350
+ }>;
351
+ }, z.core.$strip>>;
352
+ }, z.core.$strip>;
353
+ export type PluginCoreGroupsListMembersResult = z.infer<typeof PluginCoreGroupsListMembersResult>;
354
+ /**
355
+ * Arguments for {@linkcode PluginCoreGroupsApi.isLocked}.
356
+ *
357
+ * | Property | Type | Description |
358
+ * |---|---|---|
359
+ * | `groupId` | `string` | The id of the group to test |
360
+ */
361
+ export declare const PluginCoreGroupsIsLockedArgs: z.ZodObject<{
362
+ groupId: z.ZodString;
363
+ }, z.core.$strip>;
364
+ export type PluginCoreGroupsIsLockedArgs = z.infer<typeof PluginCoreGroupsIsLockedArgs>;
365
+ /**
366
+ * Result of {@linkcode PluginCoreGroupsApi.isLocked} — `true` when the group
367
+ * exists and is locked, else `false`.
368
+ */
369
+ export declare const PluginCoreGroupsIsLockedResult: z.ZodBoolean;
370
+ export type PluginCoreGroupsIsLockedResult = z.infer<typeof PluginCoreGroupsIsLockedResult>;
371
+ /**
372
+ * Arguments for {@linkcode PluginCoreGroupsApi.getBounds}.
373
+ *
374
+ * | Property | Type | Description |
375
+ * |---|---|---|
376
+ * | `groupId` | `string` | The id of the group to measure |
377
+ */
378
+ export declare const PluginCoreGroupsGetBoundsArgs: z.ZodObject<{
379
+ groupId: z.ZodString;
380
+ }, z.core.$strip>;
381
+ export type PluginCoreGroupsGetBoundsArgs = z.infer<typeof PluginCoreGroupsGetBoundsArgs>;
382
+ /**
383
+ * Result of {@linkcode PluginCoreGroupsApi.getBounds} — the group's world-space
384
+ * axis-aligned bounds in internal units, or `null` when the group is empty (has
385
+ * no meshes) or does not exist.
386
+ *
387
+ * | Property | Type | Description |
388
+ * |---|---|---|
389
+ * | `min` | {@linkcode Vec3Components} | The minimum corner (`x`, `y`, `z`) |
390
+ * | `max` | {@linkcode Vec3Components} | The maximum corner (`x`, `y`, `z`) |
391
+ * | `center` | {@linkcode Vec3Components} | The box center (`x`, `y`, `z`) |
392
+ */
393
+ export declare const PluginCoreGroupsGetBoundsResult: z.ZodNullable<z.ZodObject<{
394
+ min: z.ZodObject<{
395
+ x: z.ZodNumber;
396
+ y: z.ZodNumber;
397
+ z: z.ZodNumber;
398
+ }, z.core.$strip>;
399
+ max: z.ZodObject<{
400
+ x: z.ZodNumber;
401
+ y: z.ZodNumber;
402
+ z: z.ZodNumber;
403
+ }, z.core.$strip>;
404
+ center: z.ZodObject<{
405
+ x: z.ZodNumber;
406
+ y: z.ZodNumber;
407
+ z: z.ZodNumber;
408
+ }, z.core.$strip>;
409
+ }, z.core.$strip>>;
410
+ export type PluginCoreGroupsGetBoundsResult = z.infer<typeof PluginCoreGroupsGetBoundsResult>;
411
+ /**
412
+ * Arguments for {@linkcode PluginCoreGroupsApi.create}.
413
+ *
414
+ * | Property | Type | Description |
415
+ * |---|---|---|
416
+ * | `componentIds` | `ComponentHandle[]` | The ids of the components to group (at least one) |
417
+ * | `name` | `string \| undefined` | Display name for the new group (auto-generated if omitted) |
418
+ */
419
+ export declare const PluginCoreGroupsCreateArgs: z.ZodObject<{
420
+ componentIds: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
421
+ name: z.ZodOptional<z.ZodString>;
422
+ }, z.core.$strip>;
423
+ export type PluginCoreGroupsCreateArgs = z.infer<typeof PluginCoreGroupsCreateArgs>;
424
+ /**
425
+ * Result of {@linkcode PluginCoreGroupsApi.create} — the id of the new group.
426
+ *
427
+ * | Property | Type | Description |
428
+ * |---|---|---|
429
+ * | `groupId` | `string` | The id of the newly created group |
430
+ */
431
+ export declare const PluginCoreGroupsCreateResult: z.ZodObject<{
432
+ groupId: z.ZodString;
433
+ }, z.core.$strip>;
434
+ export type PluginCoreGroupsCreateResult = z.infer<typeof PluginCoreGroupsCreateResult>;
435
+ /**
436
+ * Arguments for {@linkcode PluginCoreGroupsApi.update}. Sparse — only the
437
+ * provided fields are changed.
438
+ *
439
+ * | Property | Type | Description |
440
+ * |---|---|---|
441
+ * | `groupId` | `string` | The id of the group to update |
442
+ * | `name` | `string \| undefined` | New display name (unchanged if omitted) |
443
+ * | `addComponentIds` | `ComponentHandle[] \| undefined` | Components to add to the group |
444
+ * | `removeComponentIds` | `ComponentHandle[] \| undefined` | Components to remove from the group |
445
+ */
446
+ export declare const PluginCoreGroupsUpdateArgs: z.ZodObject<{
447
+ groupId: z.ZodString;
448
+ name: z.ZodOptional<z.ZodString>;
449
+ addComponentIds: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>>;
450
+ removeComponentIds: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>>;
451
+ }, z.core.$strip>;
452
+ export type PluginCoreGroupsUpdateArgs = z.infer<typeof PluginCoreGroupsUpdateArgs>;
453
+ /** Result of {@linkcode PluginCoreGroupsApi.update} — the updated group record. */
454
+ export declare const PluginCoreGroupsUpdateResult: z.ZodObject<{
455
+ id: z.ZodString;
456
+ name: z.ZodString;
457
+ memberCount: z.ZodNumber;
458
+ isLocked: z.ZodBoolean;
459
+ parentId: z.ZodOptional<z.ZodString>;
460
+ }, z.core.$strip>;
461
+ export type PluginCoreGroupsUpdateResult = z.infer<typeof PluginCoreGroupsUpdateResult>;
462
+ /**
463
+ * Arguments for {@linkcode PluginCoreGroupsApi.delete}.
464
+ *
465
+ * | Property | Type | Description |
466
+ * |---|---|---|
467
+ * | `groupId` | `string` | The id of the group to dissolve |
468
+ */
469
+ export declare const PluginCoreGroupsDeleteArgs: z.ZodObject<{
470
+ groupId: z.ZodString;
471
+ }, z.core.$strip>;
472
+ export type PluginCoreGroupsDeleteArgs = z.infer<typeof PluginCoreGroupsDeleteArgs>;
473
+ /**
474
+ * Result of {@linkcode PluginCoreGroupsApi.delete} — confirmation that the group
475
+ * was dissolved (its members are preserved).
476
+ *
477
+ * | Property | Type | Description |
478
+ * |---|---|---|
479
+ * | `deleted` | `true` | Always `true` on success |
480
+ */
481
+ export declare const PluginCoreGroupsDeleteResult: z.ZodObject<{
482
+ deleted: z.ZodLiteral<true>;
483
+ }, z.core.$strip>;
484
+ export type PluginCoreGroupsDeleteResult = z.infer<typeof PluginCoreGroupsDeleteResult>;
485
+ //# sourceMappingURL=groups.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"groups.d.ts","sourceRoot":"","sources":["../../../src/api/core/groups.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAkB,MAAM,eAAe,CAAA;AAE/D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,8BAAsB,mBAAmB;;IAGvC;;;;;;;;;;;;;;;;;;;OAmBG;aACa,IAAI,IAAI,eAAe,CAAC,0BAA0B,CAAC;IAEnE;;;;;;;;;;;;;;;;OAgBG;a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4BAA4B,CACpC,CAAA"}
@@ -0,0 +1,78 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../../types";
3
+ /**
4
+ * Undo / redo of committed history entries.
5
+ *
6
+ * History steps operate on Snaptrude's command stack: {@linkcode PluginHistoryApi.undo}
7
+ * steps back over committed entries, {@linkcode PluginHistoryApi.redo} re-applies
8
+ * undone ones. Both take an optional step count (default 1) and report how many
9
+ * steps were actually applied — fewer than requested when the stack runs out.
10
+ *
11
+ * Accessed via `snaptrude.core.history`.
12
+ */
13
+ export declare abstract class PluginHistoryApi {
14
+ constructor();
15
+ /**
16
+ * Step back over committed history entries.
17
+ *
18
+ * @param steps - (Optional) The number of entries to undo (default 1).
19
+ * @returns A {@linkcode PluginHistoryStepResult} with `stepsApplied` — the
20
+ * entries actually undone (≤ `steps`; fewer if the undo stack ran out).
21
+ *
22
+ * @examplePrompt Undo my last change
23
+ * @examplePrompt Undo the last 3 actions
24
+ * @examplePrompt Revert what I just did to the model
25
+ * @examplePrompt Step back one change
26
+ * @examplePrompt Take back that last edit
27
+ *
28
+ * # Example
29
+ * ```ts
30
+ * await snaptrude.core.history.undo() // one step
31
+ * await snaptrude.core.history.undo(3) // up to three steps
32
+ * ```
33
+ */
34
+ abstract undo(steps?: number): PluginApiReturn<PluginHistoryStepResult>;
35
+ /**
36
+ * Step forward over previously undone entries. Symmetric with
37
+ * {@linkcode PluginHistoryApi.undo}.
38
+ *
39
+ * @param steps - (Optional) The number of entries to redo (default 1).
40
+ * @returns A {@linkcode PluginHistoryStepResult} with `stepsApplied` — the
41
+ * entries actually redone (≤ `steps`; fewer if the redo stack ran out).
42
+ *
43
+ * @examplePrompt Redo the change I just undid
44
+ * @examplePrompt Redo the last two undone actions
45
+ * @examplePrompt Bring back the edit I reverted
46
+ * @examplePrompt Step forward again in the history
47
+ *
48
+ * # Example
49
+ * ```ts
50
+ * await snaptrude.core.history.redo()
51
+ * await snaptrude.core.history.redo(2)
52
+ * ```
53
+ */
54
+ abstract redo(steps?: number): PluginApiReturn<PluginHistoryStepResult>;
55
+ }
56
+ /**
57
+ * Arguments for {@linkcode PluginHistoryApi.undo} / {@linkcode PluginHistoryApi.redo}.
58
+ *
59
+ * | Property | Type | Description |
60
+ * |---|---|---|
61
+ * | `steps` | `number?` | Number of history entries to step (positive integer). Defaults to 1. |
62
+ */
63
+ export declare const PluginHistoryStepArgs: z.ZodObject<{
64
+ steps: z.ZodOptional<z.ZodNumber>;
65
+ }, z.core.$strip>;
66
+ export type PluginHistoryStepArgs = z.infer<typeof PluginHistoryStepArgs>;
67
+ /**
68
+ * Result of {@linkcode PluginHistoryApi.undo} / {@linkcode PluginHistoryApi.redo}.
69
+ *
70
+ * | Property | Type | Description |
71
+ * |---|---|---|
72
+ * | `stepsApplied` | `number` | History entries actually stepped — `≤ steps`, fewer when the stack ran out. |
73
+ */
74
+ export declare const PluginHistoryStepResult: z.ZodObject<{
75
+ stepsApplied: z.ZodNumber;
76
+ }, z.core.$strip>;
77
+ export type PluginHistoryStepResult = z.infer<typeof PluginHistoryStepResult>;
78
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/history/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD;;;;;;;;;GASG;AACH,8BAAsB,gBAAgB;;IAGpC;;;;;;;;;;;;;;;;;;OAkBG;aACa,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,uBAAuB,CAAC;IAE9E;;;;;;;;;;;;;;;;;;OAkBG;aACa,IAAI,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC,uBAAuB,CAAC;CAC/E;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB;;iBAEhC,CAAA;AAEF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB;;iBAElC,CAAA;AAEF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA"}
@@ -1,18 +1,68 @@
1
1
  import { PluginMathApi } from "./math";
2
2
  import { PluginGeomApi } from "./geom";
3
+ import { PluginHistoryApi } from "./history";
4
+ import { PluginUnitsApi } from "./units";
5
+ import { PluginZoomApi } from "./zoom";
6
+ import { PluginProjectApi } from "./project";
7
+ import { PluginCommentApi } from "./comment";
8
+ import { PluginCoreGroupsApi } from "./groups";
9
+ import { PluginCoreBuildingsApi } from "./buildings";
10
+ import { PluginCoreLayersApi } from "./layers";
11
+ import { PluginCoreTagsApi } from "./tags";
12
+ import { PluginCoreIoApi } from "./io";
3
13
  /**
4
- * Core primitives used across the plugin API.
14
+ * Core primitives and infrastructure used across the plugin API.
5
15
  *
6
16
  * - {@linkcode PluginCoreApi.math} — Vector and quaternion operations
7
17
  * - {@linkcode PluginCoreApi.geom} — Geometry primitives (lines, arcs, curves, profiles)
18
+ * - {@linkcode PluginCoreApi.history} — Undo / redo of committed history entries
19
+ * - {@linkcode PluginCoreApi.units} — Unit-type queries and conversion
20
+ * - {@linkcode PluginCoreApi.zoom} — Camera zoom controls (extents / selection)
21
+ * - {@linkcode PluginCoreApi.project} — Project-level settings and info
22
+ * - {@linkcode PluginCoreApi.comment} — Comments: create, edit, resolve, tag, list
23
+ * - {@linkcode PluginCoreApi.groups} — Read & edit the group hierarchy
24
+ * - {@linkcode PluginCoreApi.buildings} — Read & edit buildings and their storeys
25
+ * - {@linkcode PluginCoreApi.layers} — Read & toggle storey drawing/reference layers
26
+ * - {@linkcode PluginCoreApi.tags} — Tag catalog + assignment
27
+ * - {@linkcode PluginCoreApi.io} — Import files (image/pdf/cad/model/terrain), poll jobs, manage underlays
8
28
  */
9
29
  export declare abstract class PluginCoreApi {
10
30
  /** Vector and quaternion math utilities. See {@linkcode PluginMathApi}. */
11
31
  abstract math: PluginMathApi;
12
32
  /** Geometry primitives and constructors. See {@linkcode PluginGeomApi}. */
13
33
  abstract geom: PluginGeomApi;
34
+ /** Undo / redo of committed history entries. See {@linkcode PluginHistoryApi}. */
35
+ abstract history: PluginHistoryApi;
36
+ /** Unit-type queries and conversion. See {@linkcode PluginUnitsApi}. */
37
+ abstract units: PluginUnitsApi;
38
+ /** Camera zoom controls. See {@linkcode PluginZoomApi}. */
39
+ abstract zoom: PluginZoomApi;
40
+ /** Project-level settings and info. See {@linkcode PluginProjectApi}. */
41
+ abstract project: PluginProjectApi;
42
+ /** Comments — create, edit, resolve, tag, list. See {@linkcode PluginCommentApi}. */
43
+ abstract comment: PluginCommentApi;
44
+ /** Groups — read & edit the group hierarchy. See {@linkcode PluginCoreGroupsApi}. */
45
+ abstract groups: PluginCoreGroupsApi;
46
+ /** Buildings — read & edit buildings and their storeys. See {@linkcode PluginCoreBuildingsApi}. */
47
+ abstract buildings: PluginCoreBuildingsApi;
48
+ /** Layers — read & toggle storey drawing/reference layers. See {@linkcode PluginCoreLayersApi}. */
49
+ abstract layers: PluginCoreLayersApi;
50
+ /** Tags — tag catalog + assignment. See {@linkcode PluginCoreTagsApi}. */
51
+ abstract tags: PluginCoreTagsApi;
52
+ /** I/O — file import, import jobs, and underlay management. See {@linkcode PluginCoreIoApi}. */
53
+ abstract io: PluginCoreIoApi;
14
54
  constructor();
15
55
  }
16
56
  export * from "./math";
17
57
  export * from "./geom";
58
+ export * from "./history";
59
+ export * from "./units";
60
+ export * from "./zoom";
61
+ export * from "./project";
62
+ export * from "./comment";
63
+ export * from "./groups";
64
+ export * from "./buildings";
65
+ export * from "./layers";
66
+ export * from "./tags";
67
+ export * from "./io";
18
68
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/core/index.ts"],"names":[],"mappings":"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