@snaptrude/plugin-core 0.10.0 → 1.0.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/AGENTS.md +4 -0
- package/CHANGELOG.md +187 -3
- package/api-manifest.json +929 -25
- package/dist/api/analysis/daylight.d.ts +5 -5
- package/dist/api/analysis/solar.d.ts +2 -2
- package/dist/api/core/camera/index.d.ts +463 -0
- package/dist/api/core/camera/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +942 -101
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/brep.d.ts +59 -2
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/curve.d.ts +59 -35
- package/dist/api/core/geom/query/curve.d.ts.map +1 -1
- package/dist/api/core/geom/query/edge.d.ts +2 -2
- package/dist/api/core/geom/query/face.d.ts +105 -0
- package/dist/api/core/geom/query/face.d.ts.map +1 -1
- package/dist/api/core/geom/update/contour.d.ts +10 -2
- package/dist/api/core/geom/update/contour.d.ts.map +1 -1
- package/dist/api/core/geom/update/curve.d.ts +5 -5
- package/dist/api/core/geom/update/profile.d.ts +3 -1
- package/dist/api/core/geom/update/profile.d.ts.map +1 -1
- package/dist/api/core/handles/index.d.ts +4 -2
- package/dist/api/core/handles/index.d.ts.map +1 -1
- package/dist/api/core/index.d.ts +4 -4
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/import/index.d.ts +3 -1
- package/dist/api/core/io/import/index.d.ts.map +1 -1
- package/dist/api/core/layers.d.ts +377 -255
- package/dist/api/core/layers.d.ts.map +1 -1
- package/dist/api/core/mode/index.d.ts +19 -7
- package/dist/api/core/mode/index.d.ts.map +1 -1
- 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 +4 -3
- package/dist/api/core/proposals/index.d.ts.map +1 -1
- package/dist/api/core/storeys/index.d.ts +31 -2
- package/dist/api/core/storeys/index.d.ts.map +1 -1
- package/dist/api/core/storeys/layers.d.ts +408 -0
- package/dist/api/core/storeys/layers.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +84 -3
- package/dist/api/core/tags.d.ts.map +1 -1
- package/dist/api/core/zoom/index.d.ts +13 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -1
- package/dist/api/design/bim.d.ts +299 -0
- package/dist/api/design/bim.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +2 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -1
- package/dist/api/design/catalog.d.ts +320 -0
- package/dist/api/design/catalog.d.ts.map +1 -0
- package/dist/api/design/create/bulk-items.d.ts +269 -0
- package/dist/api/design/create/bulk-items.d.ts.map +1 -0
- package/dist/api/design/create/grids.d.ts +132 -0
- package/dist/api/design/create/grids.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +752 -78
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/create/opening-fields.d.ts +38 -0
- package/dist/api/design/create/opening-fields.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +5 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/dimensions.d.ts +427 -0
- package/dist/api/design/dimensions.d.ts.map +1 -0
- package/dist/api/design/doors/index.d.ts +24 -23
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +1446 -0
- package/dist/api/design/family.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +33 -0
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/grids.d.ts +237 -0
- package/dist/api/design/grids.d.ts.map +1 -0
- package/dist/api/design/index.d.ts +30 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/networks.d.ts +1703 -0
- package/dist/api/design/networks.d.ts.map +1 -0
- package/dist/api/design/query/geometry/index.d.ts +33 -5
- package/dist/api/design/query/geometry/index.d.ts.map +1 -1
- package/dist/api/design/query/grids.d.ts +287 -0
- package/dist/api/design/query/grids.d.ts.map +1 -0
- package/dist/api/design/query/index.d.ts +143 -34
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/spaces.d.ts +5 -5
- package/dist/api/design/selection/index.d.ts +12 -12
- package/dist/api/design/types/index.d.ts +40 -24
- package/dist/api/design/types/index.d.ts.map +1 -1
- package/dist/api/design/update/index.d.ts +412 -8
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/visibility.d.ts +28 -0
- package/dist/api/design/visibility.d.ts.map +1 -1
- package/dist/api/design/windows/index.d.ts +8 -8
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/entity/buildableEnvelope.d.ts +84 -2
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +13 -1
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +12 -12
- package/dist/api/entity/story.d.ts +4 -4
- package/dist/api/presentation/aiInspiration.d.ts +24 -24
- package/dist/api/presentation/annotate.d.ts +38 -22
- package/dist/api/presentation/annotate.d.ts.map +1 -1
- package/dist/api/presentation/camera.d.ts +265 -0
- package/dist/api/presentation/camera.d.ts.map +1 -0
- package/dist/api/presentation/drawingContract.d.ts +32 -0
- package/dist/api/presentation/drawingContract.d.ts.map +1 -0
- package/dist/api/presentation/drawings.d.ts +3523 -0
- package/dist/api/presentation/drawings.d.ts.map +1 -0
- package/dist/api/presentation/export.d.ts +23 -5
- package/dist/api/presentation/export.d.ts.map +1 -1
- package/dist/api/presentation/graphics.d.ts +419 -0
- package/dist/api/presentation/graphics.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +66 -12
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +116 -16
- package/dist/api/presentation/placedViews.d.ts.map +1 -1
- package/dist/api/presentation/sections.d.ts +461 -0
- package/dist/api/presentation/sections.d.ts.map +1 -0
- package/dist/api/presentation/shapes.d.ts +2 -2
- package/dist/api/presentation/sheets.d.ts +175 -19
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/standards.d.ts +590 -0
- package/dist/api/presentation/standards.d.ts.map +1 -0
- package/dist/api/presentation/viewPresets.d.ts +222 -0
- package/dist/api/presentation/viewPresets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +144 -9
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/presentation/walkthroughs.d.ts +1350 -0
- package/dist/api/presentation/walkthroughs.d.ts.map +1 -0
- package/dist/api/program/departments.d.ts +58 -2
- package/dist/api/program/departments.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +16 -6
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/labels.d.ts +355 -0
- package/dist/api/program/labels.d.ts.map +1 -0
- package/dist/api/program/metadata.d.ts +328 -0
- package/dist/api/program/metadata.d.ts.map +1 -0
- package/dist/api/program/site.d.ts +4 -4
- package/dist/api/program/spreadsheet.d.ts +267 -4
- package/dist/api/program/spreadsheet.d.ts.map +1 -1
- package/dist/api/workspace/index.d.ts +49 -2
- package/dist/api/workspace/index.d.ts.map +1 -1
- package/dist/errors/codes.d.ts +3 -1
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/handles.d.ts +32 -3
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +6539 -2804
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6121 -2801
- package/dist/index.js.map +1 -1
- package/dist/massParameters.d.ts +287 -0
- package/dist/massParameters.d.ts.map +1 -0
- package/dist/massParameters.ops.d.ts +138 -0
- package/dist/massParameters.ops.d.ts.map +1 -0
- package/package.json +14 -13
- package/scripts/check-dist-fresh.mjs +22 -0
- package/scripts/generate-manifest.mjs +5 -0
- package/scripts/generate-manifest.test.mjs +14 -3
- package/src/api/core/camera/index.ts +446 -1
- package/src/api/core/geom/create/index.ts +1037 -102
- package/src/api/core/geom/query/brep.ts +60 -2
- package/src/api/core/geom/query/curve.ts +26 -2
- package/src/api/core/geom/query/edge.ts +2 -2
- package/src/api/core/geom/query/face.ts +109 -4
- package/src/api/core/geom/update/contour.ts +10 -2
- package/src/api/core/geom/update/profile.ts +2 -0
- package/src/api/core/handles/index.ts +3 -2
- package/src/api/core/index.ts +4 -4
- package/src/api/core/io/import/index.ts +11 -3
- package/src/api/core/layers.ts +380 -173
- package/src/api/core/mode/index.ts +19 -7
- package/src/api/core/project/index.ts +62 -1
- package/src/api/core/proposals/index.ts +4 -3
- package/src/api/core/storeys/index.ts +34 -2
- package/src/api/core/storeys/layers.ts +339 -0
- package/src/api/core/tags.ts +76 -0
- package/src/api/core/zoom/index.ts +13 -0
- package/src/api/design/bim.ts +210 -0
- package/src/api/design/boolean/index.ts +2 -0
- package/src/api/design/catalog.ts +203 -0
- package/src/api/design/create/bulk-items.ts +294 -0
- package/src/api/design/create/grids.ts +137 -0
- package/src/api/design/create/index.ts +823 -114
- package/src/api/design/create/opening-fields.ts +40 -0
- package/src/api/design/delete/index.ts +5 -0
- package/src/api/design/dimensions.ts +453 -0
- package/src/api/design/doors/index.ts +64 -41
- package/src/api/design/family.ts +1342 -0
- package/src/api/design/furniture/index.ts +34 -0
- package/src/api/design/grids.ts +237 -0
- package/src/api/design/index.ts +49 -4
- package/src/api/design/networks.ts +607 -0
- package/src/api/design/query/geometry/index.ts +35 -4
- package/src/api/design/query/grids.ts +197 -0
- package/src/api/design/query/index.ts +105 -3
- package/src/api/design/types/index.ts +31 -24
- package/src/api/design/update/index.ts +398 -4
- package/src/api/design/visibility.ts +34 -0
- package/src/api/design/windows/index.ts +40 -22
- package/src/api/entity/buildableEnvelope.ts +77 -2
- package/src/api/entity/referenceLine.ts +25 -12
- package/src/api/presentation/annotate.ts +90 -58
- package/src/api/presentation/camera.ts +289 -0
- package/src/api/presentation/drawingContract.ts +70 -0
- package/src/api/presentation/drawings.ts +1179 -0
- package/src/api/presentation/export.ts +32 -6
- package/src/api/presentation/graphics.ts +324 -0
- package/src/api/presentation/index.ts +73 -14
- package/src/api/presentation/placedViews.ts +119 -28
- package/src/api/presentation/sections.ts +420 -0
- package/src/api/presentation/sheets.ts +181 -20
- package/src/api/presentation/standards.ts +445 -0
- package/src/api/presentation/viewPresets.ts +241 -0
- package/src/api/presentation/views.ts +81 -10
- package/src/api/presentation/walkthroughs.ts +1201 -0
- package/src/api/program/departments.ts +54 -2
- package/src/api/program/index.ts +16 -6
- package/src/api/program/labels.ts +332 -0
- package/src/api/program/metadata.ts +364 -0
- package/src/api/program/spreadsheet.ts +282 -0
- package/src/api/workspace/index.ts +51 -2
- package/src/errors/codes.ts +7 -0
- package/src/handles.ts +42 -3
- package/src/index.ts +2 -0
- package/src/massParameters.ops.ts +246 -0
- package/src/massParameters.ts +427 -0
- package/test/drawingContract.test.mjs +288 -0
- package/test/errors.test.mjs +1 -0
- package/test/massParameters.test.mjs +952 -0
- package/test/paperPensContract.test.mjs +75 -0
- package/test/presentationViewSettings.test.mjs +85 -0
|
@@ -10,13 +10,14 @@ import { PluginObjectCatalogGroup, PluginObjectCatalogItem } from "../doors"
|
|
|
10
10
|
* at `design.query.*`. Window targets are {@linkcode ComponentHandle}s.
|
|
11
11
|
*
|
|
12
12
|
* The **catalog** reads (`listCatalogGroups`/`listCatalog`/`getCatalogItem`/`exists`)
|
|
13
|
-
* browse
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* (`[]`/`null`). The {@linkcode PluginObjectCatalogGroup} / {@linkcode PluginObjectCatalogItem}
|
|
13
|
+
* browse saved hosted window families, keyed by definition ID, and feed design.create.window.
|
|
14
|
+
* They reject if saved definitions cannot be loaded completely. A missing item returns null.
|
|
15
|
+
* The {@linkcode PluginObjectCatalogGroup} / {@linkcode PluginObjectCatalogItem}
|
|
17
16
|
* DTOs are shared with `design.doors` (defined there, re-exported here).
|
|
18
17
|
*
|
|
19
|
-
*
|
|
18
|
+
* PC-only: dimensions read the evaluated opening and host thickness in SU. Setters
|
|
19
|
+
* write declared width/height parameters, never mesh scale. Missing or derived
|
|
20
|
+
* controls reject. Use design.family.setParameters for sill and other controls.
|
|
20
21
|
*/
|
|
21
22
|
export abstract class PluginDesignWindowsApi {
|
|
22
23
|
constructor() {}
|
|
@@ -40,7 +41,9 @@ export abstract class PluginDesignWindowsApi {
|
|
|
40
41
|
* if (type) console.log("window type:", type)
|
|
41
42
|
* ```
|
|
42
43
|
*/
|
|
43
|
-
public abstract getType(
|
|
44
|
+
public abstract getType(
|
|
45
|
+
window: ComponentHandle,
|
|
46
|
+
): PluginApiReturn<string | null>
|
|
44
47
|
|
|
45
48
|
/**
|
|
46
49
|
* Get the width of a window — how wide its opening is along the host wall.
|
|
@@ -60,7 +63,9 @@ export abstract class PluginDesignWindowsApi {
|
|
|
60
63
|
* if (width !== null) console.log("window width:", width)
|
|
61
64
|
* ```
|
|
62
65
|
*/
|
|
63
|
-
public abstract getWidth(
|
|
66
|
+
public abstract getWidth(
|
|
67
|
+
window: ComponentHandle,
|
|
68
|
+
): PluginApiReturn<number | null>
|
|
64
69
|
|
|
65
70
|
/**
|
|
66
71
|
* Get the height of a window — how tall its opening is on the host wall.
|
|
@@ -80,12 +85,13 @@ export abstract class PluginDesignWindowsApi {
|
|
|
80
85
|
* if (height !== null) console.log("window height:", height)
|
|
81
86
|
* ```
|
|
82
87
|
*/
|
|
83
|
-
public abstract getHeight(
|
|
88
|
+
public abstract getHeight(
|
|
89
|
+
window: ComponentHandle,
|
|
90
|
+
): PluginApiReturn<number | null>
|
|
84
91
|
|
|
85
92
|
/**
|
|
86
|
-
* Get
|
|
87
|
-
*
|
|
88
|
-
* oriented space.
|
|
93
|
+
* Get evaluated opening width/height and host thickness in Snaptrude units.
|
|
94
|
+
* The opening can differ from the width/height input parameters.
|
|
89
95
|
*
|
|
90
96
|
* @param window The window to query
|
|
91
97
|
* @returns The dimensions, or `null`
|
|
@@ -104,7 +110,7 @@ export abstract class PluginDesignWindowsApi {
|
|
|
104
110
|
* ```
|
|
105
111
|
*/
|
|
106
112
|
public abstract getDimensions(
|
|
107
|
-
window: ComponentHandle
|
|
113
|
+
window: ComponentHandle,
|
|
108
114
|
): PluginApiReturn<PluginWindowDimensions | null>
|
|
109
115
|
|
|
110
116
|
/**
|
|
@@ -129,7 +135,7 @@ export abstract class PluginDesignWindowsApi {
|
|
|
129
135
|
*/
|
|
130
136
|
public abstract setWidth(
|
|
131
137
|
window: ComponentHandle,
|
|
132
|
-
width: number
|
|
138
|
+
width: number,
|
|
133
139
|
): PluginApiReturn<PluginDesignChangeResult>
|
|
134
140
|
|
|
135
141
|
/**
|
|
@@ -153,7 +159,7 @@ export abstract class PluginDesignWindowsApi {
|
|
|
153
159
|
*/
|
|
154
160
|
public abstract setHeight(
|
|
155
161
|
window: ComponentHandle,
|
|
156
|
-
height: number
|
|
162
|
+
height: number,
|
|
157
163
|
): PluginApiReturn<PluginDesignChangeResult>
|
|
158
164
|
|
|
159
165
|
/**
|
|
@@ -174,7 +180,9 @@ export abstract class PluginDesignWindowsApi {
|
|
|
174
180
|
* for (const g of groups) console.log(g.dbType, g.label, g.source)
|
|
175
181
|
* ```
|
|
176
182
|
*/
|
|
177
|
-
public abstract listCatalogGroups(): PluginApiReturn<
|
|
183
|
+
public abstract listCatalogGroups(): PluginApiReturn<
|
|
184
|
+
PluginObjectCatalogGroup[]
|
|
185
|
+
>
|
|
178
186
|
|
|
179
187
|
/**
|
|
180
188
|
* List the placeable window catalog (team + general libraries), optionally
|
|
@@ -196,7 +204,7 @@ export abstract class PluginDesignWindowsApi {
|
|
|
196
204
|
* ```
|
|
197
205
|
*/
|
|
198
206
|
public abstract listCatalog(
|
|
199
|
-
group?: string
|
|
207
|
+
group?: string,
|
|
200
208
|
): PluginApiReturn<PluginObjectCatalogItem[]>
|
|
201
209
|
|
|
202
210
|
/**
|
|
@@ -218,7 +226,7 @@ export abstract class PluginDesignWindowsApi {
|
|
|
218
226
|
* ```
|
|
219
227
|
*/
|
|
220
228
|
public abstract getCatalogItem(
|
|
221
|
-
id: string
|
|
229
|
+
id: string,
|
|
222
230
|
): PluginApiReturn<PluginObjectCatalogItem | null>
|
|
223
231
|
|
|
224
232
|
/**
|
|
@@ -282,7 +290,9 @@ export const PluginDesignWindowSetWidthArgs = z.object({
|
|
|
282
290
|
window: ComponentHandle,
|
|
283
291
|
width: z.number(),
|
|
284
292
|
})
|
|
285
|
-
export type PluginDesignWindowSetWidthArgs = z.infer<
|
|
293
|
+
export type PluginDesignWindowSetWidthArgs = z.infer<
|
|
294
|
+
typeof PluginDesignWindowSetWidthArgs
|
|
295
|
+
>
|
|
286
296
|
|
|
287
297
|
/**
|
|
288
298
|
* Arguments for {@linkcode PluginDesignWindowsApi.setHeight}.
|
|
@@ -296,7 +306,9 @@ export const PluginDesignWindowSetHeightArgs = z.object({
|
|
|
296
306
|
window: ComponentHandle,
|
|
297
307
|
height: z.number(),
|
|
298
308
|
})
|
|
299
|
-
export type PluginDesignWindowSetHeightArgs = z.infer<
|
|
309
|
+
export type PluginDesignWindowSetHeightArgs = z.infer<
|
|
310
|
+
typeof PluginDesignWindowSetHeightArgs
|
|
311
|
+
>
|
|
300
312
|
|
|
301
313
|
// ---------------------------------------------------------------------------
|
|
302
314
|
// catalog (shared DTOs defined in ../doors, re-exported here for symmetry)
|
|
@@ -315,7 +327,9 @@ export { PluginObjectCatalogGroup, PluginObjectCatalogItem }
|
|
|
315
327
|
export const PluginDesignWindowListCatalogArgs = z.object({
|
|
316
328
|
group: z.string().optional(),
|
|
317
329
|
})
|
|
318
|
-
export type PluginDesignWindowListCatalogArgs = z.infer<
|
|
330
|
+
export type PluginDesignWindowListCatalogArgs = z.infer<
|
|
331
|
+
typeof PluginDesignWindowListCatalogArgs
|
|
332
|
+
>
|
|
319
333
|
|
|
320
334
|
/**
|
|
321
335
|
* Arguments for {@linkcode PluginDesignWindowsApi.getCatalogItem} / {@linkcode PluginDesignWindowsApi.exists}.
|
|
@@ -327,7 +341,11 @@ export type PluginDesignWindowListCatalogArgs = z.infer<typeof PluginDesignWindo
|
|
|
327
341
|
export const PluginDesignWindowGetCatalogItemArgs = z.object({
|
|
328
342
|
id: z.string(),
|
|
329
343
|
})
|
|
330
|
-
export type PluginDesignWindowGetCatalogItemArgs = z.infer<
|
|
344
|
+
export type PluginDesignWindowGetCatalogItemArgs = z.infer<
|
|
345
|
+
typeof PluginDesignWindowGetCatalogItemArgs
|
|
346
|
+
>
|
|
331
347
|
|
|
332
348
|
export const PluginDesignWindowExistsArgs = PluginDesignWindowGetCatalogItemArgs
|
|
333
|
-
export type PluginDesignWindowExistsArgs = z.infer<
|
|
349
|
+
export type PluginDesignWindowExistsArgs = z.infer<
|
|
350
|
+
typeof PluginDesignWindowExistsArgs
|
|
351
|
+
>
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import * as z from "zod"
|
|
2
2
|
import { PluginApiReturn } from "../../types"
|
|
3
|
+
import {
|
|
4
|
+
PluginProgramSiteEdgeRole,
|
|
5
|
+
PluginProgramSiteEdgesEntry,
|
|
6
|
+
} from "../program/site"
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
9
|
* Buildable Envelope management — create and update parametric zoning envelopes.
|
|
@@ -72,6 +76,11 @@ export abstract class PluginBuildableEnvelopeApi {
|
|
|
72
76
|
* volume from a revised site polygon, setbacks, vertical cap, or FAR and
|
|
73
77
|
* lot-coverage limits, keeping the same envelope id.
|
|
74
78
|
*
|
|
79
|
+
* Edge state is preserved, like the right panel: every edge's type
|
|
80
|
+
* (front/side/rear) is kept. For each type whose value changed (by more than
|
|
81
|
+
* 2 mm), the per-edge custom distances on edges of that type are cleared;
|
|
82
|
+
* custom distances on types whose value did not change are kept.
|
|
83
|
+
*
|
|
75
84
|
* @param buildableEnvelopeId - Existing envelope ID to update; non-empty and
|
|
76
85
|
* must match an existing envelope on the canvas.
|
|
77
86
|
* @param sitePolygon - Site polygon vertices in `lengthUnit`; minimum 3 vertices.
|
|
@@ -82,9 +91,15 @@ export abstract class PluginBuildableEnvelopeApi {
|
|
|
82
91
|
* @param farRatio - Optional FAR value, positive when provided.
|
|
83
92
|
* @param lotCoverageMaxPct - Optional lot coverage cap, `0..100`.
|
|
84
93
|
* @returns A {@linkcode PluginBuildableEnvelopeUpdateResult} with the
|
|
85
|
-
* `buildableEnvelopeId` of the updated envelope
|
|
94
|
+
* `buildableEnvelopeId` of the updated envelope and `clearedEdgeSetbacks`,
|
|
95
|
+
* the `edgeIndex` of each edge that lost its custom distance (empty when
|
|
96
|
+
* none). Tell the user about any cleared edges.
|
|
86
97
|
* @throws If validation fails, the envelope does not exist, or generation
|
|
87
|
-
* produces no renderable geometry.
|
|
98
|
+
* produces no renderable geometry. Also throws `PRECONDITION_FAILED`
|
|
99
|
+
* (`details.reason: "STALE_EDGE_SETTINGS"`, nothing changes) when the site
|
|
100
|
+
* outline changed since the edge settings were made. Tell the user;
|
|
101
|
+
* editing any edge on the canvas setback pills resets the edge settings
|
|
102
|
+
* to the new outline (dropping the old ones), after which you can retry.
|
|
88
103
|
*
|
|
89
104
|
* @examplePrompt Change the envelope's height limit to 175 feet
|
|
90
105
|
* @examplePrompt Update the setbacks on the buildable envelope
|
|
@@ -312,11 +327,71 @@ export type PluginBuildableEnvelopeUpdateArgs = z.infer<
|
|
|
312
327
|
* | Property | Type | Description |
|
|
313
328
|
* |---|---|---|
|
|
314
329
|
* | `buildableEnvelopeId` | `string` | Non-empty unique ID of the updated buildable envelope |
|
|
330
|
+
* | `clearedEdgeSetbacks` | `number[]` | `edgeIndex` of every edge whose own custom distance was cleared because its type's (front/side/rear) value changed; empty when none |
|
|
315
331
|
*/
|
|
316
332
|
export const PluginBuildableEnvelopeUpdateResult = z.object({
|
|
317
333
|
buildableEnvelopeId: z.string().min(1),
|
|
334
|
+
clearedEdgeSetbacks: z.array(z.number().int().nonnegative()),
|
|
318
335
|
}).strict()
|
|
319
336
|
|
|
320
337
|
export type PluginBuildableEnvelopeUpdateResult = z.infer<
|
|
321
338
|
typeof PluginBuildableEnvelopeUpdateResult
|
|
322
339
|
>
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Patch for one site edge, as taken by `design.update.siteEdge`.
|
|
343
|
+
*
|
|
344
|
+
* Strict schema. Provide `role`, `setback`, or both. A numeric `setback`
|
|
345
|
+
* requires `lengthUnit`.
|
|
346
|
+
*
|
|
347
|
+
* | Property | Type | Description |
|
|
348
|
+
* |---|---|---|
|
|
349
|
+
* | `role` | `"front" \| "side" \| "rear"`? | New edge type. Setting it clears the edge's own distance |
|
|
350
|
+
* | `setback` | `number \| null`? | This edge's own setback distance in `lengthUnit` (finite, nonnegative); `null` clears it so the edge falls back to its type's distance |
|
|
351
|
+
* | `lengthUnit` | `"m" \| "ft"`? | Unit of `setback`; required when `setback` is a number |
|
|
352
|
+
*/
|
|
353
|
+
export const PluginSiteEdgePatch = z
|
|
354
|
+
.object({
|
|
355
|
+
role: PluginProgramSiteEdgeRole.optional(),
|
|
356
|
+
// null = clear this edge's own distance
|
|
357
|
+
setback: z.number().finite().nonnegative().nullable().optional(),
|
|
358
|
+
lengthUnit: z.enum(["m", "ft"]).optional(),
|
|
359
|
+
})
|
|
360
|
+
.strict()
|
|
361
|
+
.refine(
|
|
362
|
+
(p) => p.role !== undefined || p.setback !== undefined,
|
|
363
|
+
"patch must set role and/or setback"
|
|
364
|
+
)
|
|
365
|
+
.refine(
|
|
366
|
+
(p) => typeof p.setback !== "number" || p.lengthUnit !== undefined,
|
|
367
|
+
"lengthUnit is required with a numeric setback"
|
|
368
|
+
)
|
|
369
|
+
|
|
370
|
+
export type PluginSiteEdgePatch = z.infer<typeof PluginSiteEdgePatch>
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Result of `design.update.siteEdge` — the refreshed edge entry for the
|
|
374
|
+
* site, exactly as `program.site.listEdges()` returns it.
|
|
375
|
+
*/
|
|
376
|
+
export const PluginDesignUpdateSiteEdgeResult = PluginProgramSiteEdgesEntry
|
|
377
|
+
|
|
378
|
+
export type PluginDesignUpdateSiteEdgeResult = z.infer<
|
|
379
|
+
typeof PluginDesignUpdateSiteEdgeResult
|
|
380
|
+
>
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Result of `design.create.buildableEnvelopeFromSite`.
|
|
384
|
+
*
|
|
385
|
+
* | Property | Type | Description |
|
|
386
|
+
* |---|---|---|
|
|
387
|
+
* | `buildableEnvelopeId` | `string` | ID of the created buildable envelope |
|
|
388
|
+
*/
|
|
389
|
+
export const PluginDesignCreateBuildableEnvelopeFromSiteResult = z
|
|
390
|
+
.object({
|
|
391
|
+
buildableEnvelopeId: z.string(),
|
|
392
|
+
})
|
|
393
|
+
.strict()
|
|
394
|
+
|
|
395
|
+
export type PluginDesignCreateBuildableEnvelopeFromSiteResult = z.infer<
|
|
396
|
+
typeof PluginDesignCreateBuildableEnvelopeFromSiteResult
|
|
397
|
+
>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as z from "zod"
|
|
2
2
|
import { PluginApiReturn } from "../../types"
|
|
3
3
|
import { ProfileHandle, CurveHandle } from "../../handles"
|
|
4
|
+
import { PluginGraphicsLineStyleId } from "../presentation/graphics"
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Reference line management — create, query, and delete reference lines.
|
|
@@ -53,7 +54,7 @@ export abstract class PluginReferenceLineApi {
|
|
|
53
54
|
* @deprecated Use `design.create.referenceLines`
|
|
54
55
|
*/
|
|
55
56
|
public abstract createMulti(
|
|
56
|
-
profile: ProfileHandle
|
|
57
|
+
profile: ProfileHandle,
|
|
57
58
|
): PluginApiReturn<PluginReferenceLineCreateMultiResult>
|
|
58
59
|
|
|
59
60
|
/**
|
|
@@ -85,7 +86,7 @@ export abstract class PluginReferenceLineApi {
|
|
|
85
86
|
*/
|
|
86
87
|
public abstract get(
|
|
87
88
|
referenceLineId: string,
|
|
88
|
-
properties: z.infer<typeof PluginReferenceLineGetProperty>[]
|
|
89
|
+
properties: z.infer<typeof PluginReferenceLineGetProperty>[],
|
|
89
90
|
): PluginApiReturn<PluginReferenceLineGetResult>
|
|
90
91
|
|
|
91
92
|
/**
|
|
@@ -135,7 +136,7 @@ export abstract class PluginReferenceLineApi {
|
|
|
135
136
|
* @deprecated Use `design.delete.entities`
|
|
136
137
|
*/
|
|
137
138
|
public abstract delete(
|
|
138
|
-
referenceLineId: string
|
|
139
|
+
referenceLineId: string,
|
|
139
140
|
): PluginApiReturn<PluginReferenceLineDeleteResult>
|
|
140
141
|
}
|
|
141
142
|
|
|
@@ -150,7 +151,9 @@ export const PluginReferenceLineCreateMultiArgs = z.object({
|
|
|
150
151
|
profile: ProfileHandle,
|
|
151
152
|
})
|
|
152
153
|
|
|
153
|
-
export type PluginReferenceLineCreateMultiArgs = z.infer<
|
|
154
|
+
export type PluginReferenceLineCreateMultiArgs = z.infer<
|
|
155
|
+
typeof PluginReferenceLineCreateMultiArgs
|
|
156
|
+
>
|
|
154
157
|
|
|
155
158
|
/**
|
|
156
159
|
* Result of {@linkcode PluginReferenceLineApi.createMulti}.
|
|
@@ -163,7 +166,9 @@ export const PluginReferenceLineCreateMultiResult = z.object({
|
|
|
163
166
|
referenceLineIds: z.array(z.string()),
|
|
164
167
|
})
|
|
165
168
|
|
|
166
|
-
export type PluginReferenceLineCreateMultiResult = z.infer<
|
|
169
|
+
export type PluginReferenceLineCreateMultiResult = z.infer<
|
|
170
|
+
typeof PluginReferenceLineCreateMultiResult
|
|
171
|
+
>
|
|
167
172
|
|
|
168
173
|
/**
|
|
169
174
|
* Available properties that can be queried on a reference line.
|
|
@@ -171,10 +176,9 @@ export type PluginReferenceLineCreateMultiResult = z.infer<typeof PluginReferenc
|
|
|
171
176
|
* | Value | Return Type | Description |
|
|
172
177
|
* |---|---|---|
|
|
173
178
|
* | `"curve"` | {@linkcode CurveHandle} | The curve geometry of the reference line, as an opaque handle |
|
|
179
|
+
* | `"styleId"` | `PluginGraphicsLineStyleId \| null` | Project style, or null for an unstyled legacy line |
|
|
174
180
|
*/
|
|
175
|
-
export const PluginReferenceLineGetProperty = z.enum([
|
|
176
|
-
"curve",
|
|
177
|
-
])
|
|
181
|
+
export const PluginReferenceLineGetProperty = z.enum(["curve", "styleId"])
|
|
178
182
|
|
|
179
183
|
/**
|
|
180
184
|
* Arguments for {@linkcode PluginReferenceLineApi.get}.
|
|
@@ -189,7 +193,9 @@ export const PluginReferenceLineGetArgs = z.object({
|
|
|
189
193
|
properties: z.array(PluginReferenceLineGetProperty),
|
|
190
194
|
})
|
|
191
195
|
|
|
192
|
-
export type PluginReferenceLineGetArgs = z.infer<
|
|
196
|
+
export type PluginReferenceLineGetArgs = z.infer<
|
|
197
|
+
typeof PluginReferenceLineGetArgs
|
|
198
|
+
>
|
|
193
199
|
|
|
194
200
|
/**
|
|
195
201
|
* Result of {@linkcode PluginReferenceLineApi.get}.
|
|
@@ -200,10 +206,13 @@ export type PluginReferenceLineGetArgs = z.infer<typeof PluginReferenceLineGetAr
|
|
|
200
206
|
export const PluginReferenceLineGetResult = z
|
|
201
207
|
.object({
|
|
202
208
|
curve: CurveHandle,
|
|
209
|
+
styleId: PluginGraphicsLineStyleId.nullable(),
|
|
203
210
|
})
|
|
204
211
|
.partial()
|
|
205
212
|
|
|
206
|
-
export type PluginReferenceLineGetResult = z.infer<
|
|
213
|
+
export type PluginReferenceLineGetResult = z.infer<
|
|
214
|
+
typeof PluginReferenceLineGetResult
|
|
215
|
+
>
|
|
207
216
|
|
|
208
217
|
/**
|
|
209
218
|
* Result of {@linkcode PluginReferenceLineApi.getAll}.
|
|
@@ -216,7 +225,9 @@ export const PluginReferenceLineGetAllResult = z.object({
|
|
|
216
225
|
referenceLineIds: z.array(z.string()),
|
|
217
226
|
})
|
|
218
227
|
|
|
219
|
-
export type PluginReferenceLineGetAllResult = z.infer<
|
|
228
|
+
export type PluginReferenceLineGetAllResult = z.infer<
|
|
229
|
+
typeof PluginReferenceLineGetAllResult
|
|
230
|
+
>
|
|
220
231
|
|
|
221
232
|
/**
|
|
222
233
|
* Arguments for {@linkcode PluginReferenceLineApi.delete}.
|
|
@@ -229,7 +240,9 @@ export const PluginReferenceLineDeleteArgs = z.object({
|
|
|
229
240
|
referenceLineId: z.string(),
|
|
230
241
|
})
|
|
231
242
|
|
|
232
|
-
export type PluginReferenceLineDeleteArgs = z.infer<
|
|
243
|
+
export type PluginReferenceLineDeleteArgs = z.infer<
|
|
244
|
+
typeof PluginReferenceLineDeleteArgs
|
|
245
|
+
>
|
|
233
246
|
|
|
234
247
|
/** Result type for {@linkcode PluginReferenceLineApi.delete} — returns nothing on success. */
|
|
235
248
|
export type PluginReferenceLineDeleteResult = void
|