@snaptrude/plugin-core 0.11.0-rc.1 → 1.0.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 (226) hide show
  1. package/AGENTS.md +4 -0
  2. package/CHANGELOG.md +176 -14
  3. package/api-manifest.json +872 -49
  4. package/dist/api/analysis/daylight.d.ts +5 -5
  5. package/dist/api/analysis/solar.d.ts +2 -2
  6. package/dist/api/core/camera/index.d.ts +447 -0
  7. package/dist/api/core/camera/index.d.ts.map +1 -1
  8. package/dist/api/core/geom/create/index.d.ts +942 -101
  9. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  10. package/dist/api/core/geom/query/brep.d.ts +59 -2
  11. package/dist/api/core/geom/query/brep.d.ts.map +1 -1
  12. package/dist/api/core/geom/query/curve.d.ts +59 -35
  13. package/dist/api/core/geom/query/curve.d.ts.map +1 -1
  14. package/dist/api/core/geom/query/edge.d.ts +2 -2
  15. package/dist/api/core/geom/query/face.d.ts +105 -0
  16. package/dist/api/core/geom/query/face.d.ts.map +1 -1
  17. package/dist/api/core/geom/update/contour.d.ts +10 -2
  18. package/dist/api/core/geom/update/contour.d.ts.map +1 -1
  19. package/dist/api/core/geom/update/curve.d.ts +5 -5
  20. package/dist/api/core/geom/update/profile.d.ts +3 -1
  21. package/dist/api/core/geom/update/profile.d.ts.map +1 -1
  22. package/dist/api/core/handles/index.d.ts +4 -2
  23. package/dist/api/core/handles/index.d.ts.map +1 -1
  24. package/dist/api/core/index.d.ts +4 -4
  25. package/dist/api/core/index.d.ts.map +1 -1
  26. package/dist/api/core/io/import/index.d.ts +3 -1
  27. package/dist/api/core/io/import/index.d.ts.map +1 -1
  28. package/dist/api/core/layers.d.ts +377 -255
  29. package/dist/api/core/layers.d.ts.map +1 -1
  30. package/dist/api/core/mode/index.d.ts +19 -7
  31. package/dist/api/core/mode/index.d.ts.map +1 -1
  32. package/dist/api/core/proposals/index.d.ts +4 -3
  33. package/dist/api/core/proposals/index.d.ts.map +1 -1
  34. package/dist/api/core/storeys/index.d.ts +17 -2
  35. package/dist/api/core/storeys/index.d.ts.map +1 -1
  36. package/dist/api/core/storeys/layers.d.ts +408 -0
  37. package/dist/api/core/storeys/layers.d.ts.map +1 -0
  38. package/dist/api/core/tags.d.ts +84 -3
  39. package/dist/api/core/tags.d.ts.map +1 -1
  40. package/dist/api/core/zoom/index.d.ts +13 -0
  41. package/dist/api/core/zoom/index.d.ts.map +1 -1
  42. package/dist/api/design/bim.d.ts +299 -0
  43. package/dist/api/design/bim.d.ts.map +1 -0
  44. package/dist/api/design/boolean/index.d.ts +2 -0
  45. package/dist/api/design/boolean/index.d.ts.map +1 -1
  46. package/dist/api/design/catalog.d.ts +320 -0
  47. package/dist/api/design/catalog.d.ts.map +1 -0
  48. package/dist/api/design/create/bulk-items.d.ts +269 -0
  49. package/dist/api/design/create/bulk-items.d.ts.map +1 -0
  50. package/dist/api/design/create/grids.d.ts +132 -0
  51. package/dist/api/design/create/grids.d.ts.map +1 -0
  52. package/dist/api/design/create/index.d.ts +753 -102
  53. package/dist/api/design/create/index.d.ts.map +1 -1
  54. package/dist/api/design/create/opening-fields.d.ts +38 -0
  55. package/dist/api/design/create/opening-fields.d.ts.map +1 -0
  56. package/dist/api/design/delete/index.d.ts +7 -20
  57. package/dist/api/design/delete/index.d.ts.map +1 -1
  58. package/dist/api/design/dimensions.d.ts +427 -0
  59. package/dist/api/design/dimensions.d.ts.map +1 -0
  60. package/dist/api/design/doors/index.d.ts +24 -23
  61. package/dist/api/design/doors/index.d.ts.map +1 -1
  62. package/dist/api/design/family.d.ts +1446 -0
  63. package/dist/api/design/family.d.ts.map +1 -0
  64. package/dist/api/design/grids.d.ts +237 -0
  65. package/dist/api/design/grids.d.ts.map +1 -0
  66. package/dist/api/design/index.d.ts +30 -0
  67. package/dist/api/design/index.d.ts.map +1 -1
  68. package/dist/api/design/networks.d.ts +1703 -0
  69. package/dist/api/design/networks.d.ts.map +1 -0
  70. package/dist/api/design/query/geometry/index.d.ts +33 -5
  71. package/dist/api/design/query/geometry/index.d.ts.map +1 -1
  72. package/dist/api/design/query/grids.d.ts +287 -0
  73. package/dist/api/design/query/grids.d.ts.map +1 -0
  74. package/dist/api/design/query/index.d.ts +143 -36
  75. package/dist/api/design/query/index.d.ts.map +1 -1
  76. package/dist/api/design/query/spaces.d.ts +5 -66
  77. package/dist/api/design/query/spaces.d.ts.map +1 -1
  78. package/dist/api/design/selection/index.d.ts +12 -12
  79. package/dist/api/design/types/index.d.ts +40 -24
  80. package/dist/api/design/types/index.d.ts.map +1 -1
  81. package/dist/api/design/update/index.d.ts +412 -8
  82. package/dist/api/design/update/index.d.ts.map +1 -1
  83. package/dist/api/design/windows/index.d.ts +8 -8
  84. package/dist/api/design/windows/index.d.ts.map +1 -1
  85. package/dist/api/entity/buildableEnvelope.d.ts +84 -2
  86. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
  87. package/dist/api/entity/referenceLine.d.ts +13 -1
  88. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  89. package/dist/api/entity/space.d.ts +12 -15
  90. package/dist/api/entity/space.d.ts.map +1 -1
  91. package/dist/api/entity/story.d.ts +4 -4
  92. package/dist/api/presentation/aiInspiration.d.ts +24 -24
  93. package/dist/api/presentation/annotate.d.ts +38 -22
  94. package/dist/api/presentation/annotate.d.ts.map +1 -1
  95. package/dist/api/presentation/camera.d.ts +265 -0
  96. package/dist/api/presentation/camera.d.ts.map +1 -0
  97. package/dist/api/presentation/drawingContract.d.ts +32 -0
  98. package/dist/api/presentation/drawingContract.d.ts.map +1 -0
  99. package/dist/api/presentation/drawings.d.ts +3523 -0
  100. package/dist/api/presentation/drawings.d.ts.map +1 -0
  101. package/dist/api/presentation/export.d.ts +23 -5
  102. package/dist/api/presentation/export.d.ts.map +1 -1
  103. package/dist/api/presentation/graphics.d.ts +419 -0
  104. package/dist/api/presentation/graphics.d.ts.map +1 -0
  105. package/dist/api/presentation/index.d.ts +66 -12
  106. package/dist/api/presentation/index.d.ts.map +1 -1
  107. package/dist/api/presentation/placedViews.d.ts +117 -51
  108. package/dist/api/presentation/placedViews.d.ts.map +1 -1
  109. package/dist/api/presentation/sections.d.ts +461 -0
  110. package/dist/api/presentation/sections.d.ts.map +1 -0
  111. package/dist/api/presentation/shapes.d.ts +2 -2
  112. package/dist/api/presentation/sheets.d.ts +175 -37
  113. package/dist/api/presentation/sheets.d.ts.map +1 -1
  114. package/dist/api/presentation/standards.d.ts +590 -0
  115. package/dist/api/presentation/standards.d.ts.map +1 -0
  116. package/dist/api/presentation/viewPresets.d.ts +222 -0
  117. package/dist/api/presentation/viewPresets.d.ts.map +1 -0
  118. package/dist/api/presentation/views.d.ts +144 -9
  119. package/dist/api/presentation/views.d.ts.map +1 -1
  120. package/dist/api/presentation/walkthroughs.d.ts +1350 -0
  121. package/dist/api/presentation/walkthroughs.d.ts.map +1 -0
  122. package/dist/api/program/departments.d.ts +58 -2
  123. package/dist/api/program/departments.d.ts.map +1 -1
  124. package/dist/api/program/index.d.ts +16 -6
  125. package/dist/api/program/index.d.ts.map +1 -1
  126. package/dist/api/program/labels.d.ts +355 -0
  127. package/dist/api/program/labels.d.ts.map +1 -0
  128. package/dist/api/program/metadata.d.ts +328 -0
  129. package/dist/api/program/metadata.d.ts.map +1 -0
  130. package/dist/api/program/site.d.ts +4 -4
  131. package/dist/api/program/spreadsheet.d.ts +267 -4
  132. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  133. package/dist/api/workspace/index.d.ts +49 -2
  134. package/dist/api/workspace/index.d.ts.map +1 -1
  135. package/dist/errors/codes.d.ts +5 -8
  136. package/dist/errors/codes.d.ts.map +1 -1
  137. package/dist/handles.d.ts +32 -3
  138. package/dist/handles.d.ts.map +1 -1
  139. package/dist/index.cjs +6534 -2865
  140. package/dist/index.cjs.map +1 -1
  141. package/dist/index.d.ts +2 -0
  142. package/dist/index.d.ts.map +1 -1
  143. package/dist/index.js +6118 -2857
  144. package/dist/index.js.map +1 -1
  145. package/dist/massParameters.d.ts +287 -0
  146. package/dist/massParameters.d.ts.map +1 -0
  147. package/dist/massParameters.ops.d.ts +138 -0
  148. package/dist/massParameters.ops.d.ts.map +1 -0
  149. package/package.json +2 -1
  150. package/scripts/check-dist-fresh.mjs +22 -0
  151. package/scripts/generate-manifest.mjs +5 -0
  152. package/scripts/generate-manifest.test.mjs +14 -3
  153. package/src/api/core/camera/index.ts +429 -1
  154. package/src/api/core/geom/create/index.ts +1037 -102
  155. package/src/api/core/geom/query/brep.ts +60 -2
  156. package/src/api/core/geom/query/curve.ts +26 -2
  157. package/src/api/core/geom/query/edge.ts +2 -2
  158. package/src/api/core/geom/query/face.ts +109 -4
  159. package/src/api/core/geom/update/contour.ts +10 -2
  160. package/src/api/core/geom/update/profile.ts +2 -0
  161. package/src/api/core/handles/index.ts +3 -2
  162. package/src/api/core/index.ts +4 -4
  163. package/src/api/core/io/import/index.ts +11 -3
  164. package/src/api/core/layers.ts +380 -173
  165. package/src/api/core/mode/index.ts +19 -7
  166. package/src/api/core/proposals/index.ts +4 -3
  167. package/src/api/core/storeys/index.ts +19 -2
  168. package/src/api/core/storeys/layers.ts +339 -0
  169. package/src/api/core/tags.ts +76 -0
  170. package/src/api/core/zoom/index.ts +13 -0
  171. package/src/api/design/bim.ts +210 -0
  172. package/src/api/design/boolean/index.ts +2 -0
  173. package/src/api/design/catalog.ts +203 -0
  174. package/src/api/design/create/bulk-items.ts +294 -0
  175. package/src/api/design/create/grids.ts +137 -0
  176. package/src/api/design/create/index.ts +824 -141
  177. package/src/api/design/create/opening-fields.ts +40 -0
  178. package/src/api/design/delete/index.ts +6 -20
  179. package/src/api/design/dimensions.ts +453 -0
  180. package/src/api/design/doors/index.ts +64 -41
  181. package/src/api/design/family.ts +1342 -0
  182. package/src/api/design/grids.ts +237 -0
  183. package/src/api/design/index.ts +49 -4
  184. package/src/api/design/networks.ts +607 -0
  185. package/src/api/design/query/geometry/index.ts +35 -4
  186. package/src/api/design/query/grids.ts +197 -0
  187. package/src/api/design/query/index.ts +105 -5
  188. package/src/api/design/query/spaces.ts +0 -68
  189. package/src/api/design/types/index.ts +31 -24
  190. package/src/api/design/update/index.ts +398 -4
  191. package/src/api/design/windows/index.ts +40 -22
  192. package/src/api/entity/buildableEnvelope.ts +77 -2
  193. package/src/api/entity/referenceLine.ts +25 -12
  194. package/src/api/entity/space.ts +0 -2
  195. package/src/api/presentation/annotate.ts +90 -58
  196. package/src/api/presentation/camera.ts +289 -0
  197. package/src/api/presentation/drawingContract.ts +70 -0
  198. package/src/api/presentation/drawings.ts +1179 -0
  199. package/src/api/presentation/export.ts +32 -6
  200. package/src/api/presentation/graphics.ts +324 -0
  201. package/src/api/presentation/index.ts +73 -14
  202. package/src/api/presentation/placedViews.ts +120 -57
  203. package/src/api/presentation/sections.ts +420 -0
  204. package/src/api/presentation/sheets.ts +182 -37
  205. package/src/api/presentation/standards.ts +445 -0
  206. package/src/api/presentation/viewPresets.ts +241 -0
  207. package/src/api/presentation/views.ts +81 -10
  208. package/src/api/presentation/walkthroughs.ts +1201 -0
  209. package/src/api/program/departments.ts +54 -2
  210. package/src/api/program/index.ts +16 -6
  211. package/src/api/program/labels.ts +332 -0
  212. package/src/api/program/metadata.ts +364 -0
  213. package/src/api/program/spreadsheet.ts +282 -0
  214. package/src/api/workspace/index.ts +51 -2
  215. package/src/errors/codes.ts +9 -30
  216. package/src/handles.ts +42 -3
  217. package/src/index.ts +2 -0
  218. package/src/massParameters.ops.ts +246 -0
  219. package/src/massParameters.ts +427 -0
  220. package/test/drawingContract.test.mjs +288 -0
  221. package/test/errors.test.mjs +1 -4
  222. package/test/massParameters.test.mjs +952 -0
  223. package/test/paperPensContract.test.mjs +75 -0
  224. package/test/presentationViewSettings.test.mjs +85 -0
  225. package/api-manifest.full.json +0 -6928
  226. package/snaptrude-plugin-core-0.11.0.tgz +0 -0
