@snaptrude/plugin-core 0.9.6 → 0.9.8

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 (37) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/api-manifest.full.json +8443 -0
  3. package/api-manifest.json +167 -10
  4. package/dist/api/core/io/import/index.d.ts +3 -1
  5. package/dist/api/core/io/import/index.d.ts.map +1 -1
  6. package/dist/api/design/create/bulk-items.d.ts +185 -0
  7. package/dist/api/design/create/bulk-items.d.ts.map +1 -0
  8. package/dist/api/design/create/index.d.ts +310 -22
  9. package/dist/api/design/create/index.d.ts.map +1 -1
  10. package/dist/api/design/create/opening-fields.d.ts +37 -0
  11. package/dist/api/design/create/opening-fields.d.ts.map +1 -0
  12. package/dist/api/design/delete/index.d.ts +4 -0
  13. package/dist/api/design/delete/index.d.ts.map +1 -1
  14. package/dist/api/design/dimensions.d.ts +427 -0
  15. package/dist/api/design/dimensions.d.ts.map +1 -0
  16. package/dist/api/design/doors/index.d.ts +20 -13
  17. package/dist/api/design/doors/index.d.ts.map +1 -1
  18. package/dist/api/design/index.d.ts +5 -0
  19. package/dist/api/design/index.d.ts.map +1 -1
  20. package/dist/api/presentation/annotate.d.ts +2 -2
  21. package/dist/api/presentation/shapes.d.ts +2 -2
  22. package/dist/handles.d.ts +19 -0
  23. package/dist/handles.d.ts.map +1 -1
  24. package/dist/index.cjs +2011 -1869
  25. package/dist/index.cjs.map +1 -1
  26. package/dist/index.js +1988 -1869
  27. package/dist/index.js.map +1 -1
  28. package/package.json +1 -1
  29. package/src/api/core/io/import/index.ts +11 -3
  30. package/src/api/design/create/bulk-items.ts +186 -0
  31. package/src/api/design/create/index.ts +335 -38
  32. package/src/api/design/create/opening-fields.ts +37 -0
  33. package/src/api/design/delete/index.ts +4 -0
  34. package/src/api/design/dimensions.ts +453 -0
  35. package/src/api/design/doors/index.ts +20 -13
  36. package/src/api/design/index.ts +5 -0
  37. package/src/handles.ts +24 -0
