@snaptrude/plugin-core 0.9.17 → 0.9.18-voids-20261016.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.
- package/api-manifest.full.json +10406 -0
- package/api-manifest.json +737 -54
- package/dist/api/analysis/daylight.d.ts +5 -5
- package/dist/api/analysis/solar.d.ts +2 -2
- package/dist/api/core/camera/index.d.ts +29 -0
- package/dist/api/core/camera/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +7 -1
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/update/contour.d.ts +8 -2
- package/dist/api/core/geom/update/contour.d.ts.map +1 -1
- package/dist/api/core/zoom/index.d.ts +13 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -1
- package/dist/api/design/bim.d.ts +209 -0
- package/dist/api/design/bim.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +2 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -1
- package/dist/api/design/catalog.d.ts +320 -0
- package/dist/api/design/catalog.d.ts.map +1 -0
- package/dist/api/design/create/bulk-items.d.ts +65 -25
- package/dist/api/design/create/bulk-items.d.ts.map +1 -1
- package/dist/api/design/create/index.d.ts +272 -99
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/create/opening-fields.d.ts +13 -12
- package/dist/api/design/create/opening-fields.d.ts.map +1 -1
- package/dist/api/design/delete/index.d.ts +1 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +18 -24
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +797 -27
- package/dist/api/design/family.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +16 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/networks.d.ts +1703 -0
- package/dist/api/design/networks.d.ts.map +1 -0
- package/dist/api/design/query/index.d.ts +42 -32
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/selection/index.d.ts +10 -10
- package/dist/api/design/types/index.d.ts +40 -24
- package/dist/api/design/types/index.d.ts.map +1 -1
- package/dist/api/design/update/index.d.ts +43 -3
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/windows/index.d.ts +8 -8
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +10 -10
- package/dist/api/presentation/annotate.d.ts +38 -22
- package/dist/api/presentation/annotate.d.ts.map +1 -1
- package/dist/api/presentation/drawingContract.d.ts +32 -0
- package/dist/api/presentation/drawingContract.d.ts.map +1 -0
- package/dist/api/presentation/drawings.d.ts +3523 -0
- package/dist/api/presentation/drawings.d.ts.map +1 -0
- package/dist/api/presentation/export.d.ts +23 -5
- package/dist/api/presentation/export.d.ts.map +1 -1
- package/dist/api/presentation/index.d.ts +32 -12
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +106 -6
- package/dist/api/presentation/placedViews.d.ts.map +1 -1
- package/dist/api/presentation/shapes.d.ts +2 -2
- package/dist/api/presentation/sheets.d.ts +175 -19
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/viewPresets.d.ts +222 -0
- package/dist/api/presentation/viewPresets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +103 -5
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/presentation/walkthroughs.d.ts +6 -6
- package/dist/errors/codes.d.ts +3 -1
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/index.cjs +3693 -2383
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3573 -2383
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/scripts/generate-manifest.mjs +5 -0
- package/src/api/core/camera/index.ts +29 -0
- package/src/api/core/geom/create/index.ts +7 -1
- package/src/api/core/geom/update/contour.ts +8 -2
- package/src/api/core/zoom/index.ts +13 -0
- package/src/api/design/bim.ts +121 -0
- package/src/api/design/boolean/index.ts +2 -0
- package/src/api/design/catalog.ts +203 -0
- package/src/api/design/create/bulk-items.ts +57 -17
- package/src/api/design/create/index.ts +288 -120
- package/src/api/design/create/opening-fields.ts +15 -12
- package/src/api/design/delete/index.ts +1 -0
- package/src/api/design/doors/index.ts +58 -42
- package/src/api/design/family.ts +662 -32
- package/src/api/design/index.ts +34 -4
- package/src/api/design/networks.ts +607 -0
- package/src/api/design/query/index.ts +12 -2
- package/src/api/design/types/index.ts +31 -24
- package/src/api/design/update/index.ts +44 -3
- package/src/api/design/windows/index.ts +40 -22
- package/src/api/presentation/annotate.ts +90 -58
- package/src/api/presentation/drawingContract.ts +70 -0
- package/src/api/presentation/drawings.ts +1179 -0
- package/src/api/presentation/export.ts +32 -6
- package/src/api/presentation/index.ts +39 -14
- package/src/api/presentation/placedViews.ts +119 -28
- package/src/api/presentation/sheets.ts +181 -20
- package/src/api/presentation/viewPresets.ts +241 -0
- package/src/api/presentation/views.ts +46 -6
- package/src/errors/codes.ts +7 -0
- package/test/drawingContract.test.mjs +288 -0
- package/test/errors.test.mjs +1 -0
|
@@ -6,27 +6,30 @@ import { ComponentHandle, Vec3Handle } from "../../../handles"
|
|
|
6
6
|
* {@linkcode PluginDesignCreateOpeningOptions} and by the bulk item schemas in
|
|
7
7
|
* `bulk-items.ts`, so singular and plural openings validate identically.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* Either may be omitted (engine-chosen side / the catalog item's authored
|
|
14
|
-
* hinge side). Neither has a visible effect on symmetric items such as
|
|
15
|
-
* sliders or fixed windows.
|
|
9
|
+
* PC-only placement. The family recipe owns dimensions and geometry. Overrides
|
|
10
|
+
* are applied before fit checks and cutting, never by scaling generated meshes.
|
|
11
|
+
* `facing` selects the host frame's +Z side. `hinge` selects the declared
|
|
12
|
+
* `hand` parameter (left/right); families without that control reject it.
|
|
16
13
|
*
|
|
17
14
|
* | Property | Type | Description |
|
|
18
15
|
* |---|---|---|
|
|
19
|
-
* | `
|
|
16
|
+
* | `familyId` | `string` | Hosted parametric definition ID, not a mesh catalog ID |
|
|
17
|
+
* | `version` | `number`? | Exact family version; newest known by default |
|
|
18
|
+
* | `values` | `Record<string, number \| string>`? | Authored instance parameters; numeric lengths use Snaptrude units |
|
|
20
19
|
* | `hostWall` | {@linkcode ComponentHandle} | The wall to host the opening |
|
|
21
20
|
* | `position` | {@linkcode Vec3Handle} | World point projected onto the wall |
|
|
22
21
|
* | `facing` | {@linkcode Vec3Handle}? | World point on the side of the wall the opening swings open to (default engine-chosen) |
|
|
23
|
-
* | `hinge` | {@linkcode Vec3Handle}? | World point near the
|
|
22
|
+
* | `hinge` | {@linkcode Vec3Handle}? | World point near the hinged jamb; requires the recipe's hand parameter |
|
|
24
23
|
* | `label` | `string`? | Instance name (optional) |
|
|
25
|
-
* | `width` | `number`? |
|
|
26
|
-
* | `height` | `number`? |
|
|
24
|
+
* | `width` | `number`? | Sets the declared width parameter, not the opening's evaluated envelope |
|
|
25
|
+
* | `height` | `number`? | Sets the declared height parameter |
|
|
27
26
|
*/
|
|
28
27
|
export const PluginOpeningBaseOptions = {
|
|
29
|
-
|
|
28
|
+
familyId: z.string().min(1),
|
|
29
|
+
version: z.number().int().positive().optional(),
|
|
30
|
+
values: z
|
|
31
|
+
.record(z.string(), z.union([z.number().finite(), z.string()]))
|
|
32
|
+
.optional(),
|
|
30
33
|
hostWall: ComponentHandle,
|
|
31
34
|
position: Vec3Handle,
|
|
32
35
|
facing: Vec3Handle.optional(),
|
|
@@ -55,6 +55,7 @@ export abstract class PluginDesignDeleteApi {
|
|
|
55
55
|
* @examplePrompt Get rid of this mass entirely
|
|
56
56
|
* @examplePrompt Delete all the furniture I picked
|
|
57
57
|
* @examplePrompt Remove the door and window I just created
|
|
58
|
+
* @examplePrompt Remove the void I cut in this slab
|
|
58
59
|
*
|
|
59
60
|
* @performance Array delete — pass every target in one call (one host round-trip). There is
|
|
60
61
|
* no per-item delete; collect the whole set and never loop this per entity.
|
|
@@ -8,18 +8,15 @@ import { PluginDesignChangeResult } from "../lock"
|
|
|
8
8
|
* `design.create.door`; generic reads (`listDoors`/`getHost`/`getProperties`) live at
|
|
9
9
|
* `design.query.*`. Door targets are {@linkcode ComponentHandle}s.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* `setType` is intentionally absent (the engine has no in-place re-type —
|
|
16
|
-
* it would require delete+recreate).
|
|
11
|
+
* PC-only: dimensions read the evaluated opening. Setters write declared width/height
|
|
12
|
+
* parameters, never mesh scale. Missing or derived controls reject. Linked copies follow
|
|
13
|
+
* the shared edit. Use design.family.setParameters for other parameters.
|
|
14
|
+
* getSwingDirection reads hand. mirror changes declared swing or hand controls.
|
|
17
15
|
*
|
|
18
16
|
* The **catalog** reads (`listCatalogGroups`/`listCatalog`/`getCatalogItem`/`exists`)
|
|
19
|
-
* browse
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
* (`[]`/`null`). The {@linkcode PluginObjectCatalogGroup} / {@linkcode PluginObjectCatalogItem}
|
|
17
|
+
* browse saved hosted door families, keyed by definition ID, and feed design.create.door.
|
|
18
|
+
* They reject if saved definitions cannot be loaded completely. A missing item returns null.
|
|
19
|
+
* The {@linkcode PluginObjectCatalogGroup} / {@linkcode PluginObjectCatalogItem}
|
|
23
20
|
* DTOs are shared with `design.windows`.
|
|
24
21
|
*/
|
|
25
22
|
export abstract class PluginDesignDoorsApi {
|
|
@@ -65,7 +62,9 @@ export abstract class PluginDesignDoorsApi {
|
|
|
65
62
|
* if (family) console.log("family:", family)
|
|
66
63
|
* ```
|
|
67
64
|
*/
|
|
68
|
-
public abstract getFamily(
|
|
65
|
+
public abstract getFamily(
|
|
66
|
+
door: ComponentHandle,
|
|
67
|
+
): PluginApiReturn<string | null>
|
|
69
68
|
|
|
70
69
|
/**
|
|
71
70
|
* Get the width of a door — how wide its opening is along the host wall.
|
|
@@ -85,7 +84,9 @@ export abstract class PluginDesignDoorsApi {
|
|
|
85
84
|
* if (width !== null) console.log("door width:", width)
|
|
86
85
|
* ```
|
|
87
86
|
*/
|
|
88
|
-
public abstract getWidth(
|
|
87
|
+
public abstract getWidth(
|
|
88
|
+
door: ComponentHandle,
|
|
89
|
+
): PluginApiReturn<number | null>
|
|
89
90
|
|
|
90
91
|
/**
|
|
91
92
|
* Get the height of a door — how tall its opening is from base to head.
|
|
@@ -105,12 +106,13 @@ export abstract class PluginDesignDoorsApi {
|
|
|
105
106
|
* if (height !== null) console.log("door height:", height)
|
|
106
107
|
* ```
|
|
107
108
|
*/
|
|
108
|
-
public abstract getHeight(
|
|
109
|
+
public abstract getHeight(
|
|
110
|
+
door: ComponentHandle,
|
|
111
|
+
): PluginApiReturn<number | null>
|
|
109
112
|
|
|
110
113
|
/**
|
|
111
|
-
* Get
|
|
112
|
-
*
|
|
113
|
-
* oriented space. Parity with {@linkcode PluginDesignWindowsApi.getDimensions}.
|
|
114
|
+
* Get evaluated opening width/height and host thickness, in Snaptrude units.
|
|
115
|
+
* The opening can include allowances beyond the width/height input parameters.
|
|
114
116
|
*
|
|
115
117
|
* @param door The door to query
|
|
116
118
|
* @returns The dimensions, or `null`
|
|
@@ -128,12 +130,12 @@ export abstract class PluginDesignDoorsApi {
|
|
|
128
130
|
* ```
|
|
129
131
|
*/
|
|
130
132
|
public abstract getDimensions(
|
|
131
|
-
door: ComponentHandle
|
|
133
|
+
door: ComponentHandle,
|
|
132
134
|
): PluginApiReturn<PluginDoorDimensions | null>
|
|
133
135
|
|
|
134
136
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
+
* Returns null for recipe doors. Room floors own doorway infill; there is
|
|
138
|
+
* no separate support-floor entity.
|
|
137
139
|
*
|
|
138
140
|
* @param door The door to query
|
|
139
141
|
* @returns The support floor {@linkcode ComponentHandle}, or `null`
|
|
@@ -153,14 +155,13 @@ export abstract class PluginDesignDoorsApi {
|
|
|
153
155
|
* }
|
|
154
156
|
* ```
|
|
155
157
|
*/
|
|
156
|
-
public abstract getSupportFloor(
|
|
158
|
+
public abstract getSupportFloor(
|
|
159
|
+
door: ComponentHandle,
|
|
160
|
+
): PluginApiReturn<ComponentHandle | null>
|
|
157
161
|
|
|
158
162
|
/**
|
|
159
|
-
*
|
|
160
|
-
*
|
|
161
|
-
* `'right'` when it is on your right. Derived from the placed mesh's
|
|
162
|
-
* orientation (the same reflection `mirror` and the `hinge` placement option
|
|
163
|
-
* apply), not a persisted field.
|
|
163
|
+
* Read the saved hand parameter. left means local -X; right means local +X.
|
|
164
|
+
* Returns null when the recipe does not declare that control.
|
|
164
165
|
*
|
|
165
166
|
* @param door The door to query
|
|
166
167
|
* @returns `'left'` / `'right'`, or `null` if indeterminate
|
|
@@ -178,14 +179,15 @@ export abstract class PluginDesignDoorsApi {
|
|
|
178
179
|
* ```
|
|
179
180
|
*/
|
|
180
181
|
public abstract getSwingDirection(
|
|
181
|
-
door: ComponentHandle
|
|
182
|
+
door: ComponentHandle,
|
|
182
183
|
): PluginApiReturn<"left" | "right" | null>
|
|
183
184
|
|
|
184
185
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
186
|
+
* Change authored controls in one undo step: x (default) toggles swing
|
|
187
|
+
* front/back; z toggles hand left/right. The recipe must declare these enums.
|
|
188
|
+
* Axis y rejects. No mesh reflection occurs. Recipes use outputs.swingSide
|
|
189
|
+
* (1 or -1) for the adjoining room's floor ownership. A door between two
|
|
190
|
+
* room floors requires this output; a missing or invalid report rejects the cut.
|
|
189
191
|
*
|
|
190
192
|
* @param door The door to mirror
|
|
191
193
|
* @param axis Reflection axis (optional; default `'x'` — the swing-flip axis; `'z'` — the hinge-jamb axis)
|
|
@@ -208,7 +210,7 @@ export abstract class PluginDesignDoorsApi {
|
|
|
208
210
|
*/
|
|
209
211
|
public abstract mirror(
|
|
210
212
|
door: ComponentHandle,
|
|
211
|
-
axis?: PluginMirrorAxis
|
|
213
|
+
axis?: PluginMirrorAxis,
|
|
212
214
|
): PluginApiReturn<PluginDesignChangeResult>
|
|
213
215
|
|
|
214
216
|
/**
|
|
@@ -235,7 +237,7 @@ export abstract class PluginDesignDoorsApi {
|
|
|
235
237
|
*/
|
|
236
238
|
public abstract setWidth(
|
|
237
239
|
doors: ComponentHandle[],
|
|
238
|
-
width: number
|
|
240
|
+
width: number,
|
|
239
241
|
): PluginApiReturn<PluginDesignChangeResult>
|
|
240
242
|
|
|
241
243
|
/**
|
|
@@ -260,7 +262,7 @@ export abstract class PluginDesignDoorsApi {
|
|
|
260
262
|
*/
|
|
261
263
|
public abstract setHeight(
|
|
262
264
|
doors: ComponentHandle[],
|
|
263
|
-
height: number
|
|
265
|
+
height: number,
|
|
264
266
|
): PluginApiReturn<PluginDesignChangeResult>
|
|
265
267
|
|
|
266
268
|
/**
|
|
@@ -280,7 +282,9 @@ export abstract class PluginDesignDoorsApi {
|
|
|
280
282
|
* for (const g of groups) console.log(g.dbType, g.label, g.source)
|
|
281
283
|
* ```
|
|
282
284
|
*/
|
|
283
|
-
public abstract listCatalogGroups(): PluginApiReturn<
|
|
285
|
+
public abstract listCatalogGroups(): PluginApiReturn<
|
|
286
|
+
PluginObjectCatalogGroup[]
|
|
287
|
+
>
|
|
284
288
|
|
|
285
289
|
/**
|
|
286
290
|
* List the placeable door catalog (team + general libraries), optionally
|
|
@@ -302,7 +306,7 @@ export abstract class PluginDesignDoorsApi {
|
|
|
302
306
|
* ```
|
|
303
307
|
*/
|
|
304
308
|
public abstract listCatalog(
|
|
305
|
-
group?: string
|
|
309
|
+
group?: string,
|
|
306
310
|
): PluginApiReturn<PluginObjectCatalogItem[]>
|
|
307
311
|
|
|
308
312
|
/**
|
|
@@ -324,7 +328,7 @@ export abstract class PluginDesignDoorsApi {
|
|
|
324
328
|
* ```
|
|
325
329
|
*/
|
|
326
330
|
public abstract getCatalogItem(
|
|
327
|
-
id: string
|
|
331
|
+
id: string,
|
|
328
332
|
): PluginApiReturn<PluginObjectCatalogItem | null>
|
|
329
333
|
|
|
330
334
|
/**
|
|
@@ -392,7 +396,9 @@ export const PluginDesignDoorMirrorArgs = z.object({
|
|
|
392
396
|
door: ComponentHandle,
|
|
393
397
|
axis: PluginMirrorAxis.optional(),
|
|
394
398
|
})
|
|
395
|
-
export type PluginDesignDoorMirrorArgs = z.infer<
|
|
399
|
+
export type PluginDesignDoorMirrorArgs = z.infer<
|
|
400
|
+
typeof PluginDesignDoorMirrorArgs
|
|
401
|
+
>
|
|
396
402
|
|
|
397
403
|
/**
|
|
398
404
|
* Arguments for {@linkcode PluginDesignDoorsApi.setWidth}.
|
|
@@ -406,7 +412,9 @@ export const PluginDesignDoorSetWidthArgs = z.object({
|
|
|
406
412
|
doors: z.array(ComponentHandle),
|
|
407
413
|
width: z.number(),
|
|
408
414
|
})
|
|
409
|
-
export type PluginDesignDoorSetWidthArgs = z.infer<
|
|
415
|
+
export type PluginDesignDoorSetWidthArgs = z.infer<
|
|
416
|
+
typeof PluginDesignDoorSetWidthArgs
|
|
417
|
+
>
|
|
410
418
|
|
|
411
419
|
/**
|
|
412
420
|
* Arguments for {@linkcode PluginDesignDoorsApi.setHeight}.
|
|
@@ -420,7 +428,9 @@ export const PluginDesignDoorSetHeightArgs = z.object({
|
|
|
420
428
|
doors: z.array(ComponentHandle),
|
|
421
429
|
height: z.number(),
|
|
422
430
|
})
|
|
423
|
-
export type PluginDesignDoorSetHeightArgs = z.infer<
|
|
431
|
+
export type PluginDesignDoorSetHeightArgs = z.infer<
|
|
432
|
+
typeof PluginDesignDoorSetHeightArgs
|
|
433
|
+
>
|
|
424
434
|
|
|
425
435
|
// ---------------------------------------------------------------------------
|
|
426
436
|
// catalog (shared by doors + windows)
|
|
@@ -482,7 +492,9 @@ export type PluginObjectCatalogItem = z.infer<typeof PluginObjectCatalogItem>
|
|
|
482
492
|
export const PluginDesignDoorListCatalogArgs = z.object({
|
|
483
493
|
group: z.string().optional(),
|
|
484
494
|
})
|
|
485
|
-
export type PluginDesignDoorListCatalogArgs = z.infer<
|
|
495
|
+
export type PluginDesignDoorListCatalogArgs = z.infer<
|
|
496
|
+
typeof PluginDesignDoorListCatalogArgs
|
|
497
|
+
>
|
|
486
498
|
|
|
487
499
|
/**
|
|
488
500
|
* Arguments for {@linkcode PluginDesignDoorsApi.getCatalogItem} / {@linkcode PluginDesignDoorsApi.exists}.
|
|
@@ -494,7 +506,11 @@ export type PluginDesignDoorListCatalogArgs = z.infer<typeof PluginDesignDoorLis
|
|
|
494
506
|
export const PluginDesignDoorGetCatalogItemArgs = z.object({
|
|
495
507
|
id: z.string(),
|
|
496
508
|
})
|
|
497
|
-
export type PluginDesignDoorGetCatalogItemArgs = z.infer<
|
|
509
|
+
export type PluginDesignDoorGetCatalogItemArgs = z.infer<
|
|
510
|
+
typeof PluginDesignDoorGetCatalogItemArgs
|
|
511
|
+
>
|
|
498
512
|
|
|
499
513
|
export const PluginDesignDoorExistsArgs = PluginDesignDoorGetCatalogItemArgs
|
|
500
|
-
export type PluginDesignDoorExistsArgs = z.infer<
|
|
514
|
+
export type PluginDesignDoorExistsArgs = z.infer<
|
|
515
|
+
typeof PluginDesignDoorExistsArgs
|
|
516
|
+
>
|