@@ -0,0 +1,237 @@
1
+ import * as z from "zod"
2
+ import { PluginApiReturn } from "../../types"
3
+ import { ComponentHandle } from "../../handles"
4
+ import { PluginGridStyleOptions } from "./create/grids"
5
+
6
+ /**
7
+ * Tag policy for structural line removal (mirrors the engine
8
+ * `GridLineTagPolicy` values verbatim): `"rewrite"` renumbers each affected
9
+ * wing's tag sequence after removal; `"preserve"` keeps the surviving lines'
10
+ * tags unchanged.
11
+ */
12
+ export const PluginGridLineTagPolicy = z.enum(["rewrite", "preserve"])
13
+ export type PluginGridLineTagPolicy = z.infer<typeof PluginGridLineTagPolicy>
14
+
15
+ /** A positional grid-line address — indices into `design.query.grids.get`'s `wings` arrays. */
16
+ export const PluginGridLineAddress = z.object({
17
+ wing: z.number().int().nonnegative(),
18
+ line: z.number().int().nonnegative(),
19
+ })
20
+ export type PluginGridLineAddress = z.infer<typeof PluginGridLineAddress>
21
+
22
+ /**
23
+ * One per-wing entry of {@linkcode PluginDesignGridsApi.updateWings} —
24
+ * addressed by wing index. `spanMin`/`spanMax` move the family's length
25
+ * handles (Snaptrude units).
26
+ */
27
+ export const PluginGridWingEntry = z.object({
28
+ wing: z.number().int().nonnegative(),
29
+ spacing: z.number().positive().finite().optional(),
30
+ count: z.number().int().min(1).optional(),
31
+ spanMin: z.number().finite().optional(),
32
+ spanMax: z.number().finite().optional(),
33
+ })
34
+ export type PluginGridWingEntry = z.infer<typeof PluginGridWingEntry>
35
+
36
+ /** Arguments for {@linkcode PluginDesignGridsApi.updateWings}. */
37
+ export const PluginDesignGridsUpdateWingsArgs = z.object({
38
+ grid: ComponentHandle,
39
+ wings: z.array(PluginGridWingEntry).min(1),
40
+ })
41
+ export type PluginDesignGridsUpdateWingsArgs = z.infer<
42
+ typeof PluginDesignGridsUpdateWingsArgs
43
+ >
44
+
45
+ /**
46
+ * One per-line entry of {@linkcode PluginDesignGridsApi.updateLines} —
47
+ * addressed positionally by `{ wing, line }` indices (invalidated by
48
+ * structural edits; re-query after mutating). `distanceToPrevious` /
49
+ * `distanceToNext` set the typed distance to the adjacent line on that side
50
+ * and are mutually exclusive.
51
+ *
52
+ * `visible` is **hide-only** (`false`), mirroring the product: per-line show
53
+ * does not exist — showing the GROUP (`design.visibility.show`) restores all
54
+ * of its lines, exactly like the native Show All.
55
+ */
56
+ export const PluginGridLineEntry = z
57
+ .object({
58
+ wing: z.number().int().nonnegative(),
59
+ line: z.number().int().nonnegative(),
60
+ tag: z.string().min(1).optional(),
61
+ distanceToPrevious: z.number().positive().finite().optional(),
62
+ distanceToNext: z.number().positive().finite().optional(),
63
+ props: PluginGridStyleOptions.optional(),
64
+ visible: z.literal(false).optional(),
65
+ })
66
+ .superRefine((entry, ctx) => {
67
+ if (entry.distanceToPrevious !== undefined && entry.distanceToNext !== undefined) {
68
+ ctx.addIssue({
69
+ code: z.ZodIssueCode.custom,
70
+ message:
71
+ "distanceToPrevious and distanceToNext are mutually exclusive on one line entry",
72
+ })
73
+ }
74
+ })
75
+ export type PluginGridLineEntry = z.infer<typeof PluginGridLineEntry>
76
+
77
+ /** Arguments for {@linkcode PluginDesignGridsApi.updateLines}. */
78
+ export const PluginDesignGridsUpdateLinesArgs = z.object({
79
+ grid: ComponentHandle,
80
+ lines: z.array(PluginGridLineEntry).min(1),
81
+ })
82
+ export type PluginDesignGridsUpdateLinesArgs = z.infer<
83
+ typeof PluginDesignGridsUpdateLinesArgs
84
+ >
85
+
86
+ /** Arguments for {@linkcode PluginDesignGridsApi.addLine}. */
87
+ export const PluginDesignGridsAddLineArgs = z.object({
88
+ grid: ComponentHandle,
89
+ wing: z.number().int().nonnegative(),
90
+ position: z.number().finite(),
91
+ })
92
+ export type PluginDesignGridsAddLineArgs = z.infer<typeof PluginDesignGridsAddLineArgs>
93
+
94
+ /** Arguments for {@linkcode PluginDesignGridsApi.removeLines}. */
95
+ export const PluginDesignGridsRemoveLinesArgs = z.object({
96
+ grid: ComponentHandle,
97
+ lines: z.array(PluginGridLineAddress).min(1),
98
+ tagPolicy: PluginGridLineTagPolicy.optional(),
99
+ })
100
+ export type PluginDesignGridsRemoveLinesArgs = z.infer<
101
+ typeof PluginDesignGridsRemoveLinesArgs
102
+ >
103
+
104
+ /**
105
+ * `design.grids.*` — structural edits on a grid's line structure (the
106
+ * entity-family home for grid-specific operations, like `design.doors`).
107
+ *
108
+ * Lines are addressed positionally as `{ wing, line }` index pairs into the
109
+ * `wings` arrays returned by `design.query.grids.get`. Adding, removing, or
110
+ * re-counting lines re-indexes the wing — re-query after every structural edit.
111
+ *
112
+ * Group-level edits (default styling, angle, storey visibility) live on
113
+ * `design.update.grid`; creation lives on `design.create.grid*`.
114
+ *
115
+ * Accessed via `snaptrude.design.grids`.
116
+ */
117
+ export abstract class PluginDesignGridsApi {
118
+ constructor() {}
119
+
120
+ /**
121
+ * Update one or more **wings** of a grid with sparse per-wing entries —
122
+ * `spacing` (uniform re-space), `count` (grow/truncate + tag renumber),
123
+ * `spanMin`/`spanMax` (family length handles). Every change routes through
124
+ * the exact setters the native panel uses — each changed field commits its
125
+ * own undoable command, identical to editing that field in the panel.
126
+ *
127
+ * A `count` change re-indexes the wing's lines — positional `{ wing, line }`
128
+ * addresses held from before the call are stale afterwards; re-query.
129
+ *
130
+ * @param grid - The grid group
131
+ * @param wings - Sparse {@linkcode PluginGridWingEntry} entries (≥ 1)
132
+ * @returns `true` once applied
133
+ *
134
+ * @examplePrompt Change this grid's spacing to 8 metres
135
+ * @examplePrompt Make this grid 10 by 12 lines
136
+ *
137
+ * # Example
138
+ * ```ts
139
+ * await snaptrude.design.grids.updateWings(grid, [{ wing: 0, spacing: 8, count: 10 }])
140
+ * ```
141
+ */
142
+ public abstract updateWings(
143
+ grid: ComponentHandle,
144
+ wings: PluginGridWingEntry[],
145
+ ): PluginApiReturn<boolean>
146
+
147
+ /**
148
+ * Update one or more **lines** of a grid with sparse per-line entries —
149
+ * `tag`, `distanceToPrevious`/`distanceToNext` (typed distance to the
150
+ * neighbour on that side; mutually exclusive), `props` (per-line style
151
+ * overrides), and `visible: false` (hide). Every change routes through the
152
+ * exact setters the native panel uses — each changed field commits its own
153
+ * undoable command, identical to editing that field in the panel.
154
+ *
155
+ * Visibility mirrors the product exactly: `visible` accepts only `false` —
156
+ * per-line show does not exist. Hiding lines that would leave NO visible
157
+ * line hides the whole GROUP instead (the native last-line rule; those line
158
+ * flags stay untouched). To bring hidden lines back, show the group
159
+ * (`design.visibility.show([grid])`) — it restores ALL of its lines, like
160
+ * the native Show All.
161
+ *
162
+ * @param grid - The grid group
163
+ * @param lines - Sparse {@linkcode PluginGridLineEntry} entries (≥ 1)
164
+ * @returns `true` once applied
165
+ *
166
+ * @examplePrompt Rename grid line 2 to "B"
167
+ * @examplePrompt Move this grid line 4 metres from its neighbour
168
+ * @examplePrompt Hide grid line 3 on this grid
169
+ *
170
+ * # Example
171
+ * ```ts
172
+ * await snaptrude.design.grids.updateLines(grid, [
173
+ * { wing: 0, line: 1, tag: "B", distanceToPrevious: 4 },
174
+ * ])
175
+ * ```
176
+ */
177
+ public abstract updateLines(
178
+ grid: ComponentHandle,
179
+ lines: PluginGridLineEntry[],
180
+ ): PluginApiReturn<boolean>
181
+
182
+ /**
183
+ * Insert a parallel grid line into a wing at an explicit position along the
184
+ * wing's spacing axis (Snaptrude units, wing-local — line 0's position can
185
+ * be read from its curve). Sibling lines do not shift; the wing's tag
186
+ * sequence is renumbered. Undoable.
187
+ *
188
+ * @param grid - The grid group
189
+ * @param wing - Wing index
190
+ * @param position - Position along the wing's spacing axis (Snaptrude units)
191
+ * @returns `true` once inserted
192
+ * @throws `VALIDATION` on a bad wing index or non-finite position
193
+ *
194
+ * @examplePrompt Add a grid line between lines 2 and 3
195
+ * @examplePrompt Insert an extra grid line 4 metres from line A
196
+ *
197
+ * # Example
198
+ * ```ts
199
+ * await snaptrude.design.grids.addLine(grid, 0, 12.5)
200
+ * ```
201
+ */
202
+ public abstract addLine(
203
+ grid: ComponentHandle,
204
+ wing: number,
205
+ position: number,
206
+ ): PluginApiReturn<boolean>
207
+
208
+ /**
209
+ * Remove grid lines by positional address, as ONE undoable step. With
210
+ * `tagPolicy: "rewrite"` (default) each affected wing renumbers its tag
211
+ * sequence; `"preserve"` keeps surviving tags unchanged. A wing emptied of
212
+ * lines is dropped from the group.
213
+ *
214
+ * Removing EVERY line of the group is rejected — delete the group instead
215
+ * (`design.delete.entities`).
216
+ *
217
+ * @param grid - The grid group
218
+ * @param lines - Positional addresses to remove (see `design.query.grids.get`)
219
+ * @param tagPolicy - `"rewrite"` (default) or `"preserve"`
220
+ * @returns `true` once removed
221
+ * @throws `VALIDATION` on out-of-range addresses; `OPERATION_FAILED` when the
222
+ * removal would delete the group's last line
223
+ *
224
+ * @examplePrompt Delete grid line B
225
+ * @examplePrompt Remove the last two lines of this grid without renumbering
226
+ *
227
+ * # Example
228
+ * ```ts
229
+ * await snaptrude.design.grids.removeLines(grid, [{ wing: 0, line: 2 }], "preserve")
230
+ * ```
231
+ */
232
+ public abstract removeLines(
233
+ grid: ComponentHandle,
234
+ lines: PluginGridLineAddress[],
235
+ tagPolicy?: PluginGridLineTagPolicy,
236
+ ): PluginApiReturn<boolean>
237
+ }
@@ -14,8 +14,18 @@ import { PluginDesignTransformApi } from "./transform"
14
14
  import { PluginDesignEditApi } from "./edit"
