@snaptrude/plugin-core 0.9.17 → 0.9.18-voids-20261017.1

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 (102) hide show
  1. package/dist/api/analysis/daylight.d.ts +5 -5
  2. package/dist/api/analysis/solar.d.ts +2 -2
  3. package/dist/api/core/camera/index.d.ts +29 -0
  4. package/dist/api/core/camera/index.d.ts.map +1 -1
  5. package/dist/api/core/geom/create/index.d.ts +7 -1
  6. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  7. package/dist/api/core/geom/update/contour.d.ts +8 -2
  8. package/dist/api/core/geom/update/contour.d.ts.map +1 -1
  9. package/dist/api/core/zoom/index.d.ts +13 -0
  10. package/dist/api/core/zoom/index.d.ts.map +1 -1
  11. package/dist/api/design/bim.d.ts +299 -0
  12. package/dist/api/design/bim.d.ts.map +1 -0
  13. package/dist/api/design/boolean/index.d.ts +2 -0
  14. package/dist/api/design/boolean/index.d.ts.map +1 -1
  15. package/dist/api/design/catalog.d.ts +320 -0
  16. package/dist/api/design/catalog.d.ts.map +1 -0
  17. package/dist/api/design/create/bulk-items.d.ts +65 -25
  18. package/dist/api/design/create/bulk-items.d.ts.map +1 -1
  19. package/dist/api/design/create/index.d.ts +272 -99
  20. package/dist/api/design/create/index.d.ts.map +1 -1
  21. package/dist/api/design/create/opening-fields.d.ts +13 -12
  22. package/dist/api/design/create/opening-fields.d.ts.map +1 -1
  23. package/dist/api/design/delete/index.d.ts +1 -0
  24. package/dist/api/design/delete/index.d.ts.map +1 -1
  25. package/dist/api/design/doors/index.d.ts +18 -24
  26. package/dist/api/design/doors/index.d.ts.map +1 -1
  27. package/dist/api/design/family.d.ts +801 -28
  28. package/dist/api/design/family.d.ts.map +1 -1
  29. package/dist/api/design/index.d.ts +16 -0
  30. package/dist/api/design/index.d.ts.map +1 -1
  31. package/dist/api/design/networks.d.ts +1703 -0
  32. package/dist/api/design/networks.d.ts.map +1 -0
  33. package/dist/api/design/query/index.d.ts +42 -32
  34. package/dist/api/design/query/index.d.ts.map +1 -1
  35. package/dist/api/design/selection/index.d.ts +10 -10
  36. package/dist/api/design/types/index.d.ts +40 -24
  37. package/dist/api/design/types/index.d.ts.map +1 -1
  38. package/dist/api/design/update/index.d.ts +43 -3
  39. package/dist/api/design/update/index.d.ts.map +1 -1
  40. package/dist/api/design/windows/index.d.ts +8 -8
  41. package/dist/api/design/windows/index.d.ts.map +1 -1
  42. package/dist/api/presentation/aiInspiration.d.ts +10 -10
  43. package/dist/api/presentation/annotate.d.ts +38 -22
  44. package/dist/api/presentation/annotate.d.ts.map +1 -1
  45. package/dist/api/presentation/drawingContract.d.ts +32 -0
  46. package/dist/api/presentation/drawingContract.d.ts.map +1 -0
  47. package/dist/api/presentation/drawings.d.ts +3523 -0
  48. package/dist/api/presentation/drawings.d.ts.map +1 -0
  49. package/dist/api/presentation/export.d.ts +23 -5
  50. package/dist/api/presentation/export.d.ts.map +1 -1
  51. package/dist/api/presentation/index.d.ts +32 -12
  52. package/dist/api/presentation/index.d.ts.map +1 -1
  53. package/dist/api/presentation/placedViews.d.ts +106 -6
  54. package/dist/api/presentation/placedViews.d.ts.map +1 -1
  55. package/dist/api/presentation/shapes.d.ts +2 -2
  56. package/dist/api/presentation/sheets.d.ts +175 -19
  57. package/dist/api/presentation/sheets.d.ts.map +1 -1
  58. package/dist/api/presentation/viewPresets.d.ts +222 -0
  59. package/dist/api/presentation/viewPresets.d.ts.map +1 -0
  60. package/dist/api/presentation/views.d.ts +103 -5
  61. package/dist/api/presentation/views.d.ts.map +1 -1
  62. package/dist/api/presentation/walkthroughs.d.ts +6 -6
  63. package/dist/errors/codes.d.ts +3 -1
  64. package/dist/errors/codes.d.ts.map +1 -1
  65. package/dist/index.cjs +3741 -2383
  66. package/dist/index.cjs.map +1 -1
  67. package/dist/index.js +3618 -2383
  68. package/dist/index.js.map +1 -1
  69. package/package.json +1 -1
  70. package/scripts/generate-manifest.mjs +5 -0
  71. package/src/api/core/camera/index.ts +29 -0
  72. package/src/api/core/geom/create/index.ts +7 -1
  73. package/src/api/core/geom/update/contour.ts +8 -2
  74. package/src/api/core/zoom/index.ts +13 -0
  75. package/src/api/design/bim.ts +210 -0
  76. package/src/api/design/boolean/index.ts +2 -0
  77. package/src/api/design/catalog.ts +203 -0
  78. package/src/api/design/create/bulk-items.ts +57 -17
  79. package/src/api/design/create/index.ts +288 -120
  80. package/src/api/design/create/opening-fields.ts +15 -12
  81. package/src/api/design/delete/index.ts +1 -0
  82. package/src/api/design/doors/index.ts +58 -42
  83. package/src/api/design/family.ts +666 -33
  84. package/src/api/design/index.ts +34 -4
  85. package/src/api/design/networks.ts +607 -0
  86. package/src/api/design/query/index.ts +12 -2
  87. package/src/api/design/types/index.ts +31 -24
  88. package/src/api/design/update/index.ts +44 -3
  89. package/src/api/design/windows/index.ts +40 -22
  90. package/src/api/presentation/annotate.ts +90 -58
  91. package/src/api/presentation/drawingContract.ts +70 -0
  92. package/src/api/presentation/drawings.ts +1179 -0
  93. package/src/api/presentation/export.ts +32 -6
  94. package/src/api/presentation/index.ts +39 -14
  95. package/src/api/presentation/placedViews.ts +119 -28
  96. package/src/api/presentation/sheets.ts +181 -20
  97. package/src/api/presentation/viewPresets.ts +241 -0
  98. package/src/api/presentation/views.ts +46 -6
  99. package/src/errors/codes.ts +7 -0
  100. package/test/drawingContract.test.mjs +288 -0
  101. package/test/errors.test.mjs +1 -0
  102. package/api-manifest.json +0 -9711
