@snaptrude/plugin-core 0.0.0-dev-20260708130115 → 0.0.0-dev-20260827194031
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/CHANGELOG.md +152 -1
- package/api-manifest.json +3643 -276
- package/dist/api/analysis/daylight.d.ts +603 -0
- package/dist/api/analysis/daylight.d.ts.map +1 -0
- package/dist/api/analysis/heatmaps.d.ts +658 -0
- package/dist/api/analysis/heatmaps.d.ts.map +1 -0
- package/dist/api/analysis/illuminance.d.ts +145 -0
- package/dist/api/analysis/illuminance.d.ts.map +1 -0
- package/dist/api/analysis/index.d.ts +59 -0
- package/dist/api/analysis/index.d.ts.map +1 -0
- package/dist/api/analysis/shadows.d.ts +165 -0
- package/dist/api/analysis/shadows.d.ts.map +1 -0
- package/dist/api/analysis/solar.d.ts +249 -0
- package/dist/api/analysis/solar.d.ts.map +1 -0
- package/dist/api/analysis/sunlightHours.d.ts +208 -0
- package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
- package/dist/api/analysis/sunpath.d.ts +80 -0
- package/dist/api/analysis/sunpath.d.ts.map +1 -0
- package/dist/api/analysis/weather.d.ts +193 -0
- package/dist/api/analysis/weather.d.ts.map +1 -0
- package/dist/api/core/camera/index.d.ts +261 -0
- package/dist/api/core/camera/index.d.ts.map +1 -0
- package/dist/api/core/comment/index.d.ts +105 -2
- package/dist/api/core/comment/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +840 -14
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/delete/index.d.ts +8 -2
- package/dist/api/core/geom/delete/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/arc.d.ts +5 -5
- package/dist/api/core/geom/query/brep.d.ts +130 -18
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/circle.d.ts +18 -18
- package/dist/api/core/geom/query/contour.d.ts +20 -20
- package/dist/api/core/geom/query/curve.d.ts +49 -49
- package/dist/api/core/geom/query/edge.d.ts +5 -5
- package/dist/api/core/geom/query/face.d.ts +16 -16
- package/dist/api/core/geom/query/halfedge.d.ts +8 -8
- package/dist/api/core/geom/query/profile.d.ts +19 -19
- package/dist/api/core/geom/query/vertex.d.ts +8 -8
- package/dist/api/core/geom/update/contour.d.ts +14 -14
- package/dist/api/core/geom/update/curve.d.ts +7 -7
- package/dist/api/core/geom/update/profile.d.ts +16 -16
- package/dist/api/core/handles/index.d.ts +210 -0
- package/dist/api/core/handles/index.d.ts.map +1 -0
- package/dist/api/core/index.d.ts +34 -0
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/export/index.d.ts +134 -0
- package/dist/api/core/io/export/index.d.ts.map +1 -0
- package/dist/api/core/io/import/index.d.ts +453 -0
- package/dist/api/core/io/import/index.d.ts.map +1 -0
- package/dist/api/core/io/index.d.ts +40 -0
- package/dist/api/core/io/index.d.ts.map +1 -0
- package/dist/api/core/io/job/index.d.ts +139 -0
- package/dist/api/core/io/job/index.d.ts.map +1 -0
- package/dist/api/core/io/query/index.d.ts +74 -0
- package/dist/api/core/io/query/index.d.ts.map +1 -0
- package/dist/api/core/io/terrain/index.d.ts +341 -0
- package/dist/api/core/io/terrain/index.d.ts.map +1 -0
- package/dist/api/core/io/underlay/index.d.ts +805 -0
- package/dist/api/core/io/underlay/index.d.ts.map +1 -0
- package/dist/api/core/layers.d.ts +7 -7
- package/dist/api/core/mode/index.d.ts +99 -0
- package/dist/api/core/mode/index.d.ts.map +1 -0
- package/dist/api/core/project/index.d.ts +68 -1
- package/dist/api/core/project/index.d.ts.map +1 -1
- package/dist/api/core/proposals/index.d.ts +531 -0
- package/dist/api/core/proposals/index.d.ts.map +1 -0
- package/dist/api/core/storeys/index.d.ts +265 -0
- package/dist/api/core/storeys/index.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +24 -0
- package/dist/api/core/tags.d.ts.map +1 -1
- package/dist/api/core/user.d.ts +44 -0
- package/dist/api/core/user.d.ts.map +1 -0
- package/dist/api/core/zoom/index.d.ts +4 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -1
- package/dist/api/design/boolean/index.d.ts +4 -4
- package/dist/api/design/create/index.d.ts +568 -45
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/delete/index.d.ts +3 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +195 -0
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/edit/index.d.ts +1 -1
- package/dist/api/design/erase/index.d.ts +2 -2
- package/dist/api/design/family.d.ts +493 -0
- package/dist/api/design/family.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +181 -8
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +98 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/lock.d.ts +26 -0
- package/dist/api/design/lock.d.ts.map +1 -1
- package/dist/api/design/materials/index.d.ts +270 -16
- package/dist/api/design/materials/index.d.ts.map +1 -1
- package/dist/api/design/query/geometry/index.d.ts +112 -0
- package/dist/api/design/query/geometry/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +289 -11
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/referenceLines.d.ts +45 -0
- package/dist/api/design/query/referenceLines.d.ts.map +1 -0
- package/dist/api/design/query/spaces.d.ts +181 -8
- package/dist/api/design/query/spaces.d.ts.map +1 -1
- package/dist/api/design/selection/index.d.ts +144 -0
- package/dist/api/design/selection/index.d.ts.map +1 -1
- package/dist/api/design/transform/index.d.ts +172 -10
- package/dist/api/design/transform/index.d.ts.map +1 -1
- package/dist/api/design/types/index.d.ts +181 -0
- package/dist/api/design/types/index.d.ts.map +1 -0
- package/dist/api/design/update/index.d.ts +553 -2
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/visibility.d.ts +126 -0
- package/dist/api/design/visibility.d.ts.map +1 -0
- package/dist/api/design/windows/index.d.ts +113 -2
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/entity/buildableEnvelope.d.ts +4 -0
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +10 -2
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +21 -21
- package/dist/api/entity/story.d.ts +242 -15
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +10 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +25 -25
- package/dist/api/presentation/annotate.d.ts +467 -0
- package/dist/api/presentation/annotate.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +111 -8
- package/dist/api/presentation/diagrams.d.ts.map +1 -1
- package/dist/api/presentation/export.d.ts +108 -0
- package/dist/api/presentation/export.d.ts.map +1 -0
- package/dist/api/presentation/import.d.ts +55 -4
- package/dist/api/presentation/import.d.ts.map +1 -1
- package/dist/api/presentation/index.d.ts +58 -1
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +1139 -0
- package/dist/api/presentation/placedViews.d.ts.map +1 -0
- package/dist/api/presentation/shapes.d.ts +481 -0
- package/dist/api/presentation/shapes.d.ts.map +1 -0
- package/dist/api/presentation/sheets.d.ts +452 -13
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/slideshow.d.ts +125 -0
- package/dist/api/presentation/slideshow.d.ts.map +1 -0
- package/dist/api/presentation/tables.d.ts +81 -0
- package/dist/api/presentation/tables.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +367 -7
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/program/areas.d.ts +102 -12
- package/dist/api/program/areas.d.ts.map +1 -1
- package/dist/api/program/cores.d.ts +3 -99
- package/dist/api/program/cores.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +7 -15
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/layout.d.ts +346 -11
- package/dist/api/program/layout.d.ts.map +1 -1
- package/dist/api/program/site.d.ts +469 -13
- package/dist/api/program/site.d.ts.map +1 -1
- package/dist/api/program/spreadsheet.d.ts +365 -41
- package/dist/api/program/spreadsheet.d.ts.map +1 -1
- package/dist/api/workspace/index.d.ts +505 -0
- package/dist/api/workspace/index.d.ts.map +1 -0
- package/dist/errors/codes.d.ts +34 -0
- package/dist/errors/codes.d.ts.map +1 -0
- package/dist/errors/envelope.d.ts +56 -0
- package/dist/errors/envelope.d.ts.map +1 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/plugin-error.d.ts +69 -0
- package/dist/errors/plugin-error.d.ts.map +1 -0
- package/dist/handles.d.ts +97 -25
- package/dist/handles.d.ts.map +1 -1
- package/dist/host-utils.d.ts +4 -0
- package/dist/host-utils.d.ts.map +1 -1
- package/dist/index.cjs +4605 -1423
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4191 -1412
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/scripts/generate-manifest.mjs +45 -0
- package/scripts/generate-manifest.test.mjs +103 -4
- package/src/api/analysis/daylight.ts +470 -0
- package/src/api/analysis/heatmaps.ts +683 -0
- package/src/api/analysis/illuminance.ts +155 -0
- package/src/api/analysis/index.ts +61 -0
- package/src/api/analysis/shadows.ts +183 -0
- package/src/api/analysis/solar.ts +237 -0
- package/src/api/analysis/sunlightHours.ts +211 -0
- package/src/api/analysis/sunpath.ts +83 -0
- package/src/api/analysis/weather.ts +179 -0
- package/src/api/core/camera/index.ts +268 -0
- package/src/api/core/comment/index.ts +120 -2
- package/src/api/core/geom/create/index.ts +912 -1
- package/src/api/core/geom/delete/index.ts +6 -0
- package/src/api/core/geom/query/brep.ts +119 -0
- package/src/api/core/handles/index.ts +233 -0
- package/src/api/core/index.ts +34 -0
- package/src/api/core/io/export/index.ts +126 -0
- package/src/api/core/io/import/index.ts +496 -0
- package/src/api/core/io/index.ts +42 -0
- package/src/api/core/io/job/index.ts +140 -0
- package/src/api/core/io/query/index.ts +71 -0
- package/src/api/core/io/terrain/index.ts +360 -0
- package/src/api/core/io/underlay/index.ts +705 -0
- package/src/api/core/mode/index.ts +96 -0
- package/src/api/core/project/index.ts +62 -1
- package/src/api/core/proposals/index.ts +569 -0
- package/src/api/core/storeys/index.ts +294 -0
- package/src/api/core/tags.ts +27 -0
- package/src/api/core/user.ts +46 -0
- package/src/api/core/zoom/index.ts +4 -0
- package/src/api/design/create/index.ts +670 -30
- package/src/api/design/delete/index.ts +3 -0
- package/src/api/design/doors/index.ts +208 -0
- package/src/api/design/erase/index.ts +1 -1
- package/src/api/design/family.ts +544 -0
- package/src/api/design/furniture/index.ts +197 -8
- package/src/api/design/index.ts +102 -0
- package/src/api/design/lock.ts +27 -0
- package/src/api/design/materials/index.ts +334 -27
- package/src/api/design/query/geometry/index.ts +125 -3
- package/src/api/design/query/index.ts +219 -7
- package/src/api/design/query/referenceLines.ts +52 -0
- package/src/api/design/query/spaces.ts +143 -0
- package/src/api/design/selection/index.ts +129 -0
- package/src/api/design/transform/index.ts +170 -9
- package/src/api/design/types/index.ts +156 -0
- package/src/api/design/update/index.ts +631 -3
- package/src/api/design/visibility.ts +143 -0
- package/src/api/design/windows/index.ts +128 -2
- package/src/api/entity/buildableEnvelope.ts +4 -0
- package/src/api/entity/referenceLine.ts +8 -0
- package/src/api/entity/story.ts +259 -15
- package/src/api/index.ts +10 -0
- package/src/api/presentation/annotate.ts +385 -0
- package/src/api/presentation/diagrams.ts +118 -8
- package/src/api/presentation/export.ts +108 -0
- package/src/api/presentation/import.ts +51 -4
- package/src/api/presentation/index.ts +66 -1
- package/src/api/presentation/placedViews.ts +1120 -0
- package/src/api/presentation/shapes.ts +274 -0
- package/src/api/presentation/sheets.ts +400 -13
- package/src/api/presentation/slideshow.ts +134 -0
- package/src/api/presentation/tables.ts +84 -0
- package/src/api/presentation/views.ts +376 -8
- package/src/api/program/areas.ts +88 -15
- package/src/api/program/cores.ts +3 -91
- package/src/api/program/index.ts +7 -15
- package/src/api/program/layout.ts +365 -11
- package/src/api/program/site.ts +435 -13
- package/src/api/program/spreadsheet.ts +376 -35
- package/src/api/workspace/index.ts +563 -0
- package/src/errors/codes.ts +136 -0
- package/src/errors/envelope.ts +75 -0
- package/src/errors/index.ts +21 -0
- package/src/errors/plugin-error.ts +134 -0
- package/src/handles.ts +123 -13
- package/src/host-utils.ts +4 -0
- package/src/index.ts +1 -0
- package/test/errors.test.mjs +184 -0
- package/tsconfig.json +7 -2
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import * as z from "zod"
|
|
2
|
+
import { PluginApiReturn } from "../../types"
|
|
3
|
+
import { ComponentHandle } from "../../handles"
|
|
4
|
+
import { PluginDesignChangeResult } from "./lock"
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* `snaptrude.design.visibility.*` — hide, isolate, and reveal scene entities.
|
|
8
|
+
*
|
|
9
|
+
* Visibility is a per-component user flag (the same one the "Hide" / "Isolate" /
|
|
10
|
+
* "Show All" toolbar and right-click actions toggle). Every method here commits
|
|
11
|
+
* an undoable command and echoes the affected entities as
|
|
12
|
+
* {@linkcode PluginDesignChangeResult}.
|
|
13
|
+
*
|
|
14
|
+
* Accessed via `snaptrude.design.visibility`.
|
|
15
|
+
*/
|
|
16
|
+
export abstract class PluginDesignVisibilityApi {
|
|
17
|
+
constructor() {}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Hide entities from the viewport — the same as the "Hide" action. Undoable.
|
|
21
|
+
* Hosted door/window/void children ride along with their wall. Already-hidden
|
|
22
|
+
* entities stay hidden.
|
|
23
|
+
*
|
|
24
|
+
* @param components Entities to hide
|
|
25
|
+
* @returns The affected entities (echoing the input handles)
|
|
26
|
+
*
|
|
27
|
+
* @examplePrompt Hide the selected walls
|
|
28
|
+
* @examplePrompt Conceal these masses so I can see behind them
|
|
29
|
+
* @examplePrompt Hide every column on this floor
|
|
30
|
+
* @examplePrompt Make this furniture disappear from view
|
|
31
|
+
*
|
|
32
|
+
* # Example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const walls = await snaptrude.design.query.listWalls({ storeys: [1] })
|
|
35
|
+
* const { affected } = await snaptrude.design.visibility.hide(walls)
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
public abstract hide(
|
|
39
|
+
components: ComponentHandle[],
|
|
40
|
+
): PluginApiReturn<PluginDesignChangeResult>
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Reveal specific hidden components — the inverse of
|
|
44
|
+
* {@linkcode PluginDesignVisibilityApi.hide}. Use
|
|
45
|
+
* {@linkcode PluginDesignVisibilityApi.showAll} to reveal everything.
|
|
46
|
+
*
|
|
47
|
+
* @param components - The components to reveal.
|
|
48
|
+
* @returns A {@linkcode PluginDesignChangeResult} echoing the components shown.
|
|
49
|
+
*
|
|
50
|
+
* @examplePrompt Show these walls again
|
|
51
|
+
* @examplePrompt Unhide the selected furniture
|
|
52
|
+
*
|
|
53
|
+
* # Example
|
|
54
|
+
* ```ts
|
|
55
|
+
* await snaptrude.design.visibility.show([wall])
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
public abstract show(
|
|
59
|
+
components: ComponentHandle[],
|
|
60
|
+
): PluginApiReturn<PluginDesignChangeResult>
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Isolate entities — hide everything else so only the given entities remain
|
|
64
|
+
* visible (the "Isolate" / solo action). Undoable. Reverse it with
|
|
65
|
+
* {@linkcode PluginDesignVisibilityApi.showAll}.
|
|
66
|
+
*
|
|
67
|
+
* @param components Entities to keep visible; everything else is hidden
|
|
68
|
+
* @returns The isolated entities (echoing the input handles)
|
|
69
|
+
*
|
|
70
|
+
* @examplePrompt Isolate the selected room so I can focus on it
|
|
71
|
+
* @examplePrompt Show only these walls and hide the rest
|
|
72
|
+
* @examplePrompt Solo this mass
|
|
73
|
+
* @examplePrompt Hide everything except the staircase
|
|
74
|
+
*
|
|
75
|
+
* # Example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const [room] = await snaptrude.design.selection.get()
|
|
78
|
+
* await snaptrude.design.visibility.isolate([room])
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
public abstract isolate(
|
|
82
|
+
components: ComponentHandle[],
|
|
83
|
+
): PluginApiReturn<PluginDesignChangeResult>
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* Reveal everything hidden on the active story — the "Show All" action, which
|
|
87
|
+
* also exits an isolate. Undoable.
|
|
88
|
+
*
|
|
89
|
+
* @returns The entities that were made visible
|
|
90
|
+
*
|
|
91
|
+
* @examplePrompt Show everything again
|
|
92
|
+
* @examplePrompt Unhide all the hidden objects
|
|
93
|
+
* @examplePrompt Exit isolate mode
|
|
94
|
+
* @examplePrompt Reveal everything I hid earlier
|
|
95
|
+
*
|
|
96
|
+
* # Example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const { affected } = await snaptrude.design.visibility.showAll()
|
|
99
|
+
* console.log(`Revealed ${affected.length} entities`)
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
public abstract showAll(): PluginApiReturn<PluginDesignChangeResult>
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Arguments for {@linkcode PluginDesignVisibilityApi.hide}.
|
|
107
|
+
*
|
|
108
|
+
* | Property | Type | Description |
|
|
109
|
+
* |---|---|---|
|
|
110
|
+
* | `components` | {@linkcode ComponentHandle}`[]` | Entities to hide |
|
|
111
|
+
*/
|
|
112
|
+
export const PluginDesignVisibilityHideArgs = z.object({
|
|
113
|
+
components: z.array(ComponentHandle),
|
|
114
|
+
})
|
|
115
|
+
export type PluginDesignVisibilityHideArgs = z.infer<typeof PluginDesignVisibilityHideArgs>
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Arguments for {@linkcode PluginDesignVisibilityApi.show}.
|
|
119
|
+
*
|
|
120
|
+
* | Property | Type | Description |
|
|
121
|
+
* |---|---|---|
|
|
122
|
+
* | `components` | {@linkcode ComponentHandle}`[]` | Entities to reveal |
|
|
123
|
+
*/
|
|
124
|
+
export const PluginDesignVisibilityShowArgs = z.object({
|
|
125
|
+
components: z.array(ComponentHandle),
|
|
126
|
+
})
|
|
127
|
+
export type PluginDesignVisibilityShowArgs = z.infer<
|
|
128
|
+
typeof PluginDesignVisibilityShowArgs
|
|
129
|
+
>
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Arguments for {@linkcode PluginDesignVisibilityApi.isolate}.
|
|
133
|
+
*
|
|
134
|
+
* | Property | Type | Description |
|
|
135
|
+
* |---|---|---|
|
|
136
|
+
* | `components` | {@linkcode ComponentHandle}`[]` | Entities to keep visible |
|
|
137
|
+
*/
|
|
138
|
+
export const PluginDesignVisibilityIsolateArgs = z.object({
|
|
139
|
+
components: z.array(ComponentHandle),
|
|
140
|
+
})
|
|
141
|
+
export type PluginDesignVisibilityIsolateArgs = z.infer<
|
|
142
|
+
typeof PluginDesignVisibilityIsolateArgs
|
|
143
|
+
>
|
|
@@ -2,14 +2,21 @@ import * as z from "zod"
|
|
|
2
2
|
import { PluginApiReturn } from "../../../types"
|
|
3
3
|
import { ComponentHandle } from "../../../handles"
|
|
4
4
|
import { PluginDesignChangeResult } from "../lock"
|
|
5
|
+
import { PluginObjectCatalogGroup, PluginObjectCatalogItem } from "../doors"
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* `snaptrude.design.windows` — window-specific reads. Creation lives at
|
|
8
9
|
* `design.create.window`; generic reads (`listWindows`/`getHost`/`getProperties`) live
|
|
9
10
|
* at `design.query.*`. Window targets are {@linkcode ComponentHandle}s.
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
12
|
+
* The **catalog** reads (`listCatalogGroups`/`listCatalog`/`getCatalogItem`/`exists`)
|
|
13
|
+
* browse the placeable window library — plain value records keyed by a library id
|
|
14
|
+
* (team `_id` or general `fullName`), NOT handles — and feed `design.create.window`.
|
|
15
|
+
* They are network-backed but carry no `Async` suffix (§6.6) and never throw
|
|
16
|
+
* (`[]`/`null`). The {@linkcode PluginObjectCatalogGroup} / {@linkcode PluginObjectCatalogItem}
|
|
17
|
+
* DTOs are shared with `design.doors` (defined there, re-exported here).
|
|
18
|
+
*
|
|
19
|
+
* `getSillHeight` (bounds-derived) and the command-wired `mirror` land in a later pass.
|
|
13
20
|
*/
|
|
14
21
|
export abstract class PluginDesignWindowsApi {
|
|
15
22
|
constructor() {}
|
|
@@ -148,6 +155,91 @@ export abstract class PluginDesignWindowsApi {
|
|
|
148
155
|
window: ComponentHandle,
|
|
149
156
|
height: number
|
|
150
157
|
): PluginApiReturn<PluginDesignChangeResult>
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* List the window catalog **groups** — the placement families (Fixed,
|
|
161
|
+
* Casement, Sliding, Folding, …), built-in groups merged with any
|
|
162
|
+
* team-custom types.
|
|
163
|
+
*
|
|
164
|
+
* @returns The groups as {@linkcode PluginObjectCatalogGroup}`[]` (`[]` when empty)
|
|
165
|
+
*
|
|
166
|
+
* @examplePrompt What kinds of windows can I place?
|
|
167
|
+
* @examplePrompt List the window groups in the catalog
|
|
168
|
+
* @examplePrompt Show me the window families available in this project
|
|
169
|
+
* @examplePrompt Which window types does this project support?
|
|
170
|
+
*
|
|
171
|
+
* # Example
|
|
172
|
+
* ```ts
|
|
173
|
+
* const groups = await snaptrude.design.windows.listCatalogGroups()
|
|
174
|
+
* for (const g of groups) console.log(g.dbType, g.label, g.source)
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
public abstract listCatalogGroups(): PluginApiReturn<PluginObjectCatalogGroup[]>
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* List the placeable window catalog (team + general libraries), optionally
|
|
181
|
+
* restricted to one group by its `dbType` token.
|
|
182
|
+
*
|
|
183
|
+
* @param group Restrict to one group's `dbType` (optional; e.g. `"casementDouble"`)
|
|
184
|
+
* @returns The catalog as {@linkcode PluginObjectCatalogItem}`[]` (`[]` when empty)
|
|
185
|
+
*
|
|
186
|
+
* @examplePrompt What windows can I place in this project?
|
|
187
|
+
* @examplePrompt List every window in the library
|
|
188
|
+
* @examplePrompt Show me the casement windows I can add
|
|
189
|
+
* @examplePrompt Browse the window catalog
|
|
190
|
+
*
|
|
191
|
+
* # Example
|
|
192
|
+
* ```ts
|
|
193
|
+
* const [group] = await snaptrude.design.windows.listCatalogGroups()
|
|
194
|
+
* const items = await snaptrude.design.windows.listCatalog(group?.dbType)
|
|
195
|
+
* for (const item of items) console.log(item.id, item.name, item.thumbnailUrl)
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
public abstract listCatalog(
|
|
199
|
+
group?: string
|
|
200
|
+
): PluginApiReturn<PluginObjectCatalogItem[]>
|
|
201
|
+
|
|
202
|
+
/**
|
|
203
|
+
* Get a single window catalog item by its library id.
|
|
204
|
+
*
|
|
205
|
+
* @param id The catalog library id
|
|
206
|
+
* @returns The item, or `null` if no catalog item matches
|
|
207
|
+
*
|
|
208
|
+
* @examplePrompt Get the details of this window from the library
|
|
209
|
+
* @examplePrompt Look up the catalog entry for this window id
|
|
210
|
+
* @examplePrompt What is the cost of this window item?
|
|
211
|
+
* @examplePrompt Show me the family name of this window in the catalog
|
|
212
|
+
*
|
|
213
|
+
* # Example
|
|
214
|
+
* ```ts
|
|
215
|
+
* const [entry] = await snaptrude.design.windows.listCatalog()
|
|
216
|
+
* const item = await snaptrude.design.windows.getCatalogItem(entry.id)
|
|
217
|
+
* if (item) console.log(item.name, item.source, item.dbType)
|
|
218
|
+
* ```
|
|
219
|
+
*/
|
|
220
|
+
public abstract getCatalogItem(
|
|
221
|
+
id: string
|
|
222
|
+
): PluginApiReturn<PluginObjectCatalogItem | null>
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Test whether a window catalog item exists for the given library id.
|
|
226
|
+
*
|
|
227
|
+
* @param id The catalog library id
|
|
228
|
+
* @returns `true` if it exists, otherwise `false`
|
|
229
|
+
*
|
|
230
|
+
* @examplePrompt Is this window still in the library?
|
|
231
|
+
* @examplePrompt Check whether a window catalog item with this id exists
|
|
232
|
+
* @examplePrompt Does my team library have this window?
|
|
233
|
+
* @examplePrompt Verify the window is available before placing it
|
|
234
|
+
*
|
|
235
|
+
* # Example
|
|
236
|
+
* ```ts
|
|
237
|
+
* const [entry] = await snaptrude.design.windows.listCatalog()
|
|
238
|
+
* const stillAvailable = await snaptrude.design.windows.exists(entry.id)
|
|
239
|
+
* console.log(stillAvailable ? "safe to place" : "removed from library")
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
public abstract exists(id: string): PluginApiReturn<boolean>
|
|
151
243
|
}
|
|
152
244
|
|
|
153
245
|
/**
|
|
@@ -205,3 +297,37 @@ export const PluginDesignWindowSetHeightArgs = z.object({
|
|
|
205
297
|
height: z.number(),
|
|
206
298
|
})
|
|
207
299
|
export type PluginDesignWindowSetHeightArgs = z.infer<typeof PluginDesignWindowSetHeightArgs>
|
|
300
|
+
|
|
301
|
+
// ---------------------------------------------------------------------------
|
|
302
|
+
// catalog (shared DTOs defined in ../doors, re-exported here for symmetry)
|
|
303
|
+
// ---------------------------------------------------------------------------
|
|
304
|
+
|
|
305
|
+
// Re-export the shared catalog DTOs imported at the top of this file.
|
|
306
|
+
export { PluginObjectCatalogGroup, PluginObjectCatalogItem }
|
|
307
|
+
|
|
308
|
+
/**
|
|
309
|
+
* Arguments for {@linkcode PluginDesignWindowsApi.listCatalog}.
|
|
310
|
+
*
|
|
311
|
+
* | Property | Type | Description |
|
|
312
|
+
* |---|---|---|
|
|
313
|
+
* | `group` | `string`? | Restrict to one group's `dbType` token (optional) |
|
|
314
|
+
*/
|
|
315
|
+
export const PluginDesignWindowListCatalogArgs = z.object({
|
|
316
|
+
group: z.string().optional(),
|
|
317
|
+
})
|
|
318
|
+
export type PluginDesignWindowListCatalogArgs = z.infer<typeof PluginDesignWindowListCatalogArgs>
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Arguments for {@linkcode PluginDesignWindowsApi.getCatalogItem} / {@linkcode PluginDesignWindowsApi.exists}.
|
|
322
|
+
*
|
|
323
|
+
* | Property | Type | Description |
|
|
324
|
+
* |---|---|---|
|
|
325
|
+
* | `id` | `string` | The catalog library id |
|
|
326
|
+
*/
|
|
327
|
+
export const PluginDesignWindowGetCatalogItemArgs = z.object({
|
|
328
|
+
id: z.string(),
|
|
329
|
+
})
|
|
330
|
+
export type PluginDesignWindowGetCatalogItemArgs = z.infer<typeof PluginDesignWindowGetCatalogItemArgs>
|
|
331
|
+
|
|
332
|
+
export const PluginDesignWindowExistsArgs = PluginDesignWindowGetCatalogItemArgs
|
|
333
|
+
export type PluginDesignWindowExistsArgs = z.infer<typeof PluginDesignWindowExistsArgs>
|
|
@@ -54,6 +54,8 @@ export abstract class PluginBuildableEnvelopeApi {
|
|
|
54
54
|
* 12,
|
|
55
55
|
* )
|
|
56
56
|
* ```
|
|
57
|
+
*
|
|
58
|
+
* @deprecated Use `design.create.buildableEnvelope`
|
|
57
59
|
*/
|
|
58
60
|
public abstract create(
|
|
59
61
|
sitePolygon: PluginBuildableEnvelopePolygonVertex[],
|
|
@@ -106,6 +108,8 @@ export abstract class PluginBuildableEnvelopeApi {
|
|
|
106
108
|
* 12,
|
|
107
109
|
* )
|
|
108
110
|
* ```
|
|
111
|
+
*
|
|
112
|
+
* @deprecated Use `design.update.buildableEnvelope`
|
|
109
113
|
*/
|
|
110
114
|
public abstract update(
|
|
111
115
|
buildableEnvelopeId: string,
|
|
@@ -49,6 +49,8 @@ export abstract class PluginReferenceLineApi {
|
|
|
49
49
|
*
|
|
50
50
|
* const { referenceLineIds } = await snaptrude.entity.referenceLine.createMulti(profile)
|
|
51
51
|
* ```
|
|
52
|
+
*
|
|
53
|
+
* @deprecated Use `design.create.referenceLines`
|
|
52
54
|
*/
|
|
53
55
|
public abstract createMulti(
|
|
54
56
|
profile: ProfileHandle
|
|
@@ -78,6 +80,8 @@ export abstract class PluginReferenceLineApi {
|
|
|
78
80
|
* // result.curve is an opaque CurveHandle; a dedicated curve read API for its
|
|
79
81
|
* // coordinates is exposed separately via `snaptrude.core.geom.curve`.
|
|
80
82
|
* ```
|
|
83
|
+
*
|
|
84
|
+
* @deprecated Use `design.query.referenceLines.get`
|
|
81
85
|
*/
|
|
82
86
|
public abstract get(
|
|
83
87
|
referenceLineId: string,
|
|
@@ -104,6 +108,8 @@ export abstract class PluginReferenceLineApi {
|
|
|
104
108
|
* const { referenceLineIds } = await snaptrude.entity.referenceLine.getAll()
|
|
105
109
|
* console.log(`Project has ${referenceLineIds.length} reference lines`)
|
|
106
110
|
* ```
|
|
111
|
+
*
|
|
112
|
+
* @deprecated Use `design.query.listReferenceLines`
|
|
107
113
|
*/
|
|
108
114
|
public abstract getAll(): PluginApiReturn<PluginReferenceLineGetAllResult>
|
|
109
115
|
|
|
@@ -125,6 +131,8 @@ export abstract class PluginReferenceLineApi {
|
|
|
125
131
|
* ```ts
|
|
126
132
|
* await snaptrude.entity.referenceLine.delete("some-ref-line-id")
|
|
127
133
|
* ```
|
|
134
|
+
*
|
|
135
|
+
* @deprecated Use `design.delete.entities`
|
|
128
136
|
*/
|
|
129
137
|
public abstract delete(
|
|
130
138
|
referenceLineId: string
|