15
15
  import { PluginDesignUpdateApi } from "./update"
16
16
  import { PluginDesignVisibilityApi } from "./visibility"
17
+ import { PluginDesignDimensionsApi } from "./dimensions"
17
18
  import { PluginDesignTypesApi } from "./types"
19
+ import { PluginDesignFamilyApi } from "./family"
20
+ import { PluginDesignGridsApi } from "./grids"
21
+ import { PluginDesignCatalogApi } from "./catalog"
22
+ import { PluginDesignBimApi } from "./bim"
18
23
  import { PluginDesignChangeResult } from "./lock"
24
+ import {
25
+ PluginElectricalApi,
26
+ PluginPlumbingApi,
27
+ PluginMechanicalApi,
28
+ } from "./networks"
19
29
 
20
30
  /**
21
31
  * `snaptrude.design.*` — author, query & edit BIM geometry.
@@ -30,7 +40,9 @@ import { PluginDesignChangeResult } from "./lock"
30
40
  * - {@linkcode PluginDesignApi.erase} — plan-level adjacency-edge erase (NOT hard delete)
31
41
  * - {@linkcode PluginDesignApi.delete} — hard entity removal
32
42
  * - {@linkcode PluginDesignApi.visibility} — hide / isolate / reveal entities
43
+ * - {@linkcode PluginDesignApi.dimensions} — dimension lines (Measuring Tape): create / list / delete / hide
33
44
  * - {@linkcode PluginDesignApi.types} — read-only building type / assembly reference
45
+ * - {@linkcode PluginDesignApi.family} — author parametric families from a JSON spec
34
46
  * - {@linkcode PluginDesignApi.lock} / {@linkcode PluginDesignApi.unlock} / {@linkcode PluginDesignApi.isLocked} / {@linkcode PluginDesignApi.listLocked} — lock state (top-level design verbs, §2A.1)
35
47
  * - {@linkcode PluginDesignApi.lockArea} / {@linkcode PluginDesignApi.unlockArea} / {@linkcode PluginDesignApi.isAreaLocked} / {@linkcode PluginDesignApi.listAreaLocked} — footprint-area lock for Room/Department spaces
36
48
  *
@@ -65,8 +77,27 @@ export abstract class PluginDesignApi {
65
77
  public abstract update: PluginDesignUpdateApi
66
78
  /** Hide / isolate / reveal entities. See {@linkcode PluginDesignVisibilityApi}. */