@@ -1,6 +1,13 @@
1
1
  import * as z from "zod"
2
- import { ContourHandle, ProfileHandle, Vec3Handle } from "../../../handles"
2
+ import {
3
+ ComponentHandle,
4
+ ContourHandle,
5
+ ProfileHandle,
6
+ Vec3Handle,
7
+ } from "../../../handles"
3
8
  import { PluginOpeningBaseOptions } from "./opening-fields"
9
+ import { PluginWallType } from "../types"
10
+ import { PluginFamilyValues } from "../catalog"
4
11
 
5
12
  /**
6
13
  * Maximum items per bulk `design.create.*` call. A bounded request keeps
@@ -88,7 +95,7 @@ export type PluginWallTopProfile = z.infer<typeof PluginWallTopProfile>
88
95
  * | `profile` | {@linkcode ProfileHandle} | Ordered curve chain (wall centerlines) |
89
96
  * | `height` | `number`? | Wall height (Snaptrude units, > 0; default engine default) |
90
97
  * | `thickness` | `number`? | Wall thickness (Snaptrude units, > 0; default: `wallType`'s total layer thickness when given, else engine default) |
91
- * | `wallType` | `string`? | Wall type name from `design.types.list("wall")` — layers/material/thickness defaults (default generic) |
98
+ * | `wallType` | {@linkcode PluginWallType}? | Legacy name/id or exact native `{ id, version }` pin from `design.types.list("wall")` (default generic) |
92
99
  * | `storey` | `number`? (int) | Target storey (must exist) — the run's walls are assigned + lifted to its base in the same undo entry (default: geometry-derived) |
93
100
  * | `topProfiles` | ({@linkcode PluginWallTopProfile} \| `null`)[]? | Top edge per curve of `profile`, same order; a `null` or missing entry keeps that wall flat at `height`. Raked / gabled walls (straight curves only) |
94
101
  */