@@ -0,0 +1,427 @@
1
+ import * as z from "zod";
2
+ import { PluginApiReturn } from "../../types";
3
+ import { ComponentHandle, DimensionHandle, Vec3Handle } from "../../handles";
4
+ /**
5
+ * Dimension lines (Measuring Tape) — the measurement annotations the Measuring
6
+ * Tape tool leaves in the 3D scene, NOT an entity's width/height/depth
7
+ * properties (for those see `design.windows.getDimensions`,
8
+ * `design.create.staircase`'s `dimensions`, or `design.query.measure`).
9
+ *
10
+ * A dimension line is a scene object: two endpoints anchored to the geometry
11
+ * they were measured on, an offset that pushes the drawn line clear of the
12
+ * span, and a label showing the distance in the project's units. Because the
13
+ * endpoints are anchored, the line follows its host when the host is moved,
14
+ * edited, or resized, and it is removed with the host when the host is deleted.
15
+ * Dimension lines are storey-scoped, render in both plan and 3D, and are drawn
16
+ * into Present-mode sheets (style them with
17
+ * `presentation.placedViews.updateStyles(shapeId, "Dimension", …)`).
18
+ *
19
+ * **Units.** Every length here — `offset` and the record's `length` — is in
20
+ * **Babylon units** (BU), the engine's storage unit: 1 BU = 10 in = 0.254 m.
21
+ * Convert with `core.units.convert(value, from, await core.units.getBabylonType())`.
22
+ *
23
+ * **Offset convention.** `options.offset` is a **signed** distance in BU:
24
+ * positive pushes the drawn line to the **left** of the `from` → `to`
25
+ * direction in plan (`cross(up, direction)`), negative to the right. It
26
+ * defaults to `3.937` BU (1 m). The placement mode is always `"across"` (the
27
+ * tape tool's perpendicular mode), which re-perpendicularises when the host
28
+ * geometry is edited.
29
+ *
30
+ * Every mutator here (`create`, `delete`, `hide`, `show`) commits through the
31
+ * engine's command manager, so each call is a single undo entry, is autosaved,
32
+ * and replays to collaborators.
33
+ *
34
+ * Accessed via `snaptrude.design.dimensions`.
35
+ */
36
+ export declare abstract class PluginDesignDimensionsApi {
37
+ constructor();
38
+ /**
39
+ * Draw one dimension line between two world points, anchored to a component.
40
+ *
41
+ * `anchor` is **required**: the endpoints are stored relative to the anchor's
42
+ * mesh, and only component-anchored dimension lines survive a reload. A
43
+ * free-point dimension anchors to a scene helper mesh whose id is not stable
44
+ * across reloads, so it is dropped or corrupted when the project is reopened
45
+ * — the host therefore rejects a non-component anchor rather than writing a
46
+ * record that silently disappears. Pass `options.anchorTo` to anchor the
47
+ * second endpoint to a different component (it defaults to `anchor`).
48
+ *
49
+ * The dimension is created flat (never plan-projected) so the same call
50
+ * produces the same record whatever the current camera; it still draws in
51
+ * plan.
52
+ *
53
+ * @param from - World-space first endpoint.
54
+ * @param to - World-space second endpoint.
55
+ * @param anchor - The component the first endpoint is anchored to (required).
56
+ * @param options - `anchorTo` (component for the second endpoint; defaults to
57
+ * `anchor`), `offset` (signed perpendicular offset in Babylon units,
58
+ * positive = left of the `from` → `to` direction in plan; default `3.937`
59
+ * BU = 1 m).
60
+ * @returns The new dimension line's {@linkcode DimensionHandle}.
61
+ * @throws `VALIDATION` for malformed arguments or a degenerate span (`from`
62
+ * and `to` closer than the engine's minimum); `HANDLE_INVALID` for an
63
+ * unknown `anchor` / `anchorTo`; `PRECONDITION_FAILED` when the anchor is
64
+ * outside the active proposal or the editor is not mounted;
65
+ * `METHOD_NOT_PERMITTED` when plugin writes are disabled.
66
+ *
67
+ * @examplePrompt Dimension every wall on level 2
68
+ * @examplePrompt Add a dimension line along this wall
69
+ * @examplePrompt Measure the width of this room and label it on the plan
70
+ *
71
+ * # Example
72
+ * ```ts
73
+ * const { design, core } = snaptrude
74
+ * const v = core.math.vec3
75
+ * const curve = core.geom.query.curve
76
+ * for (const wall of await design.query.listWalls({ storeys: [2] })) {
77
+ * const cl = await design.query.geometry.getCenterline(wall)
78
+ * if (!cl) continue
79
+ * const a = await curve.getStartPoint(cl)
80
+ * const b = await curve.getEndPoint(cl)
81
+ * await design.dimensions.create(
82
+ * await v.new(a.x, a.y, a.z),
83
+ * await v.new(b.x, b.y, b.z),
84
+ * wall,
85
+ * )
86
+ * }
87
+ * ```
88
+ */
89
+ abstract create(from: Vec3Handle, to: Vec3Handle, anchor: ComponentHandle, options?: {
90
+ anchorTo?: ComponentHandle;
91
+ offset?: number;
92
+ }): PluginApiReturn<DimensionHandle>;
93
+ /**
94
+ * List the dimension lines in the project as full records.
95
+ *
96
+ * Filters combine with AND. `storeys` keeps only the dimensions on those
97
+ * storey numbers, `anchors` only the ones anchored to those components
98
+ * (matching either endpoint, and matching an instanced anchor's source mesh
99
+ * too), `isHidden` only the ones whose user Hide flag equals the value given.
100
+ *
101
+ * Dimension lines drawn by the Measuring Tape onto a scene helper mesh rather
102
+ * than a component come back with `anchor: null` and are not proposal-scoped.
103
+ *
104
+ * @param options - `storeys`, `anchors`, `isHidden` filters (all optional,
105
+ * ANDed).
106
+ * @returns The matching {@linkcode PluginDimensionLine} records (`[]` when
107
+ * nothing matches).
108
+ * @throws `VALIDATION` for malformed filters; `HANDLE_INVALID` for an unknown
109
+ * handle in `anchors`.
110
+ *
111
+ * @examplePrompt List all the dimension lines in this model
112
+ * @examplePrompt Which dimensions are on level 3?
113
+ * @examplePrompt Flag any dimension line shorter than 600 mm
114
+ *
115
+ * @performance Array read — one host round-trip returns every record. Filter
116
+ * in one call rather than calling `get` per dimension.
117
+ *
118
+ * # Example
119
+ * ```ts
120
+ * const units = snaptrude.core.units
121
+ * const min = await units.convert(600, "millimeters", await units.getBabylonType())
122
+ * const short = (await snaptrude.design.dimensions.list()).filter(
123
+ * (d) => d.length < min,
124
+ * )
125
+ * console.log(short.map((d) => `${d.label} on storey ${d.storey}`))
126
+ * ```
127
+ */
128
+ abstract list(options?: {
129
+ storeys?: number[];
130
+ anchors?: ComponentHandle[];
131
+ isHidden?: boolean;
132
+ }): PluginApiReturn<PluginDimensionLine[]>;
133
+ /**
134
+ * Read one dimension line by handle.
135
+ *
136
+ * Returns `null` — rather than throwing — when the dimension no longer
137
+ * exists, so a handle kept across a delete or an undo can be polled safely.
138
+ *
139
+ * @param dimension - The dimension line to read.
140
+ * @returns Its {@linkcode PluginDimensionLine} record, or `null` if it is
141
+ * gone.
142
+ * @throws `VALIDATION` if `dimension` is not a non-empty id string.
143
+ *
144
+ * @examplePrompt Read the dimension line I just created
145
+ * @examplePrompt How long is this dimension and what does its label say?
146
+ * @examplePrompt Check whether that dimension line still exists
147
+ *
148
+ * # Example
149
+ * ```ts
150
+ * const dim = await snaptrude.design.dimensions.get(handle)
151
+ * if (dim) console.log(dim.label, dim.length, dim.storey)
152
+ * ```
153
+ */
154
+ abstract get(dimension: DimensionHandle): PluginApiReturn<PluginDimensionLine | null>;
155
+ /**
156
+ * Delete dimension lines — the same hard removal as selecting them and
157
+ * pressing Delete. Undoable as a **single** entry for the whole batch.
158
+ *
159
+ * Deleted handles are stale afterwards: {@linkcode
160
+ * PluginDesignDimensionsApi.get} returns `null` for them and the other
161
+ * mutators throw `HANDLE_INVALID`.
162
+ *
163
+ * @param dimensions - The dimension lines to delete (at least one — an empty
164
+ * array is a caller error, not a no-op).
165
+ * @returns The dimensions that were deleted, as
166
+ * {@linkcode PluginDimensionsChangeResult}.
167
+ * @throws `VALIDATION` for an empty or malformed array; `HANDLE_INVALID` if
168
+ * any handle is unknown (the whole call rejects before anything is
169
+ * deleted); `PRECONDITION_FAILED` if any dimension's anchor is outside the
170
+ * active proposal; `METHOD_NOT_PERMITTED` when plugin writes are disabled.
171
+ *
172
+ * @examplePrompt Remove all dimension lines
173
+ * @examplePrompt Delete the dimensions on this wall
174
+ * @examplePrompt Clear the measurements I added to level 2
175
+ *
176
+ * @performance Array API — pass the whole set in one call (one host
177
+ * round-trip, one undo entry). Never loop this per dimension.
178
+ *
179
+ * # Example
180
+ * ```ts
181
+ * const dims = snaptrude.design.dimensions
182
+ * const onWall = await dims.list({ anchors: [wall] })
183
+ * if (onWall.length > 0) await dims.delete(onWall.map((d) => d.id))
184
+ * ```
185
+ */
186
+ abstract delete(dimensions: DimensionHandle[]): PluginApiReturn<PluginDimensionsChangeResult>;
187
+ /**
188
+ * Hide dimension lines from the viewport — the same as the right-click "Hide"
189
+ * action (it sets the user Hide flag, `isHidden`). Undoable. Already-hidden
190
+ * dimensions are skipped and are not reported in `affected`.
191
+ *
192
+ * @param dimensions - The dimension lines to hide.
193
+ * @returns The dimensions actually hidden, as
194
+ * {@linkcode PluginDimensionsChangeResult} — already-hidden inputs are
195
+ * omitted, so `affected` can be shorter than the input.
196
+ * @throws `VALIDATION` for a malformed array; `HANDLE_INVALID` if any handle
197
+ * is unknown; `PRECONDITION_FAILED` if any dimension's anchor is outside
198
+ * the active proposal; `METHOD_NOT_PERMITTED` when plugin writes are
199
+ * disabled.
200
+ *
201
+ * @examplePrompt Hide the dimensions on this storey
202
+ * @examplePrompt Hide every dimension line while I present
203
+ * @examplePrompt Temporarily hide the measurements on level 3
204
+ *
205
+ * @performance Array API — one host round-trip and one undo entry for the
206
+ * whole set.
207
+ *
208
+ * # Example
209
+ * ```ts
210
+ * const dims = snaptrude.design.dimensions
211
+ * const onLevel3 = await dims.list({ storeys: [3] })
212
+ * const { affected } = await dims.hide(onLevel3.map((d) => d.id))
213
+ * ```
214
+ */
215
+ abstract hide(dimensions: DimensionHandle[]): PluginApiReturn<PluginDimensionsChangeResult>;
216
+ /**
217
+ * Reveal hidden dimension lines — clear the user Hide flag, the inverse of
218
+ * {@linkcode PluginDesignDimensionsApi.hide}. Undoable. Already-visible
219
+ * dimensions are skipped and are not reported in `affected`.
220
+ *
221
+ * Clearing the flag does not guarantee the dimension is on screen: a
222
+ * dimension whose anchor component is itself hidden stays off screen with
223
+ * `isHidden: false` and `isVisible: false`.
224
+ *
225
+ * @param dimensions - The dimension lines to reveal.
226
+ * @returns The dimensions actually revealed, as
227
+ * {@linkcode PluginDimensionsChangeResult} — already-visible inputs are
228
+ * omitted, so `affected` can be shorter than the input.
229
+ * @throws `VALIDATION` for a malformed array; `HANDLE_INVALID` if any handle
230
+ * is unknown; `PRECONDITION_FAILED` if any dimension's anchor is outside
231
+ * the active proposal; `METHOD_NOT_PERMITTED` when plugin writes are
232
+ * disabled.
233
+ *
234
+ * @examplePrompt Show the dimension lines again
235
+ * @examplePrompt Unhide all the hidden dimensions
236
+ * @examplePrompt Bring back the measurements I hid on this storey
237
+ *
238
+ * @performance Array API — one host round-trip and one undo entry for the
239
+ * whole set.
240
+ *
241
+ * # Example
242
+ * ```ts
243
+ * const dims = snaptrude.design.dimensions
244
+ * const hidden = await dims.list({ isHidden: true })
245
+ * await dims.show(hidden.map((d) => d.id))
246
+ * ```
247
+ */
248
+ abstract show(dimensions: DimensionHandle[]): PluginApiReturn<PluginDimensionsChangeResult>;
249
+ }
250
+ /**
251
+ * How a dimension line's drawn offset is constrained.
252
+ *
253
+ * - `"across"` — perpendicular to the span (the tape tool's default, and what
254
+ * every plugin-created dimension uses); re-perpendicularises when the host
255
+ * geometry is edited.
256
+ * - `"x"` / `"y"` / `"z"` — the offset is locked to that world axis.
257
+ * - `"none"` — no placement mode recorded (a plain world-space offset).
258
+ */
259
+ export declare const PluginDimensionPlacement: z.ZodEnum<{
260
+ x: "x";
261
+ y: "y";
262
+ z: "z";
263
+ across: "across";
264
+ none: "none";
265
+ }>;
266
+ export type PluginDimensionPlacement = z.infer<typeof PluginDimensionPlacement>;
267
+ /**
268
+ * One dimension line (Measuring Tape annotation). Lengths are in **Babylon
269
+ * units** (1 BU = 0.254 m — convert with `core.units.convert`).
270
+ *
271
+ * | Property | Type | Description |
272
+ * |---|---|---|
273
+ * | `id` | {@linkcode DimensionHandle} | The dimension line's handle |
274
+ * | `from` | {@linkcode Vec3Components} | Live world position of the first endpoint |
275
+ * | `to` | {@linkcode Vec3Components} | Live world position of the second endpoint |
276
+ * | `length` | `number` | Straight-line distance between `from` and `to`, in Babylon units |
277
+ * | `label` | `string` | The text drawn on the canvas, in the project's units (a bare number for metric/inch projects, `27' 7"` style for feet-inches). For a span whose x, y and z all differ the drawn line is the plan projection, so `label` reads the horizontal distance while `length` is the true 3D one |
278
+ * | `offset` | {@linkcode Vec3Components} | World vector from the measured span to the drawn line |
279
+ * | `placement` | {@linkcode PluginDimensionPlacement} | How that offset is constrained |
280
+ * | `anchor` | {@linkcode ComponentHandle}` \| null` | Component the first endpoint is anchored to; `null` for a free point or a non-component host mesh |
281
+ * | `anchorTo` | {@linkcode ComponentHandle}` \| null` | Component the second endpoint is anchored to; equals `anchor` when both endpoints share a host |
282
+ * | `storey` | `number` | Storey the dimension belongs to |
283
+ * | `buildingId` | `string \| null` | Building it belongs to, when it has one |
284
+ * | `isHidden` | `boolean` | The user Hide flag (what `hide` / `show` toggle) |
285
+ * | `isVisible` | `boolean` | Whether it is actually drawn — `false` when hidden, and also when an anchor component is hidden |
286
+ * | `isPlanProjected` | `boolean` | Whether it is drawn flattened onto the storey base (Measuring Tape dimensions drawn in 2D are; plugin-created ones never are) |
287
+ */
288
+ export declare const PluginDimensionLine: z.ZodObject<{
289
+ id: z.ZodPipe<z.ZodString, z.ZodTransform<DimensionHandle, string>>;
290
+ from: z.ZodObject<{
291
+ x: z.ZodNumber;
292
+ y: z.ZodNumber;
293
+ z: z.ZodNumber;
294
+ }, z.core.$strip>;
295
+ to: z.ZodObject<{
296
+ x: z.ZodNumber;
297
+ y: z.ZodNumber;
298
+ z: z.ZodNumber;
299
+ }, z.core.$strip>;
300
+ length: z.ZodNumber;
301
+ label: z.ZodString;
302
+ offset: z.ZodObject<{
303
+ x: z.ZodNumber;
304
+ y: z.ZodNumber;
305
+ z: z.ZodNumber;
306
+ }, z.core.$strip>;
307
+ placement: z.ZodEnum<{
308
+ x: "x";
309
+ y: "y";
310
+ z: "z";
311
+ across: "across";
312
+ none: "none";
313
+ }>;
314
+ anchor: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
315
+ anchorTo: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
316
+ storey: z.ZodNumber;
317
+ buildingId: z.ZodNullable<z.ZodString>;
318
+ isHidden: z.ZodBoolean;
319
+ isVisible: z.ZodBoolean;
320
+ isPlanProjected: z.ZodBoolean;
321
+ }, z.core.$strip>;
322
+ export type PluginDimensionLine = z.infer<typeof PluginDimensionLine>;
323
+ /**
324
+ * Result of every `design.dimensions` mutation that takes a batch
325
+ * ({@linkcode PluginDesignDimensionsApi.delete} /
326
+ * {@linkcode PluginDesignDimensionsApi.hide} /
327
+ * {@linkcode PluginDesignDimensionsApi.show}) — the dimensions actually
328
+ * affected. `hide` / `show` skip dimensions already in the target state, so
329
+ * `affected` can be shorter than the input; `delete` echoes the whole batch.
330
+ * Failures throw (the RPC rejects); there is no `Result<>` monad in the SDK.
331
+ *
332
+ * | Property | Type | Description |
333
+ * |---|---|---|
334
+ * | `affected` | {@linkcode DimensionHandle}`[]` | The dimension lines the call changed |
335
+ */
336
+ export declare const PluginDimensionsChangeResult: z.ZodObject<{
337
+ affected: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<DimensionHandle, string>>>;
338
+ }, z.core.$strip>;
339
+ export type PluginDimensionsChangeResult = z.infer<typeof PluginDimensionsChangeResult>;
340
+ /**
341
+ * Arguments for {@linkcode PluginDesignDimensionsApi.create} (options
342
+ * flattened).
343
+ *
344
+ * | Property | Type | Description |
345
+ * |---|---|---|
346
+ * | `from` | {@linkcode Vec3Handle} | World-space first endpoint |
347
+ * | `to` | {@linkcode Vec3Handle} | World-space second endpoint |
348
+ * | `anchor` | {@linkcode ComponentHandle} | Component the first endpoint anchors to (required — free-point dimensions do not survive a reload) |
349
+ * | `anchorTo` | {@linkcode ComponentHandle}? | Component for the second endpoint (default: `anchor`) |
350
+ * | `offset` | `number`? | Signed perpendicular offset in Babylon units, positive = left of the `from` → `to` direction in plan (default `3.937` BU = 1 m) |
351
+ *
352
+ * TRANSPORT: positional args — validated host-side as this object.
353
+ */
354
+ export declare const PluginDesignDimensionsCreateArgs: z.ZodObject<{
355
+ from: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../..").Handle<"vec3">, string>>;
356
+ to: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<import("../..").Handle<"vec3">, string>>;
357
+ anchor: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
358
+ anchorTo: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
359
+ offset: z.ZodOptional<z.ZodNumber>;
360
+ }, z.core.$strip>;
361
+ export type PluginDesignDimensionsCreateArgs = z.infer<typeof PluginDesignDimensionsCreateArgs>;
362
+ /**
363
+ * Arguments for {@linkcode PluginDesignDimensionsApi.list} (options flattened).
364
+ * Filters combine with AND; omitting all of them lists every dimension line.
365
+ *
366
+ * | Property | Type | Description |
367
+ * |---|---|---|
368
+ * | `storeys` | `number[]`? | Only dimensions on these storey numbers |
369
+ * | `anchors` | {@linkcode ComponentHandle}`[]`? | Only dimensions anchored to these components (either endpoint) |
370
+ * | `isHidden` | `boolean`? | user-hidden flag === |
371
+ */
372
+ export declare const PluginDesignDimensionsListArgs: z.ZodObject<{
373
+ storeys: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
374
+ anchors: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>>;
375
+ isHidden: z.ZodOptional<z.ZodBoolean>;
376
+ }, z.core.$strip>;
377
+ export type PluginDesignDimensionsListArgs = z.infer<typeof PluginDesignDimensionsListArgs>;
378
+ /**
379
+ * Arguments for {@linkcode PluginDesignDimensionsApi.get}.
380
+ *
381
+ * | Property | Type | Description |
382
+ * |---|---|---|
383
+ * | `dimension` | {@linkcode DimensionHandle} | The dimension line to read |
384
+ */
385
+ export declare const PluginDesignDimensionsGetArgs: z.ZodObject<{
386
+ dimension: z.ZodPipe<z.ZodString, z.ZodTransform<DimensionHandle, string>>;
387
+ }, z.core.$strip>;
388
+ export type PluginDesignDimensionsGetArgs = z.infer<typeof PluginDesignDimensionsGetArgs>;
389
+ /**
390
+ * Arguments for {@linkcode PluginDesignDimensionsApi.delete}.
391
+ *
392
+ * `.min(1)` mirrors {@linkcode PluginDesignDeleteEntitiesArgs}: an empty delete
393
+ * is a caller error, not a no-op.
394
+ *
395
+ * | Property | Type | Description |
396
+ * |---|---|---|
397
+ * | `dimensions` | {@linkcode DimensionHandle}`[]` | Dimension lines to delete. Unknown handles reject the whole call (fail-fast). |
398
+ */
399
+ export declare const PluginDesignDimensionsDeleteArgs: z.ZodObject<{
400
+ dimensions: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<DimensionHandle, string>>>;
401
+ }, z.core.$strip>;
402
+ export type PluginDesignDimensionsDeleteArgs = z.infer<typeof PluginDesignDimensionsDeleteArgs>;
403
+ /**
404
+ * Arguments for {@linkcode PluginDesignDimensionsApi.hide}. An empty array is
405
+ * allowed and is a no-op (mirroring {@linkcode PluginDesignVisibilityHideArgs}).
406
+ *
407
+ * | Property | Type | Description |
408
+ * |---|---|---|
409
+ * | `dimensions` | {@linkcode DimensionHandle}`[]` | Dimension lines to hide |
410
+ */
411
+ export declare const PluginDesignDimensionsHideArgs: z.ZodObject<{
412
+ dimensions: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<DimensionHandle, string>>>;
413
+ }, z.core.$strip>;
414
+ export type PluginDesignDimensionsHideArgs = z.infer<typeof PluginDesignDimensionsHideArgs>;
415
+ /**
416
+ * Arguments for {@linkcode PluginDesignDimensionsApi.show}. An empty array is
417
+ * allowed and is a no-op.
418
+ *
419
+ * | Property | Type | Description |
420
+ * |---|---|---|
421
+ * | `dimensions` | {@linkcode DimensionHandle}`[]` | Dimension lines to reveal |
422
+ */
423
+ export declare const PluginDesignDimensionsShowArgs: z.ZodObject<{
424
+ dimensions: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<DimensionHandle, string>>>;
425
+ }, z.core.$strip>;
426
+ export type PluginDesignDimensionsShowArgs = z.infer<typeof PluginDesignDimensionsShowArgs>;
427
+ //# sourceMappingURL=dimensions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dimensions.d.ts","sourceRoot":"","sources":["../../../src/api/design/dimensions.ts"],"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D,OAAO,8BAA8B,CACtC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,8BAA8B;;iBAEzC,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,8BAA8B,CACtC,CAAA"}
@@ -7,9 +7,11 @@ import { PluginDesignChangeResult } from "../lock";
7
7
  * `design.create.door`; generic reads (`listDoors`/`getHost`/`getProperties`) live at