67
79
  public abstract visibility: PluginDesignVisibilityApi
80
+ /** Dimension lines (Measuring Tape). See {@linkcode PluginDesignDimensionsApi}. */
81
+ public abstract dimensions: PluginDesignDimensionsApi
68
82
  /** Read-only building type / assembly reference. See {@linkcode PluginDesignTypesApi}. */
69
83
  public abstract types: PluginDesignTypesApi
84
+ /** Author parametric families from a JSON spec. See {@linkcode PluginDesignFamilyApi}. */
85
+ public abstract family: PluginDesignFamilyApi
86
+ /** Shared family and asset inventory, including supported placement and update paths. */
87
+ public abstract catalog: PluginDesignCatalogApi
88
+
89
+ /** Agent-driven Sketch-to-BIM with explicit per-edge constructions. */
90
+ public abstract bim: PluginDesignBimApi
91
+
92
+ /** Structural edits on a grid's line structure. See {@linkcode PluginDesignGridsApi}. */
93
+ public abstract grids: PluginDesignGridsApi
94
+
95
+ /** Persistent electrical equipment, routes and circuit graphs. */
96
+ public abstract electrical: PluginElectricalApi
97
+ /** Persistent plumbing equipment and directed pipe graphs. */
98
+ public abstract plumbing: PluginPlumbingApi
99
+ /** Persistent family-backed HVAC ducts, fittings and equipment. */
100
+ public abstract mechanical: PluginMechanicalApi
70
101
 