@@ -96,9 +103,11 @@ export const PluginCreateWallRunItem = z.object({
96
103
  profile: ProfileHandle,
97
104
  height: z.number().optional(),
98
105
  thickness: z.number().optional(),
99
- wallType: z.string().min(1).optional(),
106
+ wallType: PluginWallType.optional(),
100
107
  storey: z.number().int().optional(),
101
108
  topProfiles: z.array(PluginWallTopProfile.nullable()).optional(),
109
+ /** Optional family overrides in mm/degrees. Host length/height stay geometry inputs. */
110
+ values: PluginFamilyValues.optional(),
102
111
  })
103
112
  export type PluginCreateWallRunItem = z.infer<typeof PluginCreateWallRunItem>
104
113
 
@@ -143,22 +152,23 @@ export type PluginCreateFloorItems = z.infer<typeof PluginCreateFloorItems>
143
152
 
144
153
  /**
145
154
  * One door to place via {@linkcode PluginDesignCreateApi.doors} — the same
146
- * fields as a `"door"` {@linkcode PluginDesignCreateOpeningOptions}, so the
147
- * size overrides singular {@linkcode PluginDesignCreateApi.door} lacks are
148
- * available per item. `facing` and `hinge` are WORLD POINTS, not directions:
149
- * `facing` on the side of the wall the door swings open to, `hinge` near the
150
- * jamb it is hinged on. Rejects unknown fields.
155
+ * fields as a `"door"` {@linkcode PluginDesignCreateOpeningOptions}.
156
+ * Values are evaluated before cutting. Numeric lengths use SU; unit strings
157
+ * are accepted in values. `facing` selects local +Z; `hinge` sets the declared
158
+ * hand enum (left = local -X, right = +X). Both are world points.
151
159
  *
152
160
  * | Property | Type | Description |
153
161
  * |---|---|---|
154
- * | `catalogId` | `string` | Library id: team `_id` or general `fullName` |
162
+ * | `familyId` | `string` | Hosted door family definition ID |
163
+ * | `version` | `number`? | Exact version; newest known by default |
164
+ * | `values` | `Record<string, number \| string>`? | Authored parameter overrides |
155
165
  * | `hostWall` | {@linkcode ComponentHandle} | The wall to host the door |
156
166
  * | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
157
167
  * | `facing` | {@linkcode Vec3Handle}? | World point on the side the door swings open to (default engine-chosen) |
158
- * | `hinge` | {@linkcode Vec3Handle}? | World point near the jamb the door is hinged on (default the catalog item's authored side) |
168
+ * | `hinge` | {@linkcode Vec3Handle}? | World point near the hinged jamb; requires hand control |
159
169
  * | `label` | `string`? | Instance name (optional) |
160
- * | `width` | `number`? | Width override (Snaptrude units, > 0; default the catalog item's) |
161
- * | `height` | `number`? | Height override (Snaptrude units, > 0; default the catalog item's) |
170
+ * | `width` | `number`? | Declared width parameter (SU, > 0), not evaluated hole width |
171
+ * | `height` | `number`? | Declared height parameter (SU, > 0) |
162
172
  */
