@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/design/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,QAAQ,CAAA;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,EAAE,wBAAwB,EAAE,MAAM,QAAQ,CAAA;AAEjD
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/design/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;A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;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,QAAQ,CAAA;AACtB,cAAc,UAAU,CAAA"}
|
|
@@ -38,4 +38,30 @@ export declare const PluginDesignIsLockedArgs: z.ZodObject<{
|
|
|
38
38
|
includeInherited: z.ZodOptional<z.ZodBoolean>;
|
|
39
39
|
}, z.core.$strip>;
|
|
40
40
|
export type PluginDesignIsLockedArgs = z.infer<typeof PluginDesignIsLockedArgs>;
|
|
41
|
+
/**
|
|
42
|
+
* Arguments for {@linkcode PluginDesignApi.lockArea} / {@linkcode PluginDesignApi.unlockArea}.
|
|
43
|
+
*
|
|
44
|
+
* | Property | Type | Description |
|
|
45
|
+
* |---|---|---|
|
|
46
|
+
* | `spaces` | {@linkcode ComponentHandle}`[]` | Room / Department mass spaces to area-lock / unlock |
|
|
47
|
+
*/
|
|
48
|
+
export declare const PluginDesignLockAreaArgs: z.ZodObject<{
|
|
49
|
+
spaces: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type PluginDesignLockAreaArgs = z.infer<typeof PluginDesignLockAreaArgs>;
|
|
52
|
+
export declare const PluginDesignUnlockAreaArgs: z.ZodObject<{
|
|
53
|
+
spaces: z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>>;
|
|
54
|
+
}, z.core.$strip>;
|
|
55
|
+
export type PluginDesignUnlockAreaArgs = z.infer<typeof PluginDesignUnlockAreaArgs>;
|
|
56
|
+
/**
|
|
57
|
+
* Arguments for {@linkcode PluginDesignApi.isAreaLocked}.
|
|
58
|
+
*
|
|
59
|
+
* | Property | Type | Description |
|
|
60
|
+
* |---|---|---|
|
|
61
|
+
* | `space` | {@linkcode ComponentHandle} | The space to test |
|
|
62
|
+
*/
|
|
63
|
+
export declare const PluginDesignIsAreaLockedArgs: z.ZodObject<{
|
|
64
|
+
space: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
65
|
+
}, z.core.$strip>;
|
|
66
|
+
export type PluginDesignIsAreaLockedArgs = z.infer<typeof PluginDesignIsAreaLockedArgs>;
|
|
41
67
|
//# sourceMappingURL=lock.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../src/api/design/lock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;iBAEnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;iBAE/B,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE,eAAO,MAAM,sBAAsB;;iBAAuB,CAAA;AAC1D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../src/api/design/lock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB;;iBAEnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;iBAE/B,CAAA;AACF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEvE,eAAO,MAAM,sBAAsB;;iBAAuB,CAAA;AAC1D,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAE3E;;;;;;;GAOG;AACH,eAAO,MAAM,wBAAwB;;;iBAGnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB;;iBAEnC,CAAA;AACF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAE/E,eAAO,MAAM,0BAA0B;;iBAA2B,CAAA;AAClE,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAEnF;;;;;;GAMG;AACH,eAAO,MAAM,4BAA4B;;iBAEvC,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA"}
|
|
@@ -9,8 +9,15 @@ import { ComponentHandle, MaterialHandle } from "../../../handles";
|
|
|
9
9
|
* scene (undoable via `save`, default `true`). `create` mints a material from a
|
|
10
10
|
* {@linkcode PluginMaterialSpec} (idempotent by name).
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
12
|
+
* Per-face assignment — {@linkcode PluginDesignMaterialsApi.applyToFaces} /
|
|
13
|
+
* {@linkcode PluginDesignMaterialsApi.resetFaces} plus per-face reads
|
|
14
|
+
* ({@linkcode PluginDesignMaterialsApi.getByFace} / {@linkcode PluginDesignMaterialsApi.listByFace})
|
|
15
|
+
* — targets **BREP faces by durable face index** and is **BREP-only** (furniture,
|
|
16
|
+
* doors/windows, and Revit imports are rejected) and **visual-only** in v1 (the
|
|
17
|
+
* per-face finish is not carried into BIM schedules / cost layers). A face index
|
|
18
|
+
* is durable only while the component's BREP topology (face count/order) is unchanged.
|
|
19
|
+
*
|
|
20
|
+
* `copy` (needs an undo wrapper) lands in a later pass.
|
|
14
21
|
*/
|
|
15
22
|
export declare abstract class PluginDesignMaterialsApi {
|
|
16
23
|
constructor();
|
|
@@ -99,6 +106,102 @@ export declare abstract class PluginDesignMaterialsApi {
|
|
|
99
106
|
* ```
|
|
100
107
|
*/
|
|
101
108
|
abstract reset(components: ComponentHandle[], save?: boolean): PluginApiReturn<PluginMaterialResult>;
|
|
109
|
+
/**
|
|
110
|
+
* Paint specific **BREP faces** of a component with a material — an existing
|
|
111
|
+
* project material by handle, or a new one described inline as a
|
|
112
|
+
* {@linkcode PluginMaterialSpec}. Faces are addressed by **durable BREP face
|
|
113
|
+
* index** (their 0-based position in the component's BREP face list).
|
|
114
|
+
* Undoable when `save` is true (the default).
|
|
115
|
+
*
|
|
116
|
+
* Per-face materials are **BREP-only** (walls, floors, slabs, roofs, masses,
|
|
117
|
+
* columns, beams; furniture, doors/windows, and Revit imports are rejected) and
|
|
118
|
+
* **visual-only in v1** — the finish is not carried into BIM schedules / cost
|
|
119
|
+
* layers. A face index is durable only while the BREP topology (face count/order)
|
|
120
|
+
* is unchanged; a face index at or beyond the face count is rejected.
|
|
121
|
+
*
|
|
122
|
+
* @param component The (BREP) component to paint
|
|
123
|
+
* @param faces BREP face indices to paint (nonnegative integers)
|
|
124
|
+
* @param material Material handle, or an inline {@linkcode PluginMaterialSpec}
|
|
125
|
+
* @param save Commit as an undoable command (default `true`)
|
|
126
|
+
* @returns The number of faces painted
|
|
127
|
+
*
|
|
128
|
+
* @examplePrompt Paint the top face of this slab red
|
|
129
|
+
* @examplePrompt Apply the brick material to faces 0 and 2 of this wall
|
|
130
|
+
* @examplePrompt Put a wood finish on just the front face of this column
|
|
131
|
+
* @examplePrompt Colour face 4 of the selected mass with #ff8800
|
|
132
|
+
*
|
|
133
|
+
* # Example
|
|
134
|
+
* ```ts
|
|
135
|
+
* const [wall] = await snaptrude.design.query.listWalls({ storeys: [1] })
|
|
136
|
+
* // faces are addressed by durable 0-based BREP face index
|
|
137
|
+
* const { count } = await snaptrude.design.materials.applyToFaces(wall, [0, 1], { name: "Accent", color: "#b04a3a" })
|
|
138
|
+
* console.log("painted", count, "faces")
|
|
139
|
+
* ```
|
|
140
|
+
*/
|
|
141
|
+
abstract applyToFaces(component: ComponentHandle, faces: number[], material: MaterialHandle | PluginMaterialSpec, save?: boolean): PluginApiReturn<PluginMaterialResult>;
|
|
142
|
+
/**
|
|
143
|
+
* Reset specific BREP faces of a component back to the component/type default,
|
|
144
|
+
* removing any per-face finish. The inverse of
|
|
145
|
+
* {@linkcode PluginDesignMaterialsApi.applyToFaces}; undoable when `save` is true
|
|
146
|
+
* (the default). BREP-only (see `applyToFaces`).
|
|
147
|
+
*
|
|
148
|
+
* @param component The (BREP) component
|
|
149
|
+
* @param faces BREP face indices to reset (nonnegative integers)
|
|
150
|
+
* @param save Commit as an undoable command (default `true`)
|
|
151
|
+
* @returns The number of faces reset
|
|
152
|
+
*
|
|
153
|
+
* @examplePrompt Remove the paint from the top face of this slab
|
|
154
|
+
* @examplePrompt Reset faces 0 and 2 of this wall to their default material
|
|
155
|
+
* @examplePrompt Clear the custom finish on the front face of this column
|
|
156
|
+
*
|
|
157
|
+
* # Example
|
|
158
|
+
* ```ts
|
|
159
|
+
* const [wall] = await snaptrude.design.query.listWalls({ storeys: [1] })
|
|
160
|
+
* const { count } = await snaptrude.design.materials.resetFaces(wall, [0, 1])
|
|
161
|
+
* console.log("reset", count, "faces")
|
|
162
|
+
* ```
|
|
163
|
+
*/
|
|
164
|
+
abstract resetFaces(component: ComponentHandle, faces: number[], save?: boolean): PluginApiReturn<PluginMaterialResult>;
|
|
165
|
+
/**
|
|
166
|
+
* Read the material applied to a single BREP face.
|
|
167
|
+
*
|
|
168
|
+
* @param component The (BREP) component
|
|
169
|
+
* @param face The BREP face index (a nonnegative integer)
|
|
170
|
+
* @returns The face's material as a {@linkcode MaterialHandle}, or `null` if the
|
|
171
|
+
* face carries no explicit per-face material (or the component has no BREP)
|
|
172
|
+
*
|
|
173
|
+
* @examplePrompt What material is on the top face of this slab?
|
|
174
|
+
* @examplePrompt Get the finish applied to face 2 of this wall
|
|
175
|
+
* @examplePrompt Which material is painted on the front face of this column?
|
|
176
|
+
*
|
|
177
|
+
* # Example
|
|
178
|
+
* ```ts
|
|
179
|
+
* const [wall] = await snaptrude.design.query.listWalls()
|
|
180
|
+
* const material = await snaptrude.design.materials.getByFace(wall, 0)
|
|
181
|
+
* if (material) console.log(await snaptrude.design.materials.getInfo(material))
|
|
182
|
+
* ```
|
|
183
|
+
*/
|
|
184
|
+
abstract getByFace(component: ComponentHandle, face: number): PluginApiReturn<MaterialHandle | null>;
|
|
185
|
+
/**
|
|
186
|
+
* List the per-face materials of a component — one entry per BREP face, in face
|
|
187
|
+
* index order. A face carrying no explicit per-face material reports `null`.
|
|
188
|
+
*
|
|
189
|
+
* @param component The (BREP) component
|
|
190
|
+
* @returns The per-face materials as {@linkcode PluginFaceMaterial}`[]` (`[]` for a
|
|
191
|
+
* component with no BREP)
|
|
192
|
+
*
|
|
193
|
+
* @examplePrompt List the material on every face of this wall
|
|
194
|
+
* @examplePrompt Show me which faces of this slab are painted and with what
|
|
195
|
+
* @examplePrompt Break down the per-face finishes of the selected mass
|
|
196
|
+
*
|
|
197
|
+
* # Example
|
|
198
|
+
* ```ts
|
|
199
|
+
* const [wall] = await snaptrude.design.query.listWalls()
|
|
200
|
+
* const faces = await snaptrude.design.materials.listByFace(wall)
|
|
201
|
+
* for (const f of faces) console.log(f.faceIndex, f.material ?? "(default)")
|
|
202
|
+
* ```
|
|
203
|
+
*/
|
|
204
|
+
abstract listByFace(component: ComponentHandle): PluginApiReturn<PluginFaceMaterial[]>;
|
|
102
205
|
/**
|
|
103
206
|
* Create a new material in the project from a spec — a color, texture URL,
|
|
104
207
|
* opacity, and/or name. Idempotent by name: creating with the name of an
|
|
@@ -238,6 +341,19 @@ export declare const PluginMaterialResult: z.ZodObject<{
|
|
|
238
341
|
count: z.ZodNumber;
|
|
239
342
|
}, z.core.$strip>;
|
|
240
343
|
export type PluginMaterialResult = z.infer<typeof PluginMaterialResult>;
|
|
344
|
+
/**
|
|
345
|
+
* A single component face's material assignment (value record — not a handle).
|
|
346
|
+
*
|
|
347
|
+
* | Property | Type | Description |
|
|
348
|
+
* |---|---|---|
|
|
349
|
+
* | `faceIndex` | `number` | Durable BREP face index (0-based position in the face list) |
|
|
350
|
+
* | `material` | {@linkcode MaterialHandle} \| `null` | The applied material, or `null` for the default |
|
|
351
|
+
*/
|
|
352
|
+
export declare const PluginFaceMaterial: z.ZodObject<{
|
|
353
|
+
faceIndex: z.ZodNumber;
|
|
354
|
+
material: z.ZodNullable<z.ZodPipe<z.ZodString, z.ZodTransform<MaterialHandle, string>>>;
|
|
355
|
+
}, z.core.$strip>;
|
|
356
|
+
export type PluginFaceMaterial = z.infer<typeof PluginFaceMaterial>;
|
|
241
357
|
/** Arguments for {@linkcode PluginDesignMaterialsApi.list}. */
|
|
242
358
|
export declare const PluginDesignMaterialsListArgs: z.ZodObject<{
|
|
243
359
|
scope: z.ZodOptional<z.ZodEnum<{
|
|
@@ -294,4 +410,45 @@ export declare const PluginDesignMaterialsCreateArgs: z.ZodObject<{
|
|
|
294
410
|
}, z.core.$strip>;
|
|
295
411
|
}, z.core.$strip>;
|
|
296
412
|
export type PluginDesignMaterialsCreateArgs = z.infer<typeof PluginDesignMaterialsCreateArgs>;
|
|
413
|
+
/**
|
|
414
|
+
* Arguments for {@linkcode PluginDesignMaterialsApi.applyToFaces}.
|
|
415
|
+
*
|
|
416
|
+
* | Property | Type | Description |
|
|
417
|
+
* |---|---|---|
|
|
418
|
+
* | `component` | {@linkcode ComponentHandle} | The (BREP) component to paint |
|
|
419
|
+
* | `faces` | `number[]` | BREP face indices to paint (nonnegative integers) |
|
|
420
|
+
* | `material` | {@linkcode MaterialHandle} \| {@linkcode PluginMaterialSpec} | Material handle, or an inline spec |
|
|
421
|
+
* | `save` | `boolean` | Commit as an undoable command (default `true`) |
|
|
422
|
+
*/
|
|
423
|
+
export declare const PluginDesignMaterialsApplyToFacesArgs: z.ZodObject<{
|
|
424
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
425
|
+
faces: z.ZodArray<z.ZodNumber>;
|
|
426
|
+
material: z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<MaterialHandle, string>>, z.ZodObject<{
|
|
427
|
+
name: z.ZodOptional<z.ZodString>;
|
|
428
|
+
color: z.ZodOptional<z.ZodString>;
|
|
429
|
+
textureUrl: z.ZodOptional<z.ZodString>;
|
|
430
|
+
alpha: z.ZodOptional<z.ZodNumber>;
|
|
431
|
+
materialType: z.ZodOptional<z.ZodString>;
|
|
432
|
+
}, z.core.$strip>]>;
|
|
433
|
+
save: z.ZodOptional<z.ZodBoolean>;
|
|
434
|
+
}, z.core.$strip>;
|
|
435
|
+
export type PluginDesignMaterialsApplyToFacesArgs = z.infer<typeof PluginDesignMaterialsApplyToFacesArgs>;
|
|
436
|
+
/** Arguments for {@linkcode PluginDesignMaterialsApi.resetFaces}. */
|
|
437
|
+
export declare const PluginDesignMaterialsResetFacesArgs: z.ZodObject<{
|
|
438
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
439
|
+
faces: z.ZodArray<z.ZodNumber>;
|
|
440
|
+
save: z.ZodOptional<z.ZodBoolean>;
|
|
441
|
+
}, z.core.$strip>;
|
|
442
|
+
export type PluginDesignMaterialsResetFacesArgs = z.infer<typeof PluginDesignMaterialsResetFacesArgs>;
|
|
443
|
+
/** Arguments for {@linkcode PluginDesignMaterialsApi.getByFace}. */
|
|
444
|
+
export declare const PluginDesignMaterialsGetByFaceArgs: z.ZodObject<{
|
|
445
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
446
|
+
face: z.ZodNumber;
|
|
447
|
+
}, z.core.$strip>;
|
|
448
|
+
export type PluginDesignMaterialsGetByFaceArgs = z.infer<typeof PluginDesignMaterialsGetByFaceArgs>;
|
|
449
|
+
/** Arguments for {@linkcode PluginDesignMaterialsApi.listByFace} (component only). */
|
|
450
|
+
export declare const PluginDesignMaterialsListByFaceArgs: z.ZodObject<{
|
|
451
|
+
component: z.ZodPipe<z.ZodString, z.ZodTransform<ComponentHandle, string>>;
|
|
452
|
+
}, z.core.$strip>;
|
|
453
|
+
export type PluginDesignMaterialsListByFaceArgs = z.infer<typeof PluginDesignMaterialsListByFaceArgs>;
|
|
297
454
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/materials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAElE
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/materials/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAElE;;;;;;;;;;;;;;;;;GAiBG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,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA"}
|
|
@@ -34,6 +34,7 @@ export declare const PluginEntityType: z.ZodEnum<{
|
|
|
34
34
|
floor: "floor";
|
|
35
35
|
wall: "wall";
|
|
36
36
|
ceiling: "ceiling";
|
|
37
|
+
furniture: "furniture";
|
|
37
38
|
space: "space";
|
|
38
39
|
door: "door";
|
|
39
40
|
window: "window";
|
|
@@ -42,7 +43,6 @@ export declare const PluginEntityType: z.ZodEnum<{
|
|
|
42
43
|
column: "column";
|
|
43
44
|
beam: "beam";
|
|
44
45
|
staircase: "staircase";
|
|
45
|
-
furniture: "furniture";
|
|
46
46
|
referenceLine: "referenceLine";
|
|
47
47
|
curtainWall: "curtainWall";
|
|
48
48
|
mullion: "mullion";
|
|
@@ -80,6 +80,7 @@ export declare const PluginEntityFilter: z.ZodObject<{
|
|
|
80
80
|
floor: "floor";
|
|
81
81
|
wall: "wall";
|
|
82
82
|
ceiling: "ceiling";
|
|
83
|
+
furniture: "furniture";
|
|
83
84
|
space: "space";
|
|
84
85
|
door: "door";
|
|
85
86
|
window: "window";
|
|
@@ -88,7 +89,6 @@ export declare const PluginEntityFilter: z.ZodObject<{
|
|
|
88
89
|
column: "column";
|
|
89
90
|
beam: "beam";
|
|
90
91
|
staircase: "staircase";
|
|
91
|
-
furniture: "furniture";
|
|
92
92
|
referenceLine: "referenceLine";
|
|
93
93
|
curtainWall: "curtainWall";
|
|
94
94
|
mullion: "mullion";
|
|
@@ -159,6 +159,7 @@ export declare const PluginDesignQueryListByTypeArgs: z.ZodObject<{
|
|
|
159
159
|
floor: "floor";
|
|
160
160
|
wall: "wall";
|
|
161
161
|
ceiling: "ceiling";
|
|
162
|
+
furniture: "furniture";
|
|
162
163
|
space: "space";
|
|
163
164
|
door: "door";
|
|
164
165
|
window: "window";
|
|
@@ -167,7 +168,6 @@ export declare const PluginDesignQueryListByTypeArgs: z.ZodObject<{
|
|
|
167
168
|
column: "column";
|
|
168
169
|
beam: "beam";
|
|
169
170
|
staircase: "staircase";
|
|
170
|
-
furniture: "furniture";
|
|
171
171
|
referenceLine: "referenceLine";
|
|
172
172
|
curtainWall: "curtainWall";
|
|
173
173
|
mullion: "mullion";
|
|
@@ -231,6 +231,7 @@ export declare const PluginDesignQueryListByTypeArgs: z.ZodObject<{
|
|
|
231
231
|
floor: "floor";
|
|
232
232
|
wall: "wall";
|
|
233
233
|
ceiling: "ceiling";
|
|
234
|
+
furniture: "furniture";
|
|
234
235
|
space: "space";
|
|
235
236
|
door: "door";
|
|
236
237
|
window: "window";
|
|
@@ -239,7 +240,6 @@ export declare const PluginDesignQueryListByTypeArgs: z.ZodObject<{
|
|
|
239
240
|
column: "column";
|
|
240
241
|
beam: "beam";
|
|
241
242
|
staircase: "staircase";
|
|
242
|
-
furniture: "furniture";
|
|
243
243
|
referenceLine: "referenceLine";
|
|
244
244
|
curtainWall: "curtainWall";
|
|
245
245
|
mullion: "mullion";
|
|
@@ -293,6 +293,7 @@ export declare const PluginEntityProperties: z.ZodObject<{
|
|
|
293
293
|
floor: "floor";
|
|
294
294
|
wall: "wall";
|
|
295
295
|
ceiling: "ceiling";
|
|
296
|
+
furniture: "furniture";
|
|
296
297
|
space: "space";
|
|
297
298
|
door: "door";
|
|
298
299
|
window: "window";
|
|
@@ -301,7 +302,6 @@ export declare const PluginEntityProperties: z.ZodObject<{
|
|
|
301
302
|
column: "column";
|
|
302
303
|
beam: "beam";
|
|
303
304
|
staircase: "staircase";
|
|
304
|
-
furniture: "furniture";
|
|
305
305
|
referenceLine: "referenceLine";
|
|
306
306
|
curtainWall: "curtainWall";
|
|
307
307
|
mullion: "mullion";
|
|
@@ -382,6 +382,89 @@ export declare const PluginEntityMeasurements: z.ZodObject<{
|
|
|
382
382
|
}, z.core.$strip>;
|
|
383
383
|
}, z.core.$strip>;
|
|
384
384
|
export type PluginEntityMeasurements = z.infer<typeof PluginEntityMeasurements>;
|
|
385
|
+
/**
|
|
386
|
+
* The parametric properties of a staircase — the same editable fields the
|
|
387
|
+
* staircase properties panel exposes. Returned by
|
|
388
|
+
* {@linkcode PluginDesignQueryApi.getStaircaseParams}; the write side is
|
|
389
|
+
* `design.update.staircase`. Engine internals (block schema, min well size,
|
|
390
|
+
* square-well padding) are deliberately excluded.
|
|
391
|
+
*
|
|
392
|
+
* All dimensions are in **engine units** (the same convention as
|
|
393
|
+
* `design.doors.getWidth`); `steps` is a unitless count. The invariant
|
|
394
|
+
* `staircaseHeight = steps × riser` is governed by the two lock booleans — see
|
|
395
|
+
* `design.update.staircase`. Type-specific fields (`wellSize`, `landingWidth`,
|
|
396
|
+
* `flightStartDistAfterTurn`) are present only when the preset uses them.
|
|
397
|
+
*
|
|
398
|
+
* | Property | Type | Description |
|
|
399
|
+
* |---|---|---|
|
|
400
|
+
* | `staircaseType` | {@linkcode PluginStaircasePreset} | Base staircase type |
|
|
401
|
+
* | `staircasePreset` | {@linkcode PluginStaircasePreset} | Named parametric preset |
|
|
402
|
+
* | `staircaseHeight` | `number` | Total rise (engine units) |
|
|
403
|
+
* | `steps` | `number` | Step count (unitless) |
|
|
404
|
+
* | `riser` | `number` | Riser height (engine units) |
|
|
405
|
+
* | `tread` | `number` | Tread depth (engine units) |
|
|
406
|
+
* | `width` | `number` | Flight width (engine units) |
|
|
407
|
+
* | `depth` | `number` | Slab/waist thickness (engine units) |
|
|
408
|
+
* | `wellSize` | `number`? | Stairwell gap (dogLegged / openWell / square) |
|
|
409
|
+
* | `landingWidth` | `number`? | Landing depth (straight / dogLegged) |
|
|
410
|
+
* | `flightStartDistAfterTurn` | `number`? | Flight offset after a turn (dogLegged / lShaped / square) |
|
|
411
|
+
* | `baseOffset` | `number` | Vertical offset from the storey base (engine units) |
|
|
412
|
+
* | `isStoreyHeightUnlocked` | `boolean` | When `false`, height is tied to the storey height |
|
|
413
|
+
* | `isStaircaseHeightUnlocked` | `boolean` | When `false`, height recomputes from steps × riser |
|
|
414
|
+
* | `storey` | `number` | Storey/floor level the staircase sits on |
|
|
415
|
+
*/
|
|
416
|
+
export declare const PluginStaircaseParams: z.ZodObject<{
|
|
417
|
+
staircaseType: z.ZodEnum<{
|
|
418
|
+
custom: "custom";
|
|
419
|
+
straight: "straight";
|
|
420
|
+
straightWoLanding: "straightWoLanding";
|
|
421
|
+
straightFlightWoMidLanding: "straightFlightWoMidLanding";
|
|
422
|
+
dogLegged: "dogLegged";
|
|
423
|
+
openWell: "openWell";
|
|
424
|
+
lShaped: "lShaped";
|
|
425
|
+
"3StepLShaped": "3StepLShaped";
|
|
426
|
+
square: "square";
|
|
427
|
+
singleStep: "singleStep";
|
|
428
|
+
plinthLevel: "plinthLevel";
|
|
429
|
+
amphitheatre: "amphitheatre";
|
|
430
|
+
connectingStepsToAmphitheatre: "connectingStepsToAmphitheatre";
|
|
431
|
+
mezzanineFloorStraight: "mezzanineFloorStraight";
|
|
432
|
+
mezzanineFloorDogLegged: "mezzanineFloorDogLegged";
|
|
433
|
+
mezzanineFloorLShaped: "mezzanineFloorLShaped";
|
|
434
|
+
}>;
|
|
435
|
+
staircasePreset: z.ZodEnum<{
|
|
436
|
+
custom: "custom";
|
|
437
|
+
straight: "straight";
|
|
438
|
+
straightWoLanding: "straightWoLanding";
|
|
439
|
+
straightFlightWoMidLanding: "straightFlightWoMidLanding";
|
|
440
|
+
dogLegged: "dogLegged";
|
|
441
|
+
openWell: "openWell";
|
|
442
|
+
lShaped: "lShaped";
|
|
443
|
+
"3StepLShaped": "3StepLShaped";
|
|
444
|
+
square: "square";
|
|
445
|
+
singleStep: "singleStep";
|
|
446
|
+
plinthLevel: "plinthLevel";
|
|
447
|
+
amphitheatre: "amphitheatre";
|
|
448
|
+
connectingStepsToAmphitheatre: "connectingStepsToAmphitheatre";
|
|
449
|
+
mezzanineFloorStraight: "mezzanineFloorStraight";
|
|
450
|
+
mezzanineFloorDogLegged: "mezzanineFloorDogLegged";
|
|
451
|
+
mezzanineFloorLShaped: "mezzanineFloorLShaped";
|
|
452
|
+
}>;
|
|
453
|
+
staircaseHeight: z.ZodNumber;
|
|
454
|
+
steps: z.ZodNumber;
|
|
455
|
+
riser: z.ZodNumber;
|
|
456
|
+
tread: z.ZodNumber;
|
|
457
|
+
width: z.ZodNumber;
|
|
458
|
+
depth: z.ZodNumber;
|
|
459
|
+
wellSize: z.ZodOptional<z.ZodNumber>;
|
|
460
|
+
landingWidth: z.ZodOptional<z.ZodNumber>;
|
|
461
|
+
flightStartDistAfterTurn: z.ZodOptional<z.ZodNumber>;
|
|
462
|
+
baseOffset: z.ZodNumber;
|
|
463
|
+
isStoreyHeightUnlocked: z.ZodBoolean;
|
|
464
|
+
isStaircaseHeightUnlocked: z.ZodBoolean;
|
|
465
|
+
storey: z.ZodNumber;
|
|
466
|
+
}, z.core.$strip>;
|
|
467
|
+
export type PluginStaircaseParams = z.infer<typeof PluginStaircaseParams>;
|
|
385
468
|
/**
|
|
386
469
|
* `design.query.*` — read-only enumeration + inspection of scene-committed BIM
|
|
387
470
|
* entities (all-handle model, §11). No query mutates the scene.
|
|
@@ -978,6 +1061,33 @@ export declare abstract class PluginDesignQueryApi {
|
|
|
978
1061
|
* ```
|
|
979
1062
|
*/
|
|
980
1063
|
abstract measure(component: ComponentHandle): PluginApiReturn<PluginEntityMeasurements | null>;
|
|
1064
|
+
/**
|
|
1065
|
+
* Read a staircase's parametric properties — its preset, dimensions, step
|
|
1066
|
+
* count, base offset, and height-lock state — as a
|
|
1067
|
+
* {@linkcode PluginStaircaseParams} record. The paired write is
|
|
1068
|
+
* `design.update.staircase`.
|
|
1069
|
+
*
|
|
1070
|
+
* All dimensions are in **engine units** (the same convention as
|
|
1071
|
+
* `design.doors.getWidth`); `steps` is a unitless count. A read — never
|
|
1072
|
+
* throws: returns `null` for a handle that is not a staircase or no longer
|
|
1073
|
+
* resolves.
|
|
1074
|
+
*
|
|
1075
|
+
* @param staircase - the staircase's {@linkcode ComponentHandle}
|
|
1076
|
+
* @returns the {@linkcode PluginStaircaseParams} record, or `null`
|
|
1077
|
+
*
|
|
1078
|
+
* @examplePrompt What's the riser height of this staircase?
|
|
1079
|
+
* @examplePrompt How many steps does the selected stair have?
|
|
1080
|
+
* @examplePrompt Show me the tread and width of this staircase
|
|
1081
|
+
* @examplePrompt Read all the parameters of the stairs on level 1
|
|
1082
|
+
*
|
|
1083
|
+
* # Example
|
|
1084
|
+
* ```ts
|
|
1085
|
+
* const [stair] = await snaptrude.design.query.listStaircases({ isSelected: true })
|
|
1086
|
+
* const params = stair ? await snaptrude.design.query.getStaircaseParams(stair) : null
|
|
1087
|
+
* if (params) console.log(params.steps, params.riser, params.tread)
|
|
1088
|
+
* ```
|
|
1089
|
+
*/
|
|
1090
|
+
abstract getStaircaseParams(staircase: ComponentHandle): PluginApiReturn<PluginStaircaseParams | null>;
|
|
981
1091
|
/**
|
|
982
1092
|
* Get the **union** axis-aligned bounding box enclosing a set of entities.
|
|
983
1093
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/query/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/design/query/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AAQlE,OAAO,EAAE,4BAA4B,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAA;AAMrD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,gBAAgB;;;;;;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qBAAqB,GAAG,IAAI,CAAC;IAEhD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;aACa,cAAc,CAC5B,UAAU,EAAE,eAAe,EAAE,GAC5B,eAAe,CAAC,cAAc,GAAG,IAAI,CAAC;CAC1C;AAED,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA"}
|
|
@@ -90,6 +90,7 @@ export declare const PluginDesignQuerySpacesGetProperty: z.ZodEnum<{
|
|
|
90
90
|
position: "position";
|
|
91
91
|
id: "id";
|
|
92
92
|
name: "name";
|
|
93
|
+
storey: "storey";
|
|
93
94
|
height: "height";
|
|
94
95
|
depth: "depth";
|
|
95
96
|
innerProfiles: "innerProfiles";
|
|
@@ -99,7 +100,6 @@ export declare const PluginDesignQuerySpacesGetProperty: z.ZodEnum<{
|
|
|
99
100
|
massType: "massType";
|
|
100
101
|
spaceType: "spaceType";
|
|
101
102
|
areaClass: "areaClass";
|
|
102
|
-
storey: "storey";
|
|
103
103
|
departmentId: "departmentId";
|
|
104
104
|
departmentName: "departmentName";
|
|
105
105
|
departmentColor: "departmentColor";
|
|
@@ -126,6 +126,7 @@ export declare const PluginDesignQuerySpacesGetArgs: z.ZodObject<{
|
|
|
126
126
|
position: "position";
|
|
127
127
|
id: "id";
|
|
128
128
|
name: "name";
|
|
129
|
+
storey: "storey";
|
|
129
130
|
height: "height";
|
|
130
131
|
depth: "depth";
|
|
131
132
|
innerProfiles: "innerProfiles";
|
|
@@ -135,7 +136,6 @@ export declare const PluginDesignQuerySpacesGetArgs: z.ZodObject<{
|
|
|
135
136
|
massType: "massType";
|
|
136
137
|
spaceType: "spaceType";
|
|
137
138
|
areaClass: "areaClass";
|
|
138
|
-
storey: "storey";
|
|
139
139
|
departmentId: "departmentId";
|
|
140
140
|
departmentName: "departmentName";
|
|
141
141
|
departmentColor: "departmentColor";
|
|
@@ -162,6 +162,7 @@ export declare const PluginDesignQuerySpacesGetResult: z.ZodObject<{
|
|
|
162
162
|
}, z.core.$strip>>;
|
|
163
163
|
id: z.ZodOptional<z.ZodString>;
|
|
164
164
|
name: z.ZodOptional<z.ZodString>;
|
|
165
|
+
storey: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
165
166
|
height: z.ZodOptional<z.ZodNumber>;
|
|
166
167
|
depth: z.ZodOptional<z.ZodNumber>;
|
|
167
168
|
innerProfiles: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodUnion<readonly [z.ZodPipe<z.ZodString, z.ZodTransform<import("../../..").Handle<"line">, string>>, z.ZodPipe<z.ZodString, z.ZodTransform<import("../../..").Handle<"arc">, string>>]>>>>;
|
|
@@ -186,7 +187,6 @@ export declare const PluginDesignQuerySpacesGetResult: z.ZodObject<{
|
|
|
186
187
|
GROSS: "GROSS";
|
|
187
188
|
EXCLUDED: "EXCLUDED";
|
|
188
189
|
}>>;
|
|
189
|
-
storey: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
190
190
|
departmentId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
191
191
|
departmentName: z.ZodOptional<z.ZodString>;
|
|
192
192
|
departmentColor: z.ZodOptional<z.ZodString>;
|