71
102
  /**
72
103
  * Lock entities so they cannot be edited. Undoable. Cascades to void/door/window
@@ -88,7 +119,9 @@ export abstract class PluginDesignApi {
88
119
  * // affected is post-cascade: hosted doors/windows are included
89
120
  * ```
90
121
  */
91
- public abstract lock(components: ComponentHandle[]): PluginApiReturn<PluginDesignChangeResult>
122
+ public abstract lock(
123
+ components: ComponentHandle[],
124
+ ): PluginApiReturn<PluginDesignChangeResult>
92
125
 
93
126
  /**
94
127
  * Unlock previously locked entities so they can be edited again. Undoable.
@@ -108,7 +141,9 @@ export abstract class PluginDesignApi {
108
141
  * const { affected } = await snaptrude.design.unlock(locked)
109
142
  * ```
110
143
  */
111
- public abstract unlock(components: ComponentHandle[]): PluginApiReturn<PluginDesignChangeResult>
144
+ public abstract unlock(
145
+ components: ComponentHandle[],
146
+ ): PluginApiReturn<PluginDesignChangeResult>
112
147
 
113
148
  /**
114
149
  * Test whether an entity is locked (folds group + bucket lock unless `includeInherited: false`).
@@ -176,7 +211,9 @@ export abstract class PluginDesignApi {
176
211
  * console.log("area-locked", affected.length, "spaces")
177
212
  * ```
178
213
  */