8
8
  * `design.query.*`. Door targets are {@linkcode ComponentHandle}s.
9
9
  *
10
- * `getSwingDirection` is a DERIVED read (no persisted field) — computed from the door
11
- * mesh reflection state. `mirror` reflects the door across an axis (undoable, one
12
- * command); `setType` is intentionally absent (the engine has no in-place re-type
10
+ * `getSwingDirection` is a DERIVED read (no persisted field) — computed from the placed
11
+ * mesh's orientation: stand on the side the door swings open to, facing it; `'left'`
12
+ * when the hinged jamb is on your left. `mirror` reflects the door about one of its own
13
+ * axes (undoable, one command): `'x'` flips the swing side, `'z'` swaps the hinged jamb;
14
+ * `setType` is intentionally absent (the engine has no in-place re-type —
13
15
  * it would require delete+recreate).
14
16
  *
15
17
  * The **catalog** reads (`listCatalogGroups`/`listCatalog`/`getCatalogItem`/`exists`)
@@ -144,9 +146,11 @@ export declare abstract class PluginDesignDoorsApi {
144
146
  */
145
147
  abstract getSupportFloor(door: ComponentHandle): PluginApiReturn<ComponentHandle | null>;
146
148
  /**
147
- * Get a door's swing (hinge) handedness whether it opens as a left-hand or
148
- * right-hand door. Derived from the door mesh's reflection state, not a
149
- * persisted field.
149
+ * Get a door's swing (hinge) handedness. Stand on the side the door swings
150
+ * open to, facing the door: `'left'` when the hinged jamb is on your left,
151
+ * `'right'` when it is on your right. Derived from the placed mesh's
152
+ * orientation (the same reflection `mirror` and the `hinge` placement option
153
+ * apply), not a persisted field.
150
154
  *
151
155
  * @param door The door to query
152
156
  * @returns `'left'` / `'right'`, or `null` if indeterminate
@@ -165,11 +169,13 @@ export declare abstract class PluginDesignDoorsApi {
165
169
  */
166
170
  abstract getSwingDirection(door: ComponentHandle): PluginApiReturn<"left" | "right" | null>;
167
171
  /**
168
- * Mirror a door across an axis, flipping its swing so it opens from the
169
- * other side. Undoable as a single command.
172
+ * Mirror a door about its own axes. `'x'` (default) flips the swing side
173
+ * the door opens to the other side of the wall; `'z'` swaps the hinged jamb
174
+ * (left-hand ↔ right-hand, same swing side); `'y'` turns it upside down.
175
+ * Undoable as a single command.
170
176
  *
171
177
  * @param door The door to mirror
172
- * @param axis Reflection axis (optional; default `'x'` — the swing-flip axis)
178
+ * @param axis Reflection axis (optional; default `'x'` — the swing-flip axis; `'z'` — the hinge-jamb axis)
173
179
  * @returns The affected door(s)
174
180
  *
175
181
  * @examplePrompt Flip this door's swing
@@ -180,10 +186,11 @@ export declare abstract class PluginDesignDoorsApi {
180
186
  *
181
187
  * # Example
182
188
  * ```ts
183
- * // Flip the selected door's swing — axis defaults to "x" (the swing-flip
184
- * // axis); pass "y" or "z" to reflect across a different axis
189
+ * // Flip the selected door's swing side — axis defaults to "x"
185
190
  * const [door] = await snaptrude.design.query.listDoors({ isSelected: true })
186
191
  * const { affected } = await snaptrude.design.doors.mirror(door)
192
+ * // …or swap the hinged jamb instead (keeps the swing side)
193
+ * await snaptrude.design.doors.mirror(door, "z")
187
194
  * ```
188
195
  */
189
196
  abstract mirror(door: ComponentHandle, axis?: PluginMirrorAxis): PluginApiReturn<PluginDesignChangeResult>;
@@ -334,7 +341,7 @@ export declare const PluginDoorDimensions: z.ZodObject<{
334
341
  thickness: z.ZodNumber;
335
342
  }, z.core.$strip>;
336
343
  export type PluginDoorDimensions = z.infer<typeof PluginDoorDimensions>;
337
- /** Mirror axis — tokens mirror the engine `FlipDirection` verbatim (§6.1). */
344
+ /** Mirror axis — tokens mirror the engine `FlipDirection` verbatim: `'x'` flips the swing side, `'z'` swaps the hinged jamb, `'y'` turns the door upside down. */
338
345
  export declare const PluginMirrorAxis: z.ZodEnum<{
339
346
  x: "x";
340
347
  y: "y";
@@ -347,7 +354,7 @@ export type PluginMirrorAxis = z.infer<typeof PluginMirrorAxis>;
347
354
  * | Property | Type | Description |
348
355
  * |---|---|---|
349
356
  * | `door` | {@linkcode ComponentHandle} | The door to mirror |
350
- * | `axis` | {@linkcode PluginMirrorAxis} | Reflection axis (optional; default `'x'` — the swing-flip axis) |
357
+ * | `axis` | {@linkcode PluginMirrorAxis} | Reflection axis (optional; default `'x'` — the swing-flip axis; `'z'` — the hinge-jamb axis) |
351
358
  */
352
359
  export declare const PluginDesignDoorMirrorArgs: z.ZodObject<{
353
360
  door: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/doors/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;;;;;;;;;;;;GAgBG;AACH,8BAAsB,oBAAoB;;IAGxC;;;;;;;;;;;;;;;;;;OAkBG;aACa,OAAO,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAE9E;;;;;;;;;;;;;;;;;;OAkBG;aACa,SAAS,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAEhF;;;;;;;;;;;;;;;;;OAiBG;aACa,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAE/E;;;;;;;;;;;;;;;;;OAiBG;aACa,SAAS,CAAC,IAAI,EAAE,eAAe,GAAG,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAEhF;;;;;;;;;;;;;;;;;;;OAmBG;aACa,aAAa,CAC3B,IAAI,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O,MAAM,0BAA0B;;iBAAqC,CAAA;AAC5E,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA"}
@@ -14,6 +14,7 @@ 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";
18
19
  import { PluginDesignChangeResult } from "./lock";
19
20
  /**
@@ -29,6 +30,7 @@ import { PluginDesignChangeResult } from "./lock";
29
30
  * - {@linkcode PluginDesignApi.erase} — plan-level adjacency-edge erase (NOT hard delete)
30
31
  * - {@linkcode PluginDesignApi.delete} — hard entity removal
31
32
  * - {@linkcode PluginDesignApi.visibility} — hide / isolate / reveal entities
33
+ * - {@linkcode PluginDesignApi.dimensions} — dimension lines (Measuring Tape): create / list / delete / hide
32
34
  * - {@linkcode PluginDesignApi.types} — read-only building type / assembly reference
33
35
  * - {@linkcode PluginDesignApi.lock} / {@linkcode PluginDesignApi.unlock} / {@linkcode PluginDesignApi.isLocked} / {@linkcode PluginDesignApi.listLocked} — lock state (top-level design verbs, §2A.1)
34
36
  * - {@linkcode PluginDesignApi.lockArea} / {@linkcode PluginDesignApi.unlockArea} / {@linkcode PluginDesignApi.isAreaLocked} / {@linkcode PluginDesignApi.listAreaLocked} — footprint-area lock for Room/Department spaces
@@ -64,6 +66,8 @@ export declare abstract class PluginDesignApi {
64
66
  abstract update: PluginDesignUpdateApi;
65
67
  /** Hide / isolate / reveal entities. See {@linkcode PluginDesignVisibilityApi}. */
66
68
  abstract visibility: PluginDesignVisibilityApi;
69
+ /** Dimension lines (Measuring Tape). See {@linkcode PluginDesignDimensionsApi}. */
70
+ abstract dimensions: PluginDesignDimensionsApi;
67
71
  /** Read-only building type / assembly reference. See {@linkcode PluginDesignTypesApi}. */
68
72
  abstract types: PluginDesignTypesApi;
69
73
  /**
@@ -242,5 +246,6 @@ export * from "./transform";
242
246
  export * from "./edit";
243
247
  export * from "./update";
244
248
  export * from "./visibility";
249
+ export * from "./dimensions";
245
250
  export * from "./types";
246
251
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/design/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,yBAAyB,EAAE,MAAM,cAAc,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAA;AAEjD;;;;;;;;;;;;;;;;;;GAkBG;AACH,8BAAsB,eAAe;IACnC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S,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA"}
@@ -301,8 +301,8 @@ export type PluginAnnotateGeoKind = z.infer<typeof PluginAnnotateGeoKind>;
301
301
  /** Fill style for geo shapes (the same fills as the Present-mode style panel). */
302
302
  export declare const PluginAnnotateFill: z.ZodEnum<{
303
303
  pattern: "pattern";
304
- solid: "solid";
305
304
  none: "none";
305
+ solid: "solid";
306
306
  semi: "semi";
307
307
  }>;
308
308
  export type PluginAnnotateFill = z.infer<typeof PluginAnnotateFill>;
@@ -445,8 +445,8 @@ export declare const PluginPresentationAnnotateShapeArgs: z.ZodObject<{
445
445
  }>>;
446
446
  fill: z.ZodOptional<z.ZodEnum<{
447
447
  pattern: "pattern";
448
- solid: "solid";
449
448
  none: "none";
449
+ solid: "solid";
450
450
  semi: "semi";
451
451
  }>>;
452
452
  }, z.core.$strip>;
@@ -271,8 +271,8 @@ export declare const PluginPresentationShapeSpec: z.ZodDiscriminatedUnion<[z.Zod
271
271
  }>>;
272
272
  fill: z.ZodOptional<z.ZodEnum<{
273
273
  pattern: "pattern";
274
- solid: "solid";
275
274
  none: "none";
275
+ solid: "solid";
276
276
  semi: "semi";
277
277
  }>>;
278
278
  }, z.core.$strip>], "type">;
@@ -426,8 +426,8 @@ export declare const PluginPresentationShapesUpsertArgs: z.ZodObject<{
426
426
  }>>;
427
427
  fill: z.ZodOptional<z.ZodEnum<{
428
428
  pattern: "pattern";
429
- solid: "solid";
430
429
  none: "none";
430
+ solid: "solid";
431
431
  semi: "semi";
432
432
  }>>;
433
433
  }, z.core.$strip>], "type">;
