@snaptrude/plugin-core 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +73 -0
- package/api-manifest.full.json +2644 -542
- package/api-manifest.json +2606 -424
- package/dist/api/analysis/heatmaps.d.ts +234 -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 +44 -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/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/core/index.d.ts +10 -0
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/import/index.d.ts +392 -0
- package/dist/api/core/io/import/index.d.ts.map +1 -0
- package/dist/api/core/io/index.d.ts +35 -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 +206 -0
- package/dist/api/core/io/terrain/index.d.ts.map +1 -0
- package/dist/api/core/io/underlay/index.d.ts +286 -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/proposals/index.d.ts +475 -0
- package/dist/api/core/proposals/index.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +218 -0
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +159 -0
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/furniture/index.d.ts +34 -5
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +83 -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 +159 -2
- package/dist/api/design/materials/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +115 -5
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/spaces.d.ts +3 -3
- 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 +83 -2
- package/dist/api/design/transform/index.d.ts.map +1 -1
- package/dist/api/design/update/index.d.ts +168 -0
- package/dist/api/design/update/index.d.ts.map +1 -1
- 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/space.d.ts +2 -2
- package/dist/api/entity/story.d.ts +101 -7
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +5 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/presentation/import.d.ts +49 -4
- package/dist/api/presentation/import.d.ts.map +1 -1
- package/dist/api/presentation/views.d.ts +210 -5
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/program/areas.d.ts +42 -12
- package/dist/api/program/areas.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +3 -11
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/layout.d.ts +186 -11
- package/dist/api/program/layout.d.ts.map +1 -1
- package/dist/api/program/site.d.ts +84 -0
- package/dist/api/program/site.d.ts.map +1 -1
- 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 +33 -0
- 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 +1942 -998
- 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 +1810 -994
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/scripts/generate-manifest.test.mjs +103 -4
- package/src/api/analysis/heatmaps.ts +256 -0
- package/src/api/analysis/illuminance.ts +155 -0
- package/src/api/analysis/index.ts +46 -0
- package/src/api/analysis/shadows.ts +183 -0
- package/src/api/analysis/sunlightHours.ts +211 -0
- package/src/api/analysis/sunpath.ts +83 -0
- package/src/api/core/index.ts +10 -0
- package/src/api/core/io/import/index.ts +432 -0
- package/src/api/core/io/index.ts +37 -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 +214 -0
- package/src/api/core/io/underlay/index.ts +295 -0
- package/src/api/core/proposals/index.ts +509 -0
- package/src/api/design/create/index.ts +258 -0
- package/src/api/design/doors/index.ts +168 -0
- package/src/api/design/erase/index.ts +1 -1
- package/src/api/design/furniture/index.ts +36 -5
- package/src/api/design/index.ts +87 -0
- package/src/api/design/lock.ts +27 -0
- package/src/api/design/materials/index.ts +182 -2
- package/src/api/design/query/index.ts +81 -0
- package/src/api/design/selection/index.ts +129 -0
- package/src/api/design/transform/index.ts +74 -2
- package/src/api/design/update/index.ts +167 -0
- package/src/api/design/windows/index.ts +128 -2
- package/src/api/entity/story.ts +105 -7
- package/src/api/index.ts +5 -0
- package/src/api/presentation/import.ts +45 -4
- package/src/api/presentation/views.ts +221 -5
- package/src/api/program/areas.ts +34 -12
- package/src/api/program/index.ts +3 -11
- package/src/api/program/layout.ts +195 -11
- package/src/api/program/site.ts +93 -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 +46 -0
- package/src/host-utils.ts +4 -0
- package/src/index.ts +1 -0
- package/test/errors.test.mjs +184 -0
|
@@ -2,6 +2,109 @@ import * as z from "zod";
|
|
|
2
2
|
import { PluginApiReturn } from "../../../types";
|
|
3
3
|
import { ComponentHandle } from "../../../handles";
|
|
4
4
|
import { PluginDesignChangeResult } from "../lock";
|
|
5
|
+
/**
|
|
6
|
+
* The entity kinds {@linkcode PluginDesignSelectionApi.setByFilter} can select —
|
|
7
|
+
* the union of the editor's "Filter selection" menus (Design tab + BIM tab).
|
|
8
|
+
* Tokens mirror {@linkcode PluginEntityType} where a kind exists on the query
|
|
9
|
+
* surface; the rest are selection-only kinds the query surface cannot reach
|
|
10
|
+
* (layer-backed and annotation objects).
|
|
11
|
+
*
|
|
12
|
+
* | Value | Entity (menu label) |
|
|
13
|
+
* |---|---|
|
|
14
|
+
* | `"wall"` | Wall |
|
|
15
|
+
* | `"slab"` | Floor slab |
|
|
16
|
+
* | `"floor"` | Flooring |
|
|
17
|
+
* | `"door"` | Door |
|
|
18
|
+
* | `"window"` | Window |
|
|
19
|
+
* | `"beam"` | Beam |
|
|
20
|
+
* | `"column"` | Column |
|
|
21
|
+
* | `"ceiling"` | Ceiling |
|
|
22
|
+
* | `"roof"` | Roof |
|
|
23
|
+
* | `"staircase"` | Staircase |
|
|
24
|
+
* | `"furniture"` | Furniture |
|
|
25
|
+
* | `"pergola"` | Pergola |
|
|
26
|
+
* | `"sunshade"` | Sunshade |
|
|
27
|
+
* | `"referenceLine"` | Reference line |
|
|
28
|
+
* | `"space"` | Space (room mass) |
|
|
29
|
+
* | `"site"` | Site |
|
|
30
|
+
* | `"terrain"` | Terrain |
|
|
31
|
+
* | `"cad"` | CAD import |
|
|
32
|
+
* | `"pdf"` | PDF import |
|
|
33
|
+
* | `"image"` | Image import |
|
|
34
|
+
* | `"dimensionLine"` | Dimension line |
|
|
35
|
+
* | `"model3d"` | Imported 3D model |
|
|
36
|
+
* | `"neighborhoodBuilding"` | Neighborhood building |
|
|
37
|
+
* | `"programBlock"` | Program block (department mass) |
|
|
38
|
+
*/
|
|
39
|
+
export declare const PluginSelectionEntityType: z.ZodEnum<{
|
|
40
|
+
terrain: "terrain";
|
|
41
|
+
floor: "floor";
|
|
42
|
+
wall: "wall";
|
|
43
|
+
ceiling: "ceiling";
|
|
44
|
+
image: "image";
|
|
45
|
+
cad: "cad";
|
|
46
|
+
pdf: "pdf";
|
|
47
|
+
furniture: "furniture";
|
|
48
|
+
space: "space";
|
|
49
|
+
door: "door";
|
|
50
|
+
window: "window";
|
|
51
|
+
slab: "slab";
|
|
52
|
+
roof: "roof";
|
|
53
|
+
column: "column";
|
|
54
|
+
beam: "beam";
|
|
55
|
+
staircase: "staircase";
|
|
56
|
+
referenceLine: "referenceLine";
|
|
57
|
+
pergola: "pergola";
|
|
58
|
+
sunshade: "sunshade";
|
|
59
|
+
site: "site";
|
|
60
|
+
dimensionLine: "dimensionLine";
|
|
61
|
+
model3d: "model3d";
|
|
62
|
+
neighborhoodBuilding: "neighborhoodBuilding";
|
|
63
|
+
programBlock: "programBlock";
|
|
64
|
+
}>;
|
|
65
|
+
export type PluginSelectionEntityType = z.infer<typeof PluginSelectionEntityType>;
|
|
66
|
+
/**
|
|
67
|
+
* The filter for {@linkcode PluginDesignSelectionApi.setByFilter}. At least one
|
|
68
|
+
* field must be non-empty (to empty the selection use
|
|
69
|
+
* {@linkcode PluginDesignSelectionApi.clear}). Fields **AND**-combine; values
|
|
70
|
+
* within a field **OR**-combine — `{ storeys: [2], types: ["furniture"] }`
|
|
71
|
+
* selects only the furniture on storey 2.
|
|
72
|
+
*
|
|
73
|
+
* | Field | Type | Selects entities where |
|
|
74
|
+
* |---|---|---|
|
|
75
|
+
* | `storeys` | `number[]` | storey/floor level ∈ `storeys` (negative = basement) |
|
|
76
|
+
* | `types` | {@linkcode PluginSelectionEntityType}`[]` | entity kind ∈ `types` |
|
|
77
|
+
*/
|
|
78
|
+
export declare const PluginSelectionFilter: z.ZodObject<{
|
|
79
|
+
storeys: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
80
|
+
types: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
81
|
+
terrain: "terrain";
|
|
82
|
+
floor: "floor";
|
|
83
|
+
wall: "wall";
|
|
84
|
+
ceiling: "ceiling";
|
|
85
|
+
image: "image";
|
|
86
|
+
cad: "cad";
|
|
87
|
+
pdf: "pdf";
|
|
88
|
+
furniture: "furniture";
|
|
89
|
+
space: "space";
|
|
90
|
+
door: "door";
|
|
91
|
+
window: "window";
|
|
92
|
+
slab: "slab";
|
|
93
|
+
roof: "roof";
|
|
94
|
+
column: "column";
|
|
95
|
+
beam: "beam";
|
|
96
|
+
staircase: "staircase";
|
|
97
|
+
referenceLine: "referenceLine";
|
|
98
|
+
pergola: "pergola";
|
|
99
|
+
sunshade: "sunshade";
|
|
100
|
+
site: "site";
|
|
101
|
+
dimensionLine: "dimensionLine";
|
|
102
|
+
model3d: "model3d";
|
|
103
|
+
neighborhoodBuilding: "neighborhoodBuilding";
|
|
104
|
+
programBlock: "programBlock";
|
|
105
|
+
}>>>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
export type PluginSelectionFilter = z.infer<typeof PluginSelectionFilter>;
|
|
5
108
|
/**
|
|
6
109
|
* `snaptrude.design.selection` — read and mutate the current scene selection.
|
|
7
110
|
*
|
|
@@ -115,6 +218,47 @@ export declare abstract class PluginDesignSelectionApi {
|
|
|
115
218
|
* ```
|
|
116
219
|
*/
|
|
117
220
|
abstract clear(): PluginApiReturn<PluginDesignChangeResult>;
|
|
221
|
+
/**
|
|
222
|
+
* Replace the selection with every visible entity of the active building that
|
|
223
|
+
* matches the filter — the programmatic equivalent of the editor's
|
|
224
|
+
* **Story selection** (`storeys`) and **Filter selection** (`types`) menus
|
|
225
|
+
* under the select tool, including their combination (fields AND, values
|
|
226
|
+
* within a field OR). Reaches selection-only kinds the query surface cannot
|
|
227
|
+
* (sites, terrain, CAD/PDF/image imports, dimension lines, 3D models,
|
|
228
|
+
* neighborhood buildings) and selects whole groups the way the editor does.
|
|
229
|
+
*
|
|
230
|
+
* This is a one-shot bulk select, not a persistent mode: the user's next
|
|
231
|
+
* canvas click resets the underlying filter state (the selection it made
|
|
232
|
+
* stays until changed). Results honor the ambient view — active building,
|
|
233
|
+
* hidden objects/buckets, and in 2D the active storey.
|
|
234
|
+
*
|
|
235
|
+
* @param filter Which entities to select — {@linkcode PluginSelectionFilter};
|
|
236
|
+
* at least one field must be non-empty
|
|
237
|
+
* @returns The resulting selection snapshot
|
|
238
|
+
*
|
|
239
|
+
* @examplePrompt Select everything on storey 2
|
|
240
|
+
* @examplePrompt Select all the walls and doors
|
|
241
|
+
* @examplePrompt Story selection: select the ground floor and first floor
|
|
242
|
+
* @examplePrompt Filter selection: select all furniture in the model
|
|
243
|
+
* @examplePrompt Select only the furniture on the second storey
|
|
244
|
+
* @examplePrompt Select all the spaces so I can recolor them
|
|
245
|
+
*
|
|
246
|
+
* # Example
|
|
247
|
+
* ```ts
|
|
248
|
+
* // "Story selection": everything on storeys 1 and 2
|
|
249
|
+
* await snaptrude.design.selection.setByFilter({ storeys: [1, 2] })
|
|
250
|
+
*
|
|
251
|
+
* // "Filter selection": all walls and doors
|
|
252
|
+
* await snaptrude.design.selection.setByFilter({ types: ["wall", "door"] })
|
|
253
|
+
*
|
|
254
|
+
* // Combined: only the furniture on storey 2
|
|
255
|
+
* const { affected } = await snaptrude.design.selection.setByFilter({
|
|
256
|
+
* storeys: [2],
|
|
257
|
+
* types: ["furniture"],
|
|
258
|
+
* })
|
|
259
|
+
* ```
|
|
260
|
+
*/
|
|
261
|
+
abstract setByFilter(filter: PluginSelectionFilter): PluginApiReturn<PluginDesignChangeResult>;
|
|
118
262
|
}
|
|
119
263
|
/**
|
|
120
264
|
* Arguments for {@linkcode PluginDesignSelectionApi.set}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/selection/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;;;;;;;;GAQG;AACH,8BAAsB,wBAAwB;;IAG5C;;;;;;;;;;;;;;;;;;;;;OAqBG;aACa,GAAG,IAAI,eAAe,CAAC,eAAe,EAAE,CAAC;IAEzD;;;;;;;;;;;;;;;;;;;OAmBG;aACa,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,eAAe,CAAC,wBAAwB,CAAC;IAE7F;;;;;;;;;;;;;;;;;;;OAmBG;aACa,GAAG,CAAC,UAAU,EAAE,eAAe,EAAE,GAAG,eAAe,CAAC,wBAAwB,CAAC;IAE7F;;;;;;;;;;;;;;;;;;OAkBG;aACa,MAAM,CACpB,UAAU,EAAE,eAAe,EAAE,GAC5B,eAAe,CAAC,wBAAwB,CAAC;IAE5C;;;;;;;;;;;;;;;OAeG;aACa,KAAK,IAAI,eAAe,CAAC,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/selection/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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;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vF,eAAO,MAAM,+BAA+B;;iBAA+B,CAAA;AAC3E,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA"}
|
|
@@ -5,8 +5,10 @@ import { PluginDesignChangeResult } from "../lock";
|
|
|
5
5
|
/**
|
|
6
6
|
* `snaptrude.design.transform` — rigid transforms on scene entities.
|
|
7
7
|
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* `move` / `rotate` migrated from the removed `tools.transform.*`; `align` snaps a
|
|
9
|
+
* set of components' bounding-box edges to each other (or to a reference). All ops
|
|
10
|
+
* are undoable and return {@linkcode PluginDesignChangeResult} `{ affected }`;
|
|
11
|
+
* failures throw (RPC rejects).
|
|
10
12
|
*
|
|
11
13
|
* `mirror` / `getPosition` / `setPosition` (and `scale`, an engine gap) are NOT in
|
|
12
14
|
* this surface yet — they are a later, non-migration pass.
|
|
@@ -63,7 +65,64 @@ export declare abstract class PluginDesignTransformApi {
|
|
|
63
65
|
axis?: Vec3Handle;
|
|
64
66
|
is2D?: boolean;
|
|
65
67
|
}): PluginApiReturn<PluginDesignChangeResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Align a set of components by snapping one bounding-box edge to a common value
|
|
70
|
+
* — the classic Left/Center/Right/Top/Middle/Bottom align. Purely **world-axis**
|
|
71
|
+
* (deterministic and headless — the UI's camera-relative remap is bypassed):
|
|
72
|
+
*
|
|
73
|
+
* - `left` / `right` / `center` → world **X** min / max / mid
|
|
74
|
+
* - `top` / `bottom` / `middle` → world **Z** max / min / mid
|
|
75
|
+
*
|
|
76
|
+
* There is **no vertical (Y) alignment** in v1 (the UI only reaches it via a
|
|
77
|
+
* side-elevation camera remap, which this API does not replicate). Doors and
|
|
78
|
+
* windows are **rejected** in v1 — if any component in `components` (or the
|
|
79
|
+
* `reference`) is a door or window, the whole call **throws**; nothing is
|
|
80
|
+
* silently dropped. A group aligns as **one rigid body** (its whole-group
|
|
81
|
+
* bounding box moves together). Undoable.
|
|
82
|
+
*
|
|
83
|
+
* Requires **at least 2 components** unless a `reference` is supplied; with a
|
|
84
|
+
* reference, every component aligns to that reference's edge (the reference does
|
|
85
|
+
* not move) and a single component is allowed. Y (height) is preserved.
|
|
86
|
+
*
|
|
87
|
+
* @param components - Entities to align (≥2 without a `reference`)
|
|
88
|
+
* @param edge - Which bounding-box edge to snap ({@linkcode PluginAlignEdge})
|
|
89
|
+
* @param options - `reference`: a component whose edge is the fixed target
|
|
90
|
+
* @returns {@linkcode PluginDesignChangeResult}
|
|
91
|
+
*
|
|
92
|
+
* @examplePrompt Align the selected rooms to the left
|
|
93
|
+
* @examplePrompt Line up these masses along their top edges
|
|
94
|
+
* @examplePrompt Center these columns horizontally
|
|
95
|
+
* @examplePrompt Align all the walls to the left edge of this reference wall
|
|
96
|
+
* @examplePrompt Snap the bottom edges of these spaces together
|
|
97
|
+
*
|
|
98
|
+
* # Example
|
|
99
|
+
* ```ts
|
|
100
|
+
* const rooms = await snaptrude.design.selection.get()
|
|
101
|
+
* // align every room's left (world -X) edge to a common minimum
|
|
102
|
+
* await snaptrude.design.transform.align(rooms, "left")
|
|
103
|
+
* // …or align them to a fixed reference component's left edge
|
|
104
|
+
* const [anchor] = await snaptrude.design.query.listWalls({ storeys: [1] })
|
|
105
|
+
* await snaptrude.design.transform.align(rooms, "left", { reference: anchor })
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
abstract align(components: ComponentHandle[], edge: PluginAlignEdge, options?: {
|
|
109
|
+
reference?: ComponentHandle;
|
|
110
|
+
}): PluginApiReturn<PluginDesignChangeResult>;
|
|
66
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* The bounding-box edge an {@linkcode PluginDesignTransformApi.align} snaps to.
|
|
114
|
+
* Mirrors the engine's align `DirectionType`. World-axis mapping: `left`/`right`/`center`
|
|
115
|
+
* → world X min/max/mid; `top`/`bottom`/`middle` → world Z max/min/mid.
|
|
116
|
+
*/
|
|
117
|
+
export declare const PluginAlignEdge: z.ZodEnum<{
|
|
118
|
+
center: "center";
|
|
119
|
+
left: "left";
|
|
120
|
+
right: "right";
|
|
121
|
+
top: "top";
|
|
122
|
+
bottom: "bottom";
|
|
123
|
+
middle: "middle";
|
|
124
|
+
}>;
|
|
125
|
+
export type PluginAlignEdge = z.infer<typeof PluginAlignEdge>;
|
|
67
126
|
/**
|
|
68
127
|
* Arguments for {@linkcode PluginDesignTransformApi.move} (options flattened).
|
|
69
128
|
*/
|
|
@@ -84,4 +143,26 @@ export declare const PluginDesignRotateArgs: z.ZodObject<{
|
|
|
84
143
|
is2D: z.ZodOptional<z.ZodBoolean>;
|
|
85
144
|
}, z.core.$strip>;
|
|
86
145
|
export type PluginDesignRotateArgs = z.infer<typeof PluginDesignRotateArgs>;
|
|
146
|
+
/**
|
|
147
|
+
* Arguments for {@linkcode PluginDesignTransformApi.align} (options flattened).
|
|
148
|
+
*
|
|
149
|
+
* | Property | Type | Description |
|
|
150
|
+
* |---|---|---|
|
|
151
|
+
* | `components` | {@linkcode ComponentHandle}`[]` | Entities to align (≥2 unless `reference` is set — host-enforced) |
|
|
152
|
+
* | `edge` | {@linkcode PluginAlignEdge} | Which bounding-box edge to snap |
|
|
153
|
+
* | `reference` | {@linkcode ComponentHandle} | A fixed component whose edge is the target (optional) |
|
|
154
|
+
*/
|
|
155
|
+
export declare const PluginDesignAlignArgs: z.ZodObject<{
|
|
156
|
+
components: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
157
|
+
edge: z.ZodEnum<{
|
|
158
|
+
center: "center";
|
|
159
|
+
left: "left";
|
|
160
|
+
right: "right";
|
|
161
|
+
top: "top";
|
|
162
|
+
bottom: "bottom";
|
|
163
|
+
middle: "middle";
|
|
164
|
+
}>;
|
|
165
|
+
reference: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
166
|
+
}, z.core.$strip>;
|
|
167
|
+
export type PluginDesignAlignArgs = z.infer<typeof PluginDesignAlignArgs>;
|
|
87
168
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/transform/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/transform/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC9D,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAA;AAElD;;;;;;;;;;GAUG;AACH,8BAAsB,wBAAwB;;IAG5C;;;;;;;;;;;;;;;;;;;;OAoBG;aACa,IAAI,CAClB,UAAU,EAAE,eAAe,EAAE,EAC7B,YAAY,EAAE,UAAU,EACxB,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,OAAO,CAAC;QAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;KAAE,GACxD,eAAe,CAAC,wBAAwB,CAAC;IAE5C;;;;;;;;;;;;;;;;;;;;OAoBG;aACa,MAAM,CACpB,UAAU,EAAE,eAAe,EAAE,EAC7B,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,UAAU,CAAC;QAAC,IAAI,CAAC,EAAE,OAAO,CAAA;KAAE,GAC9C,eAAe,CAAC,wBAAwB,CAAC;IAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAuCG;aACa,KAAK,CACnB,UAAU,EAAE,eAAe,EAAE,EAC7B,IAAI,EAAE,eAAe,EACrB,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,eAAe,CAAA;KAAE,GACxC,eAAe,CAAC,wBAAwB,CAAC;CAC7C;AAED;;;;GAIG;AACH,eAAO,MAAM,eAAe;;;;;;;EAAiE,CAAA;AAC7F,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAE7D;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;iBAK/B,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;iBAKjC,CAAA;AACF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;;;;GAQG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;iBAIhC,CAAA;AACF,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
|
|
@@ -2,6 +2,7 @@ import * as z from "zod";
|
|
|
2
2
|
import { PluginApiReturn } from "../../../types";
|
|
3
3
|
import { ComponentHandle } from "../../../handles";
|
|
4
4
|
import { PluginSpaceUpdateResult } from "../../entity/space";
|
|
5
|
+
import { PluginDesignChangeResult } from "../lock";
|
|
5
6
|
/**
|
|
6
7
|
* Sparse property updates for a space. Only provided fields change.
|
|
7
8
|
*
|
|
@@ -109,6 +110,89 @@ export declare const PluginUpdateSpaceItem: z.ZodObject<{
|
|
|
109
110
|
}, z.core.$strip>>;
|
|
110
111
|
}, z.core.$strip>;
|
|
111
112
|
export type PluginUpdateSpaceItem = z.infer<typeof PluginUpdateSpaceItem>;
|
|
113
|
+
/**
|
|
114
|
+
* Wire schema for {@linkcode PluginDesignUpdateApi.setLabel}.
|
|
115
|
+
*
|
|
116
|
+
* | Property | Type | Description |
|
|
117
|
+
* |---|---|---|
|
|
118
|
+
* | `component` | `ComponentHandle` | The component to relabel |
|
|
119
|
+
* | `label` | `string` | New label (non-empty after trimming) |
|
|
120
|
+
*/
|
|
121
|
+
export declare const PluginDesignSetLabelArgs: z.ZodObject<{
|
|
122
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
123
|
+
label: z.ZodString;
|
|
124
|
+
}, z.core.$strip>;
|
|
125
|
+
export type PluginDesignSetLabelArgs = z.infer<typeof PluginDesignSetLabelArgs>;
|
|
126
|
+
/**
|
|
127
|
+
* Sparse parametric updates for a staircase (all fields optional; at least one
|
|
128
|
+
* required). Only the fields you provide change. Consumed by
|
|
129
|
+
* {@linkcode PluginDesignUpdateApi.staircase}; the paired read is
|
|
130
|
+
* `design.query.getStaircaseParams`.
|
|
131
|
+
*
|
|
132
|
+
* All dimensions are in **engine units** (the same convention as
|
|
133
|
+
* `design.doors.setWidth`); `steps` is a unitless integer count. Height, riser,
|
|
134
|
+
* and step count are **coupled** (`staircaseHeight = steps × riser`); the two
|
|
135
|
+
* lock booleans govern which value recomputes — see the method JSDoc.
|
|
136
|
+
*
|
|
137
|
+
* | Property | Type | Description |
|
|
138
|
+
* |---|---|---|
|
|
139
|
+
* | `isStoreyHeightUnlocked` | `boolean`? | Unlock the staircase height from the storey height |
|
|
140
|
+
* | `isStaircaseHeightUnlocked` | `boolean`? | Unlock the height from `steps × riser` |
|
|
141
|
+
* | `storeyHeight` | `number`? | Storey height the stair sits within (engine units) |
|
|
142
|
+
* | `staircaseHeight` | `number`? | Total rise (engine units) |
|
|
143
|
+
* | `steps` | `number`? | Step count (unitless integer) |
|
|
144
|
+
* | `riser` | `number`? | Riser height (engine units) |
|
|
145
|
+
* | `tread` | `number`? | Tread depth (engine units) |
|
|
146
|
+
* | `width` | `number`? | Flight width (engine units) |
|
|
147
|
+
* | `depth` | `number`? | Slab/waist thickness (engine units) |
|
|
148
|
+
* | `wellSize` | `number`? | Stairwell gap (dogLegged / openWell / square) |
|
|
149
|
+
* | `flightStartDistAfterTurn` | `number`? | Flight offset after a turn (dogLegged / lShaped / square) |
|
|
150
|
+
* | `landingWidth` | `number`? | Landing depth (straight / dogLegged) |
|
|
151
|
+
* | `baseOffset` | `number`? | Vertical offset from the storey base (engine units) |
|
|
152
|
+
*/
|
|
153
|
+
export declare const PluginStaircaseParamUpdates: z.ZodObject<{
|
|
154
|
+
isStoreyHeightUnlocked: z.ZodOptional<z.ZodBoolean>;
|
|
155
|
+
isStaircaseHeightUnlocked: z.ZodOptional<z.ZodBoolean>;
|
|
156
|
+
storeyHeight: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
staircaseHeight: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
steps: z.ZodOptional<z.ZodNumber>;
|
|
159
|
+
riser: z.ZodOptional<z.ZodNumber>;
|
|
160
|
+
tread: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
wellSize: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
flightStartDistAfterTurn: z.ZodOptional<z.ZodNumber>;
|
|
165
|
+
landingWidth: z.ZodOptional<z.ZodNumber>;
|
|
166
|
+
baseOffset: z.ZodOptional<z.ZodNumber>;
|
|
167
|
+
}, z.core.$strip>;
|
|
168
|
+
export type PluginStaircaseParamUpdates = z.infer<typeof PluginStaircaseParamUpdates>;
|
|
169
|
+
/**
|
|
170
|
+
* Arguments for {@linkcode PluginDesignUpdateApi.staircase}.
|
|
171
|
+
*
|
|
172
|
+
* | Property | Type | Description |
|
|
173
|
+
* |---|---|---|
|
|
174
|
+
* | `staircases` | {@linkcode ComponentHandle}`[]` | The staircases to update |
|
|
175
|
+
* | `params` | {@linkcode PluginStaircaseParamUpdates} | Sparse parametric changes (≥ 1 field) |
|
|
176
|
+
*/
|
|
177
|
+
export declare const PluginDesignUpdateStaircaseArgs: z.ZodObject<{
|
|
178
|
+
staircases: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
179
|
+
params: z.ZodObject<{
|
|
180
|
+
isStoreyHeightUnlocked: z.ZodOptional<z.ZodBoolean>;
|
|
181
|
+
isStaircaseHeightUnlocked: z.ZodOptional<z.ZodBoolean>;
|
|
182
|
+
storeyHeight: z.ZodOptional<z.ZodNumber>;
|
|
183
|
+
staircaseHeight: z.ZodOptional<z.ZodNumber>;
|
|
184
|
+
steps: z.ZodOptional<z.ZodNumber>;
|
|
185
|
+
riser: z.ZodOptional<z.ZodNumber>;
|
|
186
|
+
tread: z.ZodOptional<z.ZodNumber>;
|
|
187
|
+
width: z.ZodOptional<z.ZodNumber>;
|
|
188
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
189
|
+
wellSize: z.ZodOptional<z.ZodNumber>;
|
|
190
|
+
flightStartDistAfterTurn: z.ZodOptional<z.ZodNumber>;
|
|
191
|
+
landingWidth: z.ZodOptional<z.ZodNumber>;
|
|
192
|
+
baseOffset: z.ZodOptional<z.ZodNumber>;
|
|
193
|
+
}, z.core.$strip>;
|
|
194
|
+
}, z.core.$strip>;
|
|
195
|
+
export type PluginDesignUpdateStaircaseArgs = z.infer<typeof PluginDesignUpdateStaircaseArgs>;
|
|
112
196
|
/**
|
|
113
197
|
* `snaptrude.design.update` — edit existing scene entities (properties + geometry).
|
|
114
198
|
*
|
|
@@ -117,6 +201,45 @@ export type PluginUpdateSpaceItem = z.infer<typeof PluginUpdateSpaceItem>;
|
|
|
117
201
|
*/
|
|
118
202
|
export declare abstract class PluginDesignUpdateApi {
|
|
119
203
|
constructor();
|
|
204
|
+
/**
|
|
205
|
+
* Set a component's **Label** — the same editable Label field the properties
|
|
206
|
+
* panel shows (doors, windows, furniture, spaces, and every other labelled
|
|
207
|
+
* component). The paired read is `design.query.getLabel`. Undoable; the
|
|
208
|
+
* canvas label text updates immediately.
|
|
209
|
+
*
|
|
210
|
+
* Strictly **per component**: labelling one door of a placed family never
|
|
211
|
+
* touches its sibling doors (the panel's Label edit, by contrast, applies to
|
|
212
|
+
* the whole family). On **legacy masses** without a space type, panel parity
|
|
213
|
+
* applies — a label matching a room-type preset with a height can also
|
|
214
|
+
* adjust the mass's height and material, exactly like typing it in the panel.
|
|
215
|
+
*
|
|
216
|
+
* Throws when the component is locked, the handle is gone/forged, the label
|
|
217
|
+
* is empty, or the component has no mesh to label. Re-applying the current
|
|
218
|
+
* label is a no-op that returns `true` without touching the undo stack.
|
|
219
|
+
*
|
|
220
|
+
* @param component - The component to relabel
|
|
221
|
+
* @param label - New label text (non-empty; leading/trailing whitespace trimmed)
|
|
222
|
+
* @returns `true` once the label is applied
|
|
223
|
+
*
|
|
224
|
+
* @examplePrompt Rename this door to D-101
|
|
225
|
+
* @examplePrompt Number all doors on storey 2 with a D-2-XX tag
|
|
226
|
+
* @examplePrompt Set the selected window's label to W-04
|
|
227
|
+
* @examplePrompt Tag every door with its fire rating
|
|
228
|
+
*
|
|
229
|
+
* # Example
|
|
230
|
+
* ```ts
|
|
231
|
+
* // Door tag numbering: label every door as D-<storey>-<n>, numbered per storey
|
|
232
|
+
* await snaptrude.design.selection.setByFilter({ types: ["door"] })
|
|
233
|
+
* const doors = await snaptrude.design.selection.get()
|
|
234
|
+
* const counts = {}
|
|
235
|
+
* for (const door of doors) {
|
|
236
|
+
* const { storey = 0 } = await snaptrude.design.query.getProperties(door)
|
|
237
|
+
* counts[storey] = (counts[storey] ?? 0) + 1
|
|
238
|
+
* await snaptrude.design.update.setLabel(door, `D-${storey}-${String(counts[storey]).padStart(2, "0")}`)
|
|
239
|
+
* }
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
abstract setLabel(component: ComponentHandle, label: string): PluginApiReturn<boolean>;
|
|
120
243
|
/**
|
|
121
244
|
* Update a single space (room) — change its properties (room label, space
|
|
122
245
|
* type, mass type, area class, department) and/or replace its geometry by
|
|
@@ -174,5 +297,50 @@ export declare abstract class PluginDesignUpdateApi {
|
|
|
174
297
|
* ```
|
|
175
298
|
*/
|
|
176
299
|
abstract spaces(items: PluginUpdateSpaceItem[]): PluginApiReturn<PluginSpaceUpdateResult[]>;
|
|
300
|
+
/**
|
|
301
|
+
* Update the parameters of one or more staircases — riser, tread, width,
|
|
302
|
+
* depth, step count, total height, well size, landing depth, base offset,
|
|
303
|
+
* and the two height locks — in one undoable operation. Sparse: only the
|
|
304
|
+
* fields you provide change. The paired read is
|
|
305
|
+
* `design.query.getStaircaseParams`.
|
|
306
|
+
*
|
|
307
|
+
* All dimensions are in **engine units** (the same convention as
|
|
308
|
+
* `design.doors.setWidth`); `steps` is a unitless integer count. The height,
|
|
309
|
+
* riser, and step count are **coupled** — `staircaseHeight = steps × riser` —
|
|
310
|
+
* and the two lock booleans govern which value recomputes when another
|
|
311
|
+
* changes. With `isStoreyHeightUnlocked` false the staircase height follows
|
|
312
|
+
* the storey height; unlocking it also unlocks the staircase height. Setting
|
|
313
|
+
* `steps` recomputes `riser` (or the height, once the height is unlocked),
|
|
314
|
+
* and setting `riser` recomputes `steps`/height in turn.
|
|
315
|
+
*
|
|
316
|
+
* Presets-only: this edits the parametric fields of a preset staircase; it
|
|
317
|
+
* does not change the staircase's type/preset (there is no in-place re-type).
|
|
318
|
+
* Every edit rebuilds the staircase geometry, so the call is async.
|
|
319
|
+
*
|
|
320
|
+
* Throws when a handle is not a staircase, when a staircase is locked, or
|
|
321
|
+
* when a value falls outside the engine's accepted range (RPC rejects).
|
|
322
|
+
*
|
|
323
|
+
* @param staircases - the staircases to update
|
|
324
|
+
* @param params - sparse {@linkcode PluginStaircaseParamUpdates} (at least one field)
|
|
325
|
+
* @returns the affected staircases
|
|
326
|
+
*
|
|
327
|
+
* @examplePrompt Set the riser of this staircase to 165mm
|
|
328
|
+
* @examplePrompt Change all the stairs to 14 steps
|
|
329
|
+
* @examplePrompt Make the selected staircase 1200 wide with a 280 tread
|
|
330
|
+
* @examplePrompt Widen every staircase on level 1 to 1 metre
|
|
331
|
+
* @examplePrompt Unlock the height and set this stair to 3200 tall
|
|
332
|
+
*
|
|
333
|
+
* # Example
|
|
334
|
+
* ```ts
|
|
335
|
+
* // Give every ground-floor staircase a common riser + tread (engine units)
|
|
336
|
+
* const stairs = await snaptrude.design.query.listStaircases({ storeys: [1] })
|
|
337
|
+
* const { affected } = await snaptrude.design.update.staircase(stairs, {
|
|
338
|
+
* riser: 165,
|
|
339
|
+
* tread: 280,
|
|
340
|
+
* })
|
|
341
|
+
* console.log("updated", affected.length, "staircases")
|
|
342
|
+
* ```
|
|
343
|
+
*/
|
|
344
|
+
abstract staircase(staircases: ComponentHandle[], params: PluginStaircaseParamUpdates): PluginApiReturn<PluginDesignChangeResult>;
|
|
177
345
|
}
|
|
178
346
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/update/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAiB,MAAM,kBAAkB,CAAA;AACjE,OAAO,EAKL,uBAAuB,EACxB,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/update/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAiB,MAAM,kBAAkB,CAAA;AACjE,OAAO,EAKL,uBAAuB,EACxB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,SAAS,C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;;;;OAoBG;aACa,KAAK,CACnB,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE;QACP,UAAU,CAAC,EAAE,0BAA0B,CAAA;QACvC,QAAQ,CAAC,EAAE,yBAAyB,CAAA;KACrC,GACA,eAAe,CAAC,uBAAuB,CAAC;IAE3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;aACa,MAAM,CAAC,KAAK,EAAE,qBAAqB,EAAE,GAAG,eAAe,CAAC,uBAAuB,EAAE,CAAC;IAElG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2CG;aACa,SAAS,CACvB,UAAU,EAAE,eAAe,EAAE,EAC7B,MAAM,EAAE,2BAA2B,GAClC,eAAe,CAAC,wBAAwB,CAAC;CAC7C"}
|
|
@@ -2,13 +2,20 @@ 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
|
* `snaptrude.design.windows` — window-specific reads. Creation lives at
|
|
7
8
|
* `design.create.window`; generic reads (`listWindows`/`getHost`/`getProperties`) live
|
|
8
9
|
* at `design.query.*`. Window targets are {@linkcode ComponentHandle}s.
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
11
|
+
* The **catalog** reads (`listCatalogGroups`/`listCatalog`/`getCatalogItem`/`exists`)
|
|
12
|
+
* browse the placeable window library — plain value records keyed by a library id
|
|
13
|
+
* (team `_id` or general `fullName`), NOT handles — and feed `design.create.window`.
|
|
14
|
+
* They are network-backed but carry no `Async` suffix (§6.6) and never throw
|
|
15
|
+
* (`[]`/`null`). The {@linkcode PluginObjectCatalogGroup} / {@linkcode PluginObjectCatalogItem}
|
|
16
|
+
* DTOs are shared with `design.doors` (defined there, re-exported here).
|
|
17
|
+
*
|
|
18
|
+
* `getSillHeight` (bounds-derived) and the command-wired `mirror` land in a later pass.
|
|
12
19
|
*/
|
|
13
20
|
export declare abstract class PluginDesignWindowsApi {
|
|
14
21
|
constructor();
|
|
@@ -133,6 +140,83 @@ export declare abstract class PluginDesignWindowsApi {
|
|
|
133
140
|
* ```
|
|
134
141
|
*/
|
|
135
142
|
abstract setHeight(window: ComponentHandle, height: number): PluginApiReturn<PluginDesignChangeResult>;
|
|
143
|
+
/**
|
|
144
|
+
* List the window catalog **groups** — the placement families (Fixed,
|
|
145
|
+
* Casement, Sliding, Folding, …), built-in groups merged with any
|
|
146
|
+
* team-custom types.
|
|
147
|
+
*
|
|
148
|
+
* @returns The groups as {@linkcode PluginObjectCatalogGroup}`[]` (`[]` when empty)
|
|
149
|
+
*
|
|
150
|
+
* @examplePrompt What kinds of windows can I place?
|
|
151
|
+
* @examplePrompt List the window groups in the catalog
|
|
152
|
+
* @examplePrompt Show me the window families available in this project
|
|
153
|
+
* @examplePrompt Which window types does this project support?
|
|
154
|
+
*
|
|
155
|
+
* # Example
|
|
156
|
+
* ```ts
|
|
157
|
+
* const groups = await snaptrude.design.windows.listCatalogGroups()
|
|
158
|
+
* for (const g of groups) console.log(g.dbType, g.label, g.source)
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
abstract listCatalogGroups(): PluginApiReturn<PluginObjectCatalogGroup[]>;
|
|
162
|
+
/**
|
|
163
|
+
* List the placeable window catalog (team + general libraries), optionally
|
|
164
|
+
* restricted to one group by its `dbType` token.
|
|
165
|
+
*
|
|
166
|
+
* @param group Restrict to one group's `dbType` (optional; e.g. `"casementDouble"`)
|
|
167
|
+
* @returns The catalog as {@linkcode PluginObjectCatalogItem}`[]` (`[]` when empty)
|
|
168
|
+
*
|
|
169
|
+
* @examplePrompt What windows can I place in this project?
|
|
170
|
+
* @examplePrompt List every window in the library
|
|
171
|
+
* @examplePrompt Show me the casement windows I can add
|
|
172
|
+
* @examplePrompt Browse the window catalog
|
|
173
|
+
*
|
|
174
|
+
* # Example
|
|
175
|
+
* ```ts
|
|
176
|
+
* const [group] = await snaptrude.design.windows.listCatalogGroups()
|
|
177
|
+
* const items = await snaptrude.design.windows.listCatalog(group?.dbType)
|
|
178
|
+
* for (const item of items) console.log(item.id, item.name, item.thumbnailUrl)
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
abstract listCatalog(group?: string): PluginApiReturn<PluginObjectCatalogItem[]>;
|
|
182
|
+
/**
|
|
183
|
+
* Get a single window catalog item by its library id.
|
|
184
|
+
*
|
|
185
|
+
* @param id The catalog library id
|
|
186
|
+
* @returns The item, or `null` if no catalog item matches
|
|
187
|
+
*
|
|
188
|
+
* @examplePrompt Get the details of this window from the library
|
|
189
|
+
* @examplePrompt Look up the catalog entry for this window id
|
|
190
|
+
* @examplePrompt What is the cost of this window item?
|
|
191
|
+
* @examplePrompt Show me the family name of this window in the catalog
|
|
192
|
+
*
|
|
193
|
+
* # Example
|
|
194
|
+
* ```ts
|
|
195
|
+
* const [entry] = await snaptrude.design.windows.listCatalog()
|
|
196
|
+
* const item = await snaptrude.design.windows.getCatalogItem(entry.id)
|
|
197
|
+
* if (item) console.log(item.name, item.source, item.dbType)
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
abstract getCatalogItem(id: string): PluginApiReturn<PluginObjectCatalogItem | null>;
|
|
201
|
+
/**
|
|
202
|
+
* Test whether a window catalog item exists for the given library id.
|
|
203
|
+
*
|
|
204
|
+
* @param id The catalog library id
|
|
205
|
+
* @returns `true` if it exists, otherwise `false`
|
|
206
|
+
*
|
|
207
|
+
* @examplePrompt Is this window still in the library?
|
|
208
|
+
* @examplePrompt Check whether a window catalog item with this id exists
|
|
209
|
+
* @examplePrompt Does my team library have this window?
|
|
210
|
+
* @examplePrompt Verify the window is available before placing it
|
|
211
|
+
*
|
|
212
|
+
* # Example
|
|
213
|
+
* ```ts
|
|
214
|
+
* const [entry] = await snaptrude.design.windows.listCatalog()
|
|
215
|
+
* const stillAvailable = await snaptrude.design.windows.exists(entry.id)
|
|
216
|
+
* console.log(stillAvailable ? "safe to place" : "removed from library")
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
abstract exists(id: string): PluginApiReturn<boolean>;
|
|
136
220
|
}
|
|
137
221
|
/**
|
|
138
222
|
* Arguments for the single-window read methods.
|
|
@@ -186,4 +270,31 @@ export declare const PluginDesignWindowSetHeightArgs: z.ZodObject<{
|
|
|
186
270
|
height: z.ZodNumber;
|
|
187
271
|
}, z.core.$strip>;
|
|
188
272
|
export type PluginDesignWindowSetHeightArgs = z.infer<typeof PluginDesignWindowSetHeightArgs>;
|
|
273
|
+
export { PluginObjectCatalogGroup, PluginObjectCatalogItem };
|
|
274
|
+
/**
|
|
275
|
+
* Arguments for {@linkcode PluginDesignWindowsApi.listCatalog}.
|
|
276
|
+
*
|
|
277
|
+
* | Property | Type | Description |
|
|
278
|
+
* |---|---|---|
|
|
279
|
+
* | `group` | `string`? | Restrict to one group's `dbType` token (optional) |
|
|
280
|
+
*/
|
|
281
|
+
export declare const PluginDesignWindowListCatalogArgs: z.ZodObject<{
|
|
282
|
+
group: z.ZodOptional<z.ZodString>;
|
|
283
|
+
}, z.core.$strip>;
|
|
284
|
+
export type PluginDesignWindowListCatalogArgs = z.infer<typeof PluginDesignWindowListCatalogArgs>;
|
|
285
|
+
/**
|
|
286
|
+
* Arguments for {@linkcode PluginDesignWindowsApi.getCatalogItem} / {@linkcode PluginDesignWindowsApi.exists}.
|
|
287
|
+
*
|
|
288
|
+
* | Property | Type | Description |
|
|
289
|
+
* |---|---|---|
|
|
290
|
+
* | `id` | `string` | The catalog library id |
|
|
291
|
+
*/
|
|
292
|
+
export declare const PluginDesignWindowGetCatalogItemArgs: z.ZodObject<{
|
|
293
|
+
id: z.ZodString;
|
|
294
|
+
}, z.core.$strip>;
|
|
295
|
+
export type PluginDesignWindowGetCatalogItemArgs = z.infer<typeof PluginDesignWindowGetCatalogItemArgs>;
|
|
296
|
+
export declare const PluginDesignWindowExistsArgs: z.ZodObject<{
|
|
297
|
+
id: z.ZodString;
|
|
298
|
+
}, z.core.$strip>;
|
|
299
|
+
export type PluginDesignWindowExistsArgs = z.infer<typeof PluginDesignWindowExistsArgs>;
|
|
189
300
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/windows/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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/windows/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;AAClD,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAE5E;;;;;;;;;;;;;GAaG;AACH,8BAAsB,sBAAsB;;IAG1C;;;;;;;;;;;;;;;;;;OAkBG;aACa,OAAO,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAEhF;;;;;;;;;;;;;;;;;OAiBG;aACa,QAAQ,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;IAEjF;;;;;;;;;;;;;;;;;OAiBG;aACa,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,eAAe,CAAC,MAAM,GAAG,IAAI,CAAC;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GAOG;AACH,eAAO,MAAM,+BAA+B;;;iBAG1C,CAAA;AACF,MAAM,MAAM,+BAA+B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAA;AAO7F,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,CAAA;AAE5D;;;;;;GAMG;AACH,eAAO,MAAM,iCAAiC;;iBAE5C,CAAA;AACF,MAAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAA;AAEjG;;;;;;GAMG;AACH,eAAO,MAAM,oCAAoC;;iBAE/C,CAAA;AACF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAA;AAEvG,eAAO,MAAM,4BAA4B;;iBAAuC,CAAA;AAChF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
|
|
@@ -133,6 +133,7 @@ export declare const PluginSpaceGetProperty: z.ZodEnum<{
|
|
|
133
133
|
position: "position";
|
|
134
134
|
id: "id";
|
|
135
135
|
name: "name";
|
|
136
|
+
storey: "storey";
|
|
136
137
|
height: "height";
|
|
137
138
|
depth: "depth";
|
|
138
139
|
innerProfiles: "innerProfiles";
|
|
@@ -142,7 +143,6 @@ export declare const PluginSpaceGetProperty: z.ZodEnum<{
|
|
|
142
143
|
massType: "massType";
|
|
143
144
|
spaceType: "spaceType";
|
|
144
145
|
areaClass: "areaClass";
|
|
145
|
-
storey: "storey";
|
|
146
146
|
departmentId: "departmentId";
|
|
147
147
|
departmentName: "departmentName";
|
|
148
148
|
departmentColor: "departmentColor";
|
|
@@ -169,6 +169,7 @@ export declare const PluginSpaceGetArgs: z.ZodObject<{
|
|
|
169
169
|
position: "position";
|
|
170
170
|
id: "id";
|
|
171
171
|
name: "name";
|
|
172
|
+
storey: "storey";
|
|
172
173
|
height: "height";
|
|
173
174
|
depth: "depth";
|
|
174
175
|
innerProfiles: "innerProfiles";
|
|
@@ -178,7 +179,6 @@ export declare const PluginSpaceGetArgs: z.ZodObject<{
|
|
|
178
179
|
massType: "massType";
|
|
179
180
|
spaceType: "spaceType";
|
|
180
181
|
areaClass: "areaClass";
|
|
181
|
-
storey: "storey";
|
|
182
182
|
departmentId: "departmentId";
|
|
183
183
|
departmentName: "departmentName";
|
|
184
184
|
departmentColor: "departmentColor";
|