179
- public abstract lockArea(spaces: ComponentHandle[]): PluginApiReturn<PluginDesignChangeResult>
214
+ public abstract lockArea(
215
+ spaces: ComponentHandle[],
216
+ ): PluginApiReturn<PluginDesignChangeResult>
180
217
 
181
218
  /**
182
219
  * Unlock the footprint area of previously area-locked spaces so their area can
@@ -197,7 +234,9 @@ export abstract class PluginDesignApi {
197
234
  * const { affected } = await snaptrude.design.unlockArea(locked)
198
235
  * ```
199
236
  */
200
- public abstract unlockArea(spaces: ComponentHandle[]): PluginApiReturn<PluginDesignChangeResult>
237
+ public abstract unlockArea(
238
+ spaces: ComponentHandle[],
239
+ ): PluginApiReturn<PluginDesignChangeResult>
201
240
 
202
241
  /**
203
242
  * Test whether a space's footprint area is locked. A read — never throws;
@@ -256,4 +295,10 @@ export * from "./transform"
256
295
  export * from "./edit"
257
296
  export * from "./update"
258
297
  export * from "./visibility"
298
+ export * from "./dimensions"
259
299
  export * from "./types"
300
+ export * from "./family"
301
+ export * from "./grids"
302
+ export * from "./networks"
303
+ export * from "./catalog"
304
+ export * from "./bim"