package/dist/handles.d.ts CHANGED
@@ -93,6 +93,18 @@ export type UnderlayHandle = EntityId<"underlay">;
93
93
  * Returned by `core.io.import.terrain`.
94
94
  */
95
95
  export type TerrainHandle = EntityId<"terrain">;
96
+ /**
97
+ * A **dimension line** — one measurement annotation left behind by the Measuring
98
+ * Tape tool (NOT a width/height/depth property; see `design.dimensions`).
99
+ * Entity-style: the token IS the raw engine dimension id (`dim_…`), resolved live
100
+ * host-side from the dimension-line registry (`getDimensionLineMap()`) — not via
101
+ * `ComponentUtility.FindComponentById`, which does not index dimension lines (a
102
+ * dimension line is not a Component). No arena, no quota, stable across
103
+ * undo/redo and across reloads (the record persists with the project). Returned
104
+ * by `design.dimensions.create` and consumed by every other
105
+ * `design.dimensions.*` method.
106
+ */
107
+ export type DimensionHandle = EntityId<"dimension">;
96
108
  /**
97
109
  * A handle to an **asynchronous import job** (today: a DWG → Forge conversion, which
98
110
  * can take minutes). Returned immediately by `core.io.import.dwg`; poll it via
@@ -173,6 +185,13 @@ export declare const MaterialHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Mater
173
185
  export declare const UnderlayHandle: z.ZodPipe<z.ZodString, z.ZodTransform<UnderlayHandle, string>>;
174
186
  export declare const TerrainHandle: z.ZodPipe<z.ZodString, z.ZodTransform<TerrainHandle, string>>;
175
187
  export declare const ImportJobHandle: z.ZodPipe<z.ZodString, z.ZodTransform<ImportJobHandle, string>>;
188
+ /**
189
+ * {@linkcode DimensionHandle} is an entity-style handle — the raw `dim_…` engine
190
+ * id, validated only as a non-empty string (no `"<kind>_"` prefix enforcement),
191
+ * resolved live host-side against the dimension-line registry (existence
192
+ * enforced there, as `HANDLE_INVALID`).
193
+ */
194
+ export declare const DimensionHandle: z.ZodPipe<z.ZodString, z.ZodTransform<DimensionHandle, string>>;
176
195
  export declare const Vec3Handle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"vec3">, string>>;
177
196
  export declare const QuatHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"quat">, string>>;
178
197
  export declare const LineHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"line">, string>>;