163
173
  export const PluginCreateDoorItem = z
164
174
  .object({ ...PluginOpeningBaseOptions })
@@ -183,15 +193,17 @@ export type PluginCreateDoorItems = z.infer<typeof PluginCreateDoorItems>
183
193
  *
184
194
  * | Property | Type | Description |
185
195
  * |---|---|---|
186
- * | `catalogId` | `string` | Library id: team `_id` or general `fullName` |
196
+ * | `familyId` | `string` | Hosted window family definition ID |
197
+ * | `version` | `number`? | Exact version; newest known by default |
198
+ * | `values` | `Record<string, number \| string>`? | Authored parameter overrides; numeric lengths use SU |
187
199
  * | `hostWall` | {@linkcode ComponentHandle} | The wall to host the window |
188
200
  * | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
189
201
  * | `facing` | {@linkcode Vec3Handle}? | World point on the side the window opens to (default engine-chosen) |
190
- * | `hinge` | {@linkcode Vec3Handle}? | World point near the jamb the window is hinged on (default the catalog item's authored side) |
202
+ * | `hinge` | {@linkcode Vec3Handle}? | World point near the hinged jamb; requires hand control |
191
203
  * | `label` | `string`? | Instance name (optional) |
192
- * | `width` | `number`? | Width override (Snaptrude units, > 0; default the catalog item's) |
193
- * | `height` | `number`? | Height override (Snaptrude units, > 0; default the catalog item's) |
194
- * | `sillHeight` | `number`? | Wall base to window bottom (Snaptrude units, ≥ 0; default the catalog item's) |
204
+ * | `width` | `number`? | Declared width parameter (SU, > 0), not evaluated hole width |
205
+ * | `height` | `number`? | Declared height parameter (SU, > 0) |
206
+ * | `sillHeight` | `number`? | Declared sill parameter (SU, ≥ 0); position Y is ignored |
195
207
  */
196
208
  export const PluginCreateWindowItem = z
197
209
  .object({
@@ -252,3 +264,31 @@ export const PluginCreateFurnitureItems = z
252
264
  export type PluginCreateFurnitureItems = z.infer<
253
265
  typeof PluginCreateFurnitureItems
254
266
  >
267
+
268
+ // ---------------------------------------------------------------------------
269
+ // voids
270
+ // ---------------------------------------------------------------------------
271
+
272
+ /**
273
+ * One void to cut via {@linkcode PluginDesignCreateApi.voids} — the same fields as
274
+ * {@linkcode PluginDesignCreateApi.void}. Rejects unknown fields.
275
+ *
276
+ * | Property | Type | Description |
277
+ * | --- | --- | --- |
278
+ * | `host` | {@linkcode ComponentHandle} | The slab, floor, roof or ceiling to cut through. Not a wall. |
279
+ * | `outline` | {@linkcode ProfileHandle} | Closed, flat plan outline in world SU (all points at one height). That height is ignored: it is dropped straight onto the host's top face. |
280
+ */
281
+ export const PluginCreateVoidItem = z
282
+ .object({
283
+ host: ComponentHandle,
284
+ outline: ProfileHandle,
285
+ })
286
+ .strict()
287
+ export type PluginCreateVoidItem = z.infer<typeof PluginCreateVoidItem>
288
+
289
+ /** The `items` array of {@linkcode PluginDesignCreateApi.voids} (1…1000; the host takes at most 200, 50 per host). */
290
+ export const PluginCreateVoidItems = z
291
+ .array(PluginCreateVoidItem)
292
+ .min(1)
293
+ .max(PLUGIN_CREATE_BATCH_LIMIT)
294
+ export type PluginCreateVoidItems = z.infer<typeof PluginCreateVoidItems>