@snaptrude/plugin-core 0.0.0-bimsvg-20260928124803
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 +231 -0
- package/CHANGELOG.md +341 -0
- package/CLAUDE.md +11 -0
- package/api-manifest.json +9120 -0
- package/dist/api/analysis/daylight.d.ts +603 -0
- package/dist/api/analysis/daylight.d.ts.map +1 -0
- package/dist/api/analysis/heatmaps.d.ts +658 -0
- package/dist/api/analysis/heatmaps.d.ts.map +1 -0
- package/dist/api/analysis/illuminance.d.ts +145 -0
- package/dist/api/analysis/illuminance.d.ts.map +1 -0
- package/dist/api/analysis/index.d.ts +59 -0
- package/dist/api/analysis/index.d.ts.map +1 -0
- package/dist/api/analysis/shadows.d.ts +165 -0
- package/dist/api/analysis/shadows.d.ts.map +1 -0
- package/dist/api/analysis/solar.d.ts +249 -0
- package/dist/api/analysis/solar.d.ts.map +1 -0
- package/dist/api/analysis/sunlightHours.d.ts +208 -0
- package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
- package/dist/api/analysis/sunpath.d.ts +80 -0
- package/dist/api/analysis/sunpath.d.ts.map +1 -0
- package/dist/api/analysis/weather.d.ts +193 -0
- package/dist/api/analysis/weather.d.ts.map +1 -0
- package/dist/api/core/buildings.d.ts +427 -0
- package/dist/api/core/buildings.d.ts.map +1 -0
- package/dist/api/core/camera/index.d.ts +261 -0
- package/dist/api/core/camera/index.d.ts.map +1 -0
- package/dist/api/core/comment/index.d.ts +333 -0
- package/dist/api/core/comment/index.d.ts.map +1 -0
- package/dist/api/core/geom/create/index.d.ts +1073 -0
- package/dist/api/core/geom/create/index.d.ts.map +1 -0
- package/dist/api/core/geom/delete/index.d.ts +78 -0
- package/dist/api/core/geom/delete/index.d.ts.map +1 -0
- package/dist/api/core/geom/index.d.ts +33 -0
- package/dist/api/core/geom/index.d.ts.map +1 -0
- package/dist/api/core/geom/query/arc.d.ts +169 -0
- package/dist/api/core/geom/query/arc.d.ts.map +1 -0
- package/dist/api/core/geom/query/brep.d.ts +514 -0
- package/dist/api/core/geom/query/brep.d.ts.map +1 -0
- package/dist/api/core/geom/query/circle.d.ts +378 -0
- package/dist/api/core/geom/query/circle.d.ts.map +1 -0
- package/dist/api/core/geom/query/contour.d.ts +450 -0
- package/dist/api/core/geom/query/contour.d.ts.map +1 -0
- package/dist/api/core/geom/query/curve.d.ts +918 -0
- package/dist/api/core/geom/query/curve.d.ts.map +1 -0
- package/dist/api/core/geom/query/edge.d.ts +128 -0
- package/dist/api/core/geom/query/edge.d.ts.map +1 -0
- package/dist/api/core/geom/query/face.d.ts +363 -0
- package/dist/api/core/geom/query/face.d.ts.map +1 -0
- package/dist/api/core/geom/query/halfedge.d.ts +206 -0
- package/dist/api/core/geom/query/halfedge.d.ts.map +1 -0
- package/dist/api/core/geom/query/index.d.ts +61 -0
- package/dist/api/core/geom/query/index.d.ts.map +1 -0
- package/dist/api/core/geom/query/profile.d.ts +410 -0
- package/dist/api/core/geom/query/profile.d.ts.map +1 -0
- package/dist/api/core/geom/query/vertex.d.ts +187 -0
- package/dist/api/core/geom/query/vertex.d.ts.map +1 -0
- package/dist/api/core/geom/update/contour.d.ts +272 -0
- package/dist/api/core/geom/update/contour.d.ts.map +1 -0
- package/dist/api/core/geom/update/curve.d.ts +180 -0
- package/dist/api/core/geom/update/curve.d.ts.map +1 -0
- package/dist/api/core/geom/update/index.d.ts +27 -0
- package/dist/api/core/geom/update/index.d.ts.map +1 -0
- package/dist/api/core/geom/update/profile.d.ts +329 -0
- package/dist/api/core/geom/update/profile.d.ts.map +1 -0
- package/dist/api/core/groups.d.ts +485 -0
- package/dist/api/core/groups.d.ts.map +1 -0
- package/dist/api/core/handles/index.d.ts +210 -0
- package/dist/api/core/handles/index.d.ts.map +1 -0
- package/dist/api/core/history/index.d.ts +78 -0
- package/dist/api/core/history/index.d.ts.map +1 -0
- package/dist/api/core/index.d.ts +97 -0
- package/dist/api/core/index.d.ts.map +1 -0
- package/dist/api/core/io/export/index.d.ts +134 -0
- package/dist/api/core/io/export/index.d.ts.map +1 -0
- package/dist/api/core/io/import/index.d.ts +455 -0
- package/dist/api/core/io/import/index.d.ts.map +1 -0
- package/dist/api/core/io/index.d.ts +40 -0
- package/dist/api/core/io/index.d.ts.map +1 -0
- package/dist/api/core/io/job/index.d.ts +139 -0
- package/dist/api/core/io/job/index.d.ts.map +1 -0
- package/dist/api/core/io/query/index.d.ts +74 -0
- package/dist/api/core/io/query/index.d.ts.map +1 -0
- package/dist/api/core/io/terrain/index.d.ts +341 -0
- package/dist/api/core/io/terrain/index.d.ts.map +1 -0
- package/dist/api/core/io/underlay/index.d.ts +805 -0
- package/dist/api/core/io/underlay/index.d.ts.map +1 -0
- package/dist/api/core/layers.d.ts +402 -0
- package/dist/api/core/layers.d.ts.map +1 -0
- package/dist/api/core/math/index.d.ts +18 -0
- package/dist/api/core/math/index.d.ts.map +1 -0
- package/dist/api/core/math/quat.d.ts +170 -0
- package/dist/api/core/math/quat.d.ts.map +1 -0
- package/dist/api/core/math/vec3.d.ts +174 -0
- package/dist/api/core/math/vec3.d.ts.map +1 -0
- package/dist/api/core/mode/index.d.ts +111 -0
- package/dist/api/core/mode/index.d.ts.map +1 -0
- package/dist/api/core/project/index.d.ts +466 -0
- package/dist/api/core/project/index.d.ts.map +1 -0
- package/dist/api/core/proposals/index.d.ts +531 -0
- package/dist/api/core/proposals/index.d.ts.map +1 -0
- package/dist/api/core/storeys/index.d.ts +265 -0
- package/dist/api/core/storeys/index.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +860 -0
- package/dist/api/core/tags.d.ts.map +1 -0
- package/dist/api/core/units/index.d.ts +175 -0
- package/dist/api/core/units/index.d.ts.map +1 -0
- package/dist/api/core/user.d.ts +44 -0
- package/dist/api/core/user.d.ts.map +1 -0
- package/dist/api/core/zoom/index.d.ts +49 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +168 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -0
- package/dist/api/design/create/bulk-items.d.ts +185 -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 +1747 -0
- package/dist/api/design/create/index.d.ts.map +1 -0
- package/dist/api/design/create/opening-fields.d.ts +37 -0
- package/dist/api/design/create/opening-fields.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +70 -0
- package/dist/api/design/delete/index.d.ts.map +1 -0
- 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 +470 -0
- package/dist/api/design/doors/index.d.ts.map +1 -0
- package/dist/api/design/edit/index.d.ts +49 -0
- package/dist/api/design/edit/index.d.ts.map +1 -0
- package/dist/api/design/erase/index.d.ts +160 -0
- package/dist/api/design/erase/index.d.ts.map +1 -0
- package/dist/api/design/family.d.ts +611 -0
- package/dist/api/design/family.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +296 -0
- package/dist/api/design/furniture/index.d.ts.map +1 -0
- 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 +260 -0
- package/dist/api/design/index.d.ts.map +1 -0
- package/dist/api/design/lock.d.ts +67 -0
- package/dist/api/design/lock.d.ts.map +1 -0
- package/dist/api/design/materials/index.d.ts +551 -0
- package/dist/api/design/materials/index.d.ts.map +1 -0
- package/dist/api/design/query/geometry/index.d.ts +252 -0
- package/dist/api/design/query/geometry/index.d.ts.map +1 -0
- 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 +1318 -0
- package/dist/api/design/query/index.d.ts.map +1 -0
- package/dist/api/design/query/referenceLines.d.ts +45 -0
- package/dist/api/design/query/referenceLines.d.ts.map +1 -0
- package/dist/api/design/query/spaces.d.ts +394 -0
- package/dist/api/design/query/spaces.d.ts.map +1 -0
- package/dist/api/design/selection/index.d.ts +282 -0
- package/dist/api/design/selection/index.d.ts.map +1 -0
- package/dist/api/design/shared.d.ts +38 -0
- package/dist/api/design/shared.d.ts.map +1 -0
- package/dist/api/design/transform/index.d.ts +249 -0
- package/dist/api/design/transform/index.d.ts.map +1 -0
- package/dist/api/design/types/index.d.ts +181 -0
- package/dist/api/design/types/index.d.ts.map +1 -0
- package/dist/api/design/update/index.d.ts +803 -0
- package/dist/api/design/update/index.d.ts.map +1 -0
- package/dist/api/design/visibility.d.ts +126 -0
- package/dist/api/design/visibility.d.ts.map +1 -0
- package/dist/api/design/windows/index.d.ts +300 -0
- package/dist/api/design/windows/index.d.ts.map +1 -0
- package/dist/api/entity/buildableEnvelope.d.ts +265 -0
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -0
- package/dist/api/entity/department.d.ts +1 -0
- package/dist/api/entity/department.d.ts.map +1 -0
- package/dist/api/entity/index.d.ts +28 -0
- package/dist/api/entity/index.d.ts.map +1 -0
- package/dist/api/entity/referenceLine.d.ts +210 -0
- package/dist/api/entity/referenceLine.d.ts.map +1 -0
- package/dist/api/entity/space.d.ts +846 -0
- package/dist/api/entity/space.d.ts.map +1 -0
- package/dist/api/entity/story.d.ts +476 -0
- package/dist/api/entity/story.d.ts.map +1 -0
- package/dist/api/index.d.ts +45 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/presentation/aiInspiration.d.ts +2400 -0
- package/dist/api/presentation/aiInspiration.d.ts.map +1 -0
- package/dist/api/presentation/annotate.d.ts +483 -0
- package/dist/api/presentation/annotate.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +184 -0
- package/dist/api/presentation/diagrams.d.ts.map +1 -0
- package/dist/api/presentation/drawings.d.ts +2900 -0
- package/dist/api/presentation/drawings.d.ts.map +1 -0
- package/dist/api/presentation/export.d.ts +126 -0
- package/dist/api/presentation/export.d.ts.map +1 -0
- package/dist/api/presentation/import.d.ts +164 -0
- package/dist/api/presentation/import.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +114 -0
- package/dist/api/presentation/index.d.ts.map +1 -0
- package/dist/api/presentation/placedViews.d.ts +1232 -0
- package/dist/api/presentation/placedViews.d.ts.map +1 -0
- package/dist/api/presentation/shapes.d.ts +481 -0
- package/dist/api/presentation/shapes.d.ts.map +1 -0
- package/dist/api/presentation/sheets.d.ts +643 -0
- package/dist/api/presentation/sheets.d.ts.map +1 -0
- package/dist/api/presentation/slideshow.d.ts +125 -0
- package/dist/api/presentation/slideshow.d.ts.map +1 -0
- package/dist/api/presentation/tables.d.ts +81 -0
- package/dist/api/presentation/tables.d.ts.map +1 -0
- package/dist/api/presentation/viewPresets.d.ts +70 -0
- package/dist/api/presentation/viewPresets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +741 -0
- package/dist/api/presentation/views.d.ts.map +1 -0
- package/dist/api/program/adjacency.d.ts +155 -0
- package/dist/api/program/adjacency.d.ts.map +1 -0
- package/dist/api/program/areas.d.ts +450 -0
- package/dist/api/program/areas.d.ts.map +1 -0
- package/dist/api/program/classification.d.ts +135 -0
- package/dist/api/program/classification.d.ts.map +1 -0
- package/dist/api/program/cores.d.ts +78 -0
- package/dist/api/program/cores.d.ts.map +1 -0
- package/dist/api/program/departments.d.ts +487 -0
- package/dist/api/program/departments.d.ts.map +1 -0
- package/dist/api/program/index.d.ts +71 -0
- package/dist/api/program/index.d.ts.map +1 -0
- package/dist/api/program/labels.d.ts +355 -0
- package/dist/api/program/labels.d.ts.map +1 -0
- package/dist/api/program/layout.d.ts +398 -0
- package/dist/api/program/layout.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/metrics.d.ts +108 -0
- package/dist/api/program/metrics.d.ts.map +1 -0
- package/dist/api/program/site.d.ts +823 -0
- package/dist/api/program/site.d.ts.map +1 -0
- package/dist/api/program/spreadsheet.d.ts +2628 -0
- package/dist/api/program/spreadsheet.d.ts.map +1 -0
- package/dist/api/workspace/index.d.ts +552 -0
- package/dist/api/workspace/index.d.ts.map +1 -0
- package/dist/errors/codes.d.ts +34 -0
- package/dist/errors/codes.d.ts.map +1 -0
- package/dist/errors/envelope.d.ts +56 -0
- package/dist/errors/envelope.d.ts.map +1 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/plugin-error.d.ts +69 -0
- package/dist/errors/plugin-error.d.ts.map +1 -0
- package/dist/handles.d.ts +229 -0
- package/dist/handles.d.ts.map +1 -0
- package/dist/host-utils.d.ts +47 -0
- package/dist/host-utils.d.ts.map +1 -0
- package/dist/index.cjs +8836 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7568 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +16 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +41 -0
- package/scripts/generate-manifest.mjs +238 -0
- package/scripts/generate-manifest.test.mjs +292 -0
- package/src/api/analysis/daylight.ts +470 -0
- package/src/api/analysis/heatmaps.ts +683 -0
- package/src/api/analysis/illuminance.ts +155 -0
- package/src/api/analysis/index.ts +61 -0
- package/src/api/analysis/shadows.ts +183 -0
- package/src/api/analysis/solar.ts +237 -0
- package/src/api/analysis/sunlightHours.ts +211 -0
- package/src/api/analysis/sunpath.ts +83 -0
- package/src/api/analysis/weather.ts +179 -0
- package/src/api/core/buildings.ts +485 -0
- package/src/api/core/camera/index.ts +268 -0
- package/src/api/core/comment/index.ts +376 -0
- package/src/api/core/geom/create/index.ts +1204 -0
- package/src/api/core/geom/delete/index.ts +84 -0
- package/src/api/core/geom/index.ts +35 -0
- package/src/api/core/geom/query/arc.ts +169 -0
- package/src/api/core/geom/query/brep.ts +563 -0
- package/src/api/core/geom/query/circle.ts +404 -0
- package/src/api/core/geom/query/contour.ts +540 -0
- package/src/api/core/geom/query/curve.ts +1078 -0
- package/src/api/core/geom/query/edge.ts +130 -0
- package/src/api/core/geom/query/face.ts +403 -0
- package/src/api/core/geom/query/halfedge.ts +210 -0
- package/src/api/core/geom/query/index.ts +63 -0
- package/src/api/core/geom/query/profile.ts +473 -0
- package/src/api/core/geom/query/vertex.ts +205 -0
- package/src/api/core/geom/update/contour.ts +315 -0
- package/src/api/core/geom/update/curve.ts +209 -0
- package/src/api/core/geom/update/index.ts +29 -0
- package/src/api/core/geom/update/profile.ts +377 -0
- package/src/api/core/groups.ts +521 -0
- package/src/api/core/handles/index.ts +233 -0
- package/src/api/core/history/index.ts +84 -0
- package/src/api/core/index.ts +99 -0
- package/src/api/core/io/export/index.ts +126 -0
- package/src/api/core/io/import/index.ts +504 -0
- package/src/api/core/io/index.ts +42 -0
- package/src/api/core/io/job/index.ts +140 -0
- package/src/api/core/io/query/index.ts +71 -0
- package/src/api/core/io/terrain/index.ts +360 -0
- package/src/api/core/io/underlay/index.ts +705 -0
- package/src/api/core/layers.ts +333 -0
- package/src/api/core/math/index.ts +20 -0
- package/src/api/core/math/quat.ts +172 -0
- package/src/api/core/math/vec3.ts +179 -0
- package/src/api/core/mode/index.ts +108 -0
- package/src/api/core/project/index.ts +479 -0
- package/src/api/core/proposals/index.ts +569 -0
- package/src/api/core/storeys/index.ts +294 -0
- package/src/api/core/tags.ts +911 -0
- package/src/api/core/units/index.ts +164 -0
- package/src/api/core/user.ts +46 -0
- package/src/api/core/zoom/index.ts +51 -0
- package/src/api/design/boolean/index.ts +179 -0
- package/src/api/design/create/bulk-items.ts +186 -0
- package/src/api/design/create/grids.ts +137 -0
- package/src/api/design/create/index.ts +1954 -0
- package/src/api/design/create/opening-fields.ts +37 -0
- package/src/api/design/delete/index.ts +74 -0
- package/src/api/design/dimensions.ts +453 -0
- package/src/api/design/doors/index.ts +500 -0
- package/src/api/design/edit/index.ts +54 -0
- package/src/api/design/erase/index.ts +151 -0
- package/src/api/design/family.ts +646 -0
- package/src/api/design/furniture/index.ts +319 -0
- package/src/api/design/grids.ts +237 -0
- package/src/api/design/index.ts +274 -0
- package/src/api/design/lock.ts +69 -0
- package/src/api/design/materials/index.ts +608 -0
- package/src/api/design/query/geometry/index.ts +288 -0
- package/src/api/design/query/grids.ts +197 -0
- package/src/api/design/query/index.ts +1176 -0
- package/src/api/design/query/referenceLines.ts +52 -0
- package/src/api/design/query/spaces.ts +275 -0
- package/src/api/design/selection/index.ts +273 -0
- package/src/api/design/shared.ts +40 -0
- package/src/api/design/transform/index.ts +254 -0
- package/src/api/design/types/index.ts +156 -0
- package/src/api/design/update/index.ts +798 -0
- package/src/api/design/visibility.ts +143 -0
- package/src/api/design/windows/index.ts +333 -0
- package/src/api/entity/buildableEnvelope.ts +322 -0
- package/src/api/entity/department.ts +0 -0
- package/src/api/entity/index.ts +30 -0
- package/src/api/entity/referenceLine.ts +235 -0
- package/src/api/entity/space.ts +612 -0
- package/src/api/entity/story.ts +517 -0
- package/src/api/index.ts +47 -0
- package/src/api/presentation/aiInspiration.ts +1116 -0
- package/src/api/presentation/annotate.ts +417 -0
- package/src/api/presentation/diagrams.ts +194 -0
- package/src/api/presentation/drawings.ts +529 -0
- package/src/api/presentation/export.ts +133 -0
- package/src/api/presentation/import.ts +159 -0
- package/src/api/presentation/index.ts +129 -0
- package/src/api/presentation/placedViews.ts +1203 -0
- package/src/api/presentation/shapes.ts +274 -0
- package/src/api/presentation/sheets.ts +616 -0
- package/src/api/presentation/slideshow.ts +134 -0
- package/src/api/presentation/tables.ts +84 -0
- package/src/api/presentation/viewPresets.ts +83 -0
- package/src/api/presentation/views.ts +698 -0
- package/src/api/program/adjacency.ts +164 -0
- package/src/api/program/areas.ts +408 -0
- package/src/api/program/classification.ts +138 -0
- package/src/api/program/cores.ts +83 -0
- package/src/api/program/departments.ts +517 -0
- package/src/api/program/index.ts +73 -0
- package/src/api/program/labels.ts +332 -0
- package/src/api/program/layout.ts +422 -0
- package/src/api/program/metadata.ts +364 -0
- package/src/api/program/metrics.ts +120 -0
- package/src/api/program/site.ts +748 -0
- package/src/api/program/spreadsheet.ts +2698 -0
- package/src/api/workspace/index.ts +612 -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 +282 -0
- package/src/host-utils.ts +68 -0
- package/src/index.ts +5 -0
- package/src/types.ts +16 -0
- package/test/errors.test.mjs +184 -0
- package/tsconfig.json +22 -0
- package/tsup.config.ts +12 -0
|
@@ -0,0 +1,517 @@
|
|
|
1
|
+
import * as z from "zod"
|
|
2
|
+
import { PluginApiReturn } from "../../types"
|
|
3
|
+
import { ComponentHandle } from "../../handles"
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Story (floor/storey) management.
|
|
7
|
+
*
|
|
8
|
+
* A story represents a building floor in the Snaptrude project. Stories
|
|
9
|
+
* are identified by their integer **story value** (e.g. `1` for ground
|
|
10
|
+
* floor, `2` for first floor, `-1` for a basement).
|
|
11
|
+
*
|
|
12
|
+
* All methods are **host API calls** that return Promises and support
|
|
13
|
+
* undo/redo via Snaptrude's command system.
|
|
14
|
+
*
|
|
15
|
+
* Accessed via `snaptrude.entity.story`.
|
|
16
|
+
*/
|
|
17
|
+
export abstract class PluginStoryApi {
|
|
18
|
+
constructor() {}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get properties of a story by its storey number.
|
|
22
|
+
*
|
|
23
|
+
* Only the properties listed in `properties`
|
|
24
|
+
* are returned — unlisted properties will be `undefined` in the result.
|
|
25
|
+
*
|
|
26
|
+
* @param storyValue - Integer storey number
|
|
27
|
+
* (e.g. `1` for ground floor, `2` for first floor, `-1` for basement)
|
|
28
|
+
* @param properties - Array of property names
|
|
29
|
+
* to retrieve. See {@linkcode PluginStoryGetProperty} for available values.
|
|
30
|
+
* @returns A partial {@linkcode PluginStoryGetResult} containing only the requested properties
|
|
31
|
+
* @throws If the story with the given value does not exist
|
|
32
|
+
*
|
|
33
|
+
* @examplePrompt What is the height of the ground floor?
|
|
34
|
+
* @examplePrompt How many rooms are on the second storey?
|
|
35
|
+
* @examplePrompt Get the total floor area of level 3
|
|
36
|
+
* @examplePrompt Is the first floor hidden in the viewport?
|
|
37
|
+
* @examplePrompt Show me the name and height of story 2
|
|
38
|
+
*
|
|
39
|
+
* # Example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const info = await snaptrude.entity.story.get(1, ["height", "name", "spacesCount"])
|
|
42
|
+
* console.log(info.name, info.height, info.spacesCount)
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @deprecated Use `core.storeys.get`
|
|
46
|
+
*/
|
|
47
|
+
public abstract get(
|
|
48
|
+
storyValue: number,
|
|
49
|
+
properties: PluginStoryGetProperty[],
|
|
50
|
+
): PluginApiReturn<PluginStoryGetResult>
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Get all stories in the current project.
|
|
54
|
+
*
|
|
55
|
+
* Returns basic identification data for every storey. Stories are sorted
|
|
56
|
+
* from **top to bottom** (highest story value first).
|
|
57
|
+
*
|
|
58
|
+
* @returns A {@linkcode PluginStoryGetAllResult} with a `stories` array,
|
|
59
|
+
* each entry containing `value`, `id`, and `name`
|
|
60
|
+
*
|
|
61
|
+
* @examplePrompt How many floors does this building have?
|
|
62
|
+
* @examplePrompt List all the storeys in the project
|
|
63
|
+
* @examplePrompt Show me every level with its name
|
|
64
|
+
* @examplePrompt Which stories exist in this model?
|
|
65
|
+
*
|
|
66
|
+
* # Example
|
|
67
|
+
* ```ts
|
|
68
|
+
* const { stories } = await snaptrude.entity.story.getAll()
|
|
69
|
+
* for (const s of stories) {
|
|
70
|
+
* console.log(`Story ${s.value}: ${s.name} (id: ${s.id})`)
|
|
71
|
+
* }
|
|
72
|
+
* ```
|
|
73
|
+
*
|
|
74
|
+
* @deprecated Use `core.storeys.list`
|
|
75
|
+
*/
|
|
76
|
+
public abstract getAll(): PluginApiReturn<PluginStoryGetAllResult>
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Create a new story (floor) in the project.
|
|
80
|
+
*
|
|
81
|
+
* The new story is inserted at the position specified by
|
|
82
|
+
* `storyValue`. This operation is undoable.
|
|
83
|
+
*
|
|
84
|
+
* @param storyValue - Integer storey number
|
|
85
|
+
* to create (e.g. `3` to add a third floor)
|
|
86
|
+
* @param height - Optional height in Babylon
|
|
87
|
+
* units. If omitted, the project's default storey height is used.
|
|
88
|
+
* @returns A {@linkcode PluginStoryCreateResult} with `storyId` and `storyValue`
|
|
89
|
+
* @throws If a story with the given value already exists or creation fails
|
|
90
|
+
*
|
|
91
|
+
* @examplePrompt Add a third floor to the building
|
|
92
|
+
* @examplePrompt Create a new storey above the second floor
|
|
93
|
+
* @examplePrompt Add a basement level to this project
|
|
94
|
+
* @examplePrompt Insert a new level with a custom floor height
|
|
95
|
+
* @examplePrompt Add another floor on top of the building
|
|
96
|
+
*
|
|
97
|
+
* # Example
|
|
98
|
+
* ```ts
|
|
99
|
+
* // Create a new third floor with custom height
|
|
100
|
+
* const { storyId } = await snaptrude.entity.story.create(3, 4.5)
|
|
101
|
+
* ```
|
|
102
|
+
*
|
|
103
|
+
* @deprecated Use `core.storeys.create`
|
|
104
|
+
*/
|
|
105
|
+
public abstract create(
|
|
106
|
+
storyValue: number,
|
|
107
|
+
height?: number,
|
|
108
|
+
): PluginApiReturn<PluginStoryCreateResult>
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Update a story's floor-to-floor `height` and/or `name`.
|
|
112
|
+
*
|
|
113
|
+
* **Height** is the same operation as editing the height in the Stories panel:
|
|
114
|
+
* the walls, columns, and masses on the story are **stretched** to the new
|
|
115
|
+
* height, every story **above shifts up/down** by the delta so the stack stays
|
|
116
|
+
* contiguous, and coupled elements (staircases, parametric curtain walls,
|
|
117
|
+
* furniture offsets) are re-fitted. The whole height cascade is committed as
|
|
118
|
+
* **one undo step**. Height-locked elements are left untouched.
|
|
119
|
+
*
|
|
120
|
+
* **Name** is the same as renaming the story in the Stories panel: it is
|
|
121
|
+
* persisted immediately (saved to the project) but, mirroring the panel, is
|
|
122
|
+
* **not** part of the height undo step.
|
|
123
|
+
*
|
|
124
|
+
* At least one of `height` or `options.name` must be supplied. Omitting the
|
|
125
|
+
* `height` argument (e.g. for a rename-only update) leaves the height
|
|
126
|
+
* untouched.
|
|
127
|
+
*
|
|
128
|
+
* @param storyValue - Integer storey number
|
|
129
|
+
* identifying the story to update
|
|
130
|
+
* @param height - New floor-to-floor height in
|
|
131
|
+
* Babylon units. Omit to leave the height unchanged.
|
|
132
|
+
* @param options - `name` (new display name for the story)
|
|
133
|
+
* @returns A {@linkcode PluginStoryUpdateResult} with the story's
|
|
134
|
+
* `storyValue`, `height`, and `name` after the update
|
|
135
|
+
* @throws `PRECONDITION_FAILED` if no story has the given value;
|
|
136
|
+
* `VALIDATION` if neither `height` nor `options.name` is supplied;
|
|
137
|
+
* `STORY_HEIGHT_REJECTED` if the engine rejects the height (e.g. out of
|
|
138
|
+
* range — the change silently reverts host-side and is surfaced as this
|
|
139
|
+
* error); `STORY_UPDATE_FAILED` if the story cannot be re-read after the
|
|
140
|
+
* update
|
|
141
|
+
*
|
|
142
|
+
* @examplePrompt Change the ground floor height to 3.5 metres
|
|
143
|
+
* @examplePrompt Make the second storey taller
|
|
144
|
+
* @examplePrompt Rename the ground floor to "Lobby"
|
|
145
|
+
* @examplePrompt Set the floor-to-floor height of level 1
|
|
146
|
+
* @examplePrompt Rename storey 2 and make it taller in one go
|
|
147
|
+
*
|
|
148
|
+
* # Example
|
|
149
|
+
* ```ts
|
|
150
|
+
* // Set ground floor height to 5 Babylon units — walls stretch and the
|
|
151
|
+
* // floors above move up to match, all in a single undo step.
|
|
152
|
+
* const result = await snaptrude.entity.story.update(1, 5)
|
|
153
|
+
* // Rename only, leaving the height untouched.
|
|
154
|
+
* await snaptrude.entity.story.update(1, undefined, { name: "Lobby" })
|
|
155
|
+
* ```
|
|
156
|
+
*
|
|
157
|
+
* @deprecated Use `core.storeys.update`
|
|
158
|
+
*/
|
|
159
|
+
public abstract update(
|
|
160
|
+
storyValue: number,
|
|
161
|
+
height?: number,
|
|
162
|
+
options?: { name?: string },
|
|
163
|
+
): PluginApiReturn<PluginStoryUpdateResult>
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Make a story the active story — the same as clicking it in the storey/layer
|
|
167
|
+
* panel. Subsequent draws and creates target this story, and in 2D the
|
|
168
|
+
* viewport switches to it. This is a view/navigation change: it is **not**
|
|
169
|
+
* undoable and commits nothing to the model.
|
|
170
|
+
*
|
|
171
|
+
* @param storyValue - Integer storey number to activate
|
|
172
|
+
* @returns A {@linkcode PluginStorySetActiveResult} echoing the now-active `storyValue`
|
|
173
|
+
* @throws `PRECONDITION_FAILED` if no story has the given value
|
|
174
|
+
*
|
|
175
|
+
* @examplePrompt Switch to the second floor
|
|
176
|
+
* @examplePrompt Make the ground storey active
|
|
177
|
+
* @examplePrompt Go to the basement level
|
|
178
|
+
* @examplePrompt Set level 3 as the current storey
|
|
179
|
+
*
|
|
180
|
+
* # Example
|
|
181
|
+
* ```ts
|
|
182
|
+
* // Activate story 2, then draw a wall — it lands on story 2.
|
|
183
|
+
* await snaptrude.entity.story.setActive(2)
|
|
184
|
+
* ```
|
|
185
|
+
*
|
|
186
|
+
* @deprecated Use `core.storeys.setActive`
|
|
187
|
+
*/
|
|
188
|
+
public abstract setActive(
|
|
189
|
+
storyValue: number,
|
|
190
|
+
): PluginApiReturn<PluginStorySetActiveResult>
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Delete a story and everything on it — the same as removing it from the
|
|
194
|
+
* storey panel. Every element placed on the story (walls, floors, masses, …)
|
|
195
|
+
* is deleted with it, the remaining stories are re-stacked, and the active
|
|
196
|
+
* story falls back to an adjacent one. Committed as a single undo step.
|
|
197
|
+
*
|
|
198
|
+
* @param storyValue - Integer storey number to delete
|
|
199
|
+
* @returns A {@linkcode PluginStoryDeleteResult} with the deleted `storyValue`
|
|
200
|
+
* and the `newActiveStory` the editor fell back to
|
|
201
|
+
* @throws `PRECONDITION_FAILED` if no story has the given value; or if plugin
|
|
202
|
+
* writes are disabled
|
|
203
|
+
*
|
|
204
|
+
* @examplePrompt Delete the top floor
|
|
205
|
+
* @examplePrompt Remove the basement level
|
|
206
|
+
* @examplePrompt Get rid of storey 3
|
|
207
|
+
* @examplePrompt Delete the second floor and everything on it
|
|
208
|
+
*
|
|
209
|
+
* # Example
|
|
210
|
+
* ```ts
|
|
211
|
+
* const { newActiveStory } = await snaptrude.entity.story.delete(3)
|
|
212
|
+
* console.log(`Deleted story 3; now on story ${newActiveStory}`)
|
|
213
|
+
* ```
|
|
214
|
+
*
|
|
215
|
+
* @deprecated Use `core.storeys.delete`
|
|
216
|
+
*/
|
|
217
|
+
public abstract delete(
|
|
218
|
+
storyValue: number,
|
|
219
|
+
): PluginApiReturn<PluginStoryDeleteResult>
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Duplicate a story into the adjacent level, up or down.
|
|
223
|
+
*
|
|
224
|
+
* By default the **whole story** is duplicated: every eligible element on the
|
|
225
|
+
* active story (walls, floors, roofs, masses, columns, beams, staircases,
|
|
226
|
+
* ceilings, parametric curtain walls, and furniture) is copied into the story
|
|
227
|
+
* one level `"up"` or `"down"`. Pass `options.components` to duplicate only a
|
|
228
|
+
* subset instead. The target story is **created automatically** if it does not
|
|
229
|
+
* yet exist, inheriting the source story's height.
|
|
230
|
+
*
|
|
231
|
+
* Copies are **instanced** by default (`unique: false`) — they share geometry
|
|
232
|
+
* with the source, so later edits propagate. Set `unique: true` for independent
|
|
233
|
+
* geometry. Doors and windows are never duplicated on their own; they ride along
|
|
234
|
+
* with their host wall. Locked, throw-away, and unsupported elements are skipped
|
|
235
|
+
* and counted in `skipped`. The whole operation is a single undo step.
|
|
236
|
+
*
|
|
237
|
+
* @param direction - `"up"` to duplicate into the story above, `"down"` for below
|
|
238
|
+
* @param options - `components` (restrict to a subset of the story's elements;
|
|
239
|
+
* omit for the whole story) and `unique` (default `false` = instanced copies;
|
|
240
|
+
* `true` = independent geometry)
|
|
241
|
+
* @returns A {@linkcode PluginStoryDuplicateResult} with the `sourceStory`, the
|
|
242
|
+
* `targetStories` the copies landed on, the `created` component handles, the
|
|
243
|
+
* `createdStoryValues` for any stories generated to receive them, and the
|
|
244
|
+
* `skipped` count of ineligible elements
|
|
245
|
+
* @throws `NO_ACTIVE_STRUCTURE` if there is no active structure to duplicate
|
|
246
|
+
* into; `NO_ELIGIBLE_ELEMENTS` if nothing on the source story (or in
|
|
247
|
+
* `options.components`) is duplicable; `HANDLE_INVALID` for a stale or
|
|
248
|
+
* foreign supplied handle; or if plugin writes are disabled
|
|
249
|
+
*
|
|
250
|
+
* @examplePrompt Duplicate this floor to the storey above
|
|
251
|
+
* @examplePrompt Copy the ground floor down into a new basement
|
|
252
|
+
* @examplePrompt Repeat this level upwards with its own independent geometry
|
|
253
|
+
* @examplePrompt Duplicate just the selected walls onto the next floor up
|
|
254
|
+
*
|
|
255
|
+
* @performance For storeys that share a layout, duplicate the storey instead of recreating
|
|
256
|
+
* its contents floor by floor — this copies every eligible element in one call, and the
|
|
257
|
+
* default instanced copies keep the floors linked. To stack many identical floors, either
|
|
258
|
+
* call this per level or capture the storey's component ids and
|
|
259
|
+
* `design.create.copy(ids, oneFloorRise, { count })` to lay them all down in a single call.
|
|
260
|
+
*
|
|
261
|
+
* # Example
|
|
262
|
+
* ```ts
|
|
263
|
+
* // Duplicate the whole active story one level up (instanced copies).
|
|
264
|
+
* const { targetStories, created, skipped } =
|
|
265
|
+
* await snaptrude.entity.story.duplicate("up")
|
|
266
|
+
* console.log(`Copied ${created.length} elements onto story ${targetStories}`)
|
|
267
|
+
* if (skipped) console.log(`${skipped} elements were skipped`)
|
|
268
|
+
* ```
|
|
269
|
+
*
|
|
270
|
+
* @deprecated Use `core.storeys.copy`
|
|
271
|
+
*/
|
|
272
|
+
public abstract duplicate(
|
|
273
|
+
direction: "up" | "down",
|
|
274
|
+
options?: { components?: ComponentHandle[]; unique?: boolean },
|
|
275
|
+
): PluginApiReturn<PluginStoryDuplicateResult>
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Available properties that can be queried on a story.
|
|
280
|
+
*
|
|
281
|
+
* | Value | Type | Description |
|
|
282
|
+
* |---|---|---|
|
|
283
|
+
* | `"value"` | `number` | The integer storey number |
|
|
284
|
+
* | `"id"` | `string` | Unique story identifier |
|
|
285
|
+
* | `"name"` | `string` | Display name of the story |
|
|
286
|
+
* | `"height"` | `number` | Floor-to-floor height in Babylon units |
|
|
287
|
+
* | `"base"` | `number` | Base elevation in Babylon units |
|
|
288
|
+
* | `"hidden"` | `boolean` | Whether the story is hidden in the viewport |
|
|
289
|
+
* | `"spacesCount"` | `number` | Number of spaces on this story |
|
|
290
|
+
* | `"totalArea"` | `number` | Total floor area of this story |
|
|
291
|
+
*/
|
|
292
|
+
export const PluginStoryGetProperty = z.enum([
|
|
293
|
+
"value",
|
|
294
|
+
"id",
|
|
295
|
+
"name",
|
|
296
|
+
"height",
|
|
297
|
+
"base",
|
|
298
|
+
"hidden",
|
|
299
|
+
"spacesCount",
|
|
300
|
+
"totalArea",
|
|
301
|
+
])
|
|
302
|
+
|
|
303
|
+
export type PluginStoryGetProperty = z.infer<typeof PluginStoryGetProperty>
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Arguments for {@linkcode PluginStoryApi.get}.
|
|
307
|
+
*
|
|
308
|
+
* | Property | Type | Description |
|
|
309
|
+
* |---|---|---|
|
|
310
|
+
* | `storyValue` | `number` (int) | The storey number to query |
|
|
311
|
+
* | `properties` | {@linkcode PluginStoryGetProperty}`[]` | Properties to retrieve |
|
|
312
|
+
*/
|
|
313
|
+
export const PluginStoryGetArgs = z.object({
|
|
314
|
+
storyValue: z.number().int(),
|
|
315
|
+
properties: z.array(PluginStoryGetProperty),
|
|
316
|
+
})
|
|
317
|
+
|
|
318
|
+
export type PluginStoryGetArgs = z.infer<typeof PluginStoryGetArgs>
|
|
319
|
+
|
|
320
|
+
/**
|
|
321
|
+
* Result of {@linkcode PluginStoryApi.get}.
|
|
322
|
+
*
|
|
323
|
+
* A partial object — only the properties that were requested in
|
|
324
|
+
* {@linkcode PluginStoryGetArgs.properties} will be present.
|
|
325
|
+
*/
|
|
326
|
+
export const PluginStoryGetResult = z
|
|
327
|
+
.object({
|
|
328
|
+
value: z.number(),
|
|
329
|
+
id: z.string(),
|
|
330
|
+
name: z.string(),
|
|
331
|
+
height: z.number(),
|
|
332
|
+
base: z.number(),
|
|
333
|
+
hidden: z.boolean(),
|
|
334
|
+
spacesCount: z.number(),
|
|
335
|
+
totalArea: z.number(),
|
|
336
|
+
})
|
|
337
|
+
.partial()
|
|
338
|
+
|
|
339
|
+
export type PluginStoryGetResult = z.infer<typeof PluginStoryGetResult>
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Result of {@linkcode PluginStoryApi.getAll}.
|
|
343
|
+
*
|
|
344
|
+
* | Property | Type | Description |
|
|
345
|
+
* |---|---|---|
|
|
346
|
+
* | `stories` | `Array<{ value, id, name }>` | All stories, sorted top to bottom |
|
|
347
|
+
*/
|
|
348
|
+
export const PluginStoryGetAllResult = z.object({
|
|
349
|
+
stories: z.array(
|
|
350
|
+
z.object({
|
|
351
|
+
value: z.number(),
|
|
352
|
+
id: z.string(),
|
|
353
|
+
name: z.string(),
|
|
354
|
+
})
|
|
355
|
+
),
|
|
356
|
+
})
|
|
357
|
+
|
|
358
|
+
export type PluginStoryGetAllResult = z.infer<typeof PluginStoryGetAllResult>
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* Arguments for {@linkcode PluginStoryApi.create}.
|
|
362
|
+
*
|
|
363
|
+
* | Property | Type | Description |
|
|
364
|
+
* |---|---|---|
|
|
365
|
+
* | `storyValue` | `number` (int) | The storey number for the new story |
|
|
366
|
+
* | `height` | `number?` | Optional height in Babylon units |
|
|
367
|
+
*/
|
|
368
|
+
export const PluginStoryCreateArgs = z.object({
|
|
369
|
+
storyValue: z.number().int(),
|
|
370
|
+
height: z.number().optional(),
|
|
371
|
+
})
|
|
372
|
+
|
|
373
|
+
export type PluginStoryCreateArgs = z.infer<typeof PluginStoryCreateArgs>
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Result of {@linkcode PluginStoryApi.create}.
|
|
377
|
+
*
|
|
378
|
+
* | Property | Type | Description |
|
|
379
|
+
* |---|---|---|
|
|
380
|
+
* | `storyId` | `string` | Unique ID of the created story |
|
|
381
|
+
* | `storyValue` | `number` | The storey number of the created story |
|
|
382
|
+
*/
|
|
383
|
+
export const PluginStoryCreateResult = z.object({
|
|
384
|
+
storyId: z.string(),
|
|
385
|
+
storyValue: z.number(),
|
|
386
|
+
})
|
|
387
|
+
|
|
388
|
+
export type PluginStoryCreateResult = z.infer<typeof PluginStoryCreateResult>
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* Arguments for {@linkcode PluginStoryApi.update}. At least one of `height` or
|
|
392
|
+
* `name` must be supplied.
|
|
393
|
+
*
|
|
394
|
+
* | Property | Type | Description |
|
|
395
|
+
* |---|---|---|
|
|
396
|
+
* | `storyValue` | `number` (int) | Storey number of the story to update |
|
|
397
|
+
* | `height` | `number?` | New height in Babylon units (omit to leave unchanged) |
|
|
398
|
+
* | `name` | `string?` | New display name for the story (omit to leave unchanged) |
|
|
399
|
+
*/
|
|
400
|
+
export const PluginStoryUpdateArgs = z.object({
|
|
401
|
+
storyValue: z.number().int(),
|
|
402
|
+
height: z.number().optional(),
|
|
403
|
+
name: z.string().optional(),
|
|
404
|
+
})
|
|
405
|
+
|
|
406
|
+
export type PluginStoryUpdateArgs = z.infer<typeof PluginStoryUpdateArgs>
|
|
407
|
+
|
|
408
|
+
/**
|
|
409
|
+
* Result of {@linkcode PluginStoryApi.update} — the story's state after the update.
|
|
410
|
+
*
|
|
411
|
+
* | Property | Type | Description |
|
|
412
|
+
* |---|---|---|
|
|
413
|
+
* | `storyValue` | `number` | The storey number of the updated story |
|
|
414
|
+
* | `height` | `number` | The height after the update |
|
|
415
|
+
* | `name` | `string` | The name after the update |
|
|
416
|
+
*/
|
|
417
|
+
export const PluginStoryUpdateResult = z.object({
|
|
418
|
+
storyValue: z.number(),
|
|
419
|
+
height: z.number(),
|
|
420
|
+
name: z.string(),
|
|
421
|
+
})
|
|
422
|
+
|
|
423
|
+
export type PluginStoryUpdateResult = z.infer<typeof PluginStoryUpdateResult>
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Arguments for {@linkcode PluginStoryApi.setActive}.
|
|
427
|
+
*
|
|
428
|
+
* | Property | Type | Description |
|
|
429
|
+
* |---|---|---|
|
|
430
|
+
* | `storyValue` | `number` (int) | Storey number to activate |
|
|
431
|
+
*/
|
|
432
|
+
export const PluginStorySetActiveArgs = z.object({
|
|
433
|
+
storyValue: z.number().int(),
|
|
434
|
+
})
|
|
435
|
+
|
|
436
|
+
export type PluginStorySetActiveArgs = z.infer<typeof PluginStorySetActiveArgs>
|
|
437
|
+
|
|
438
|
+
/**
|
|
439
|
+
* Result of {@linkcode PluginStoryApi.setActive}.
|
|
440
|
+
*
|
|
441
|
+
* | Property | Type | Description |
|
|
442
|
+
* |---|---|---|
|
|
443
|
+
* | `storyValue` | `number` | The storey number that is now active |
|
|
444
|
+
*/
|
|
445
|
+
export const PluginStorySetActiveResult = z.object({
|
|
446
|
+
storyValue: z.number(),
|
|
447
|
+
})
|
|
448
|
+
|
|
449
|
+
export type PluginStorySetActiveResult = z.infer<typeof PluginStorySetActiveResult>
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* Arguments for {@linkcode PluginStoryApi.delete}.
|
|
453
|
+
*
|
|
454
|
+
* | Property | Type | Description |
|
|
455
|
+
* |---|---|---|
|
|
456
|
+
* | `storyValue` | `number` (int) | Storey number to delete |
|
|
457
|
+
*/
|
|
458
|
+
export const PluginStoryDeleteArgs = z.object({
|
|
459
|
+
storyValue: z.number().int(),
|
|
460
|
+
})
|
|
461
|
+
|
|
462
|
+
export type PluginStoryDeleteArgs = z.infer<typeof PluginStoryDeleteArgs>
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Result of {@linkcode PluginStoryApi.delete}.
|
|
466
|
+
*
|
|
467
|
+
* | Property | Type | Description |
|
|
468
|
+
* |---|---|---|
|
|
469
|
+
* | `storyValue` | `number` | The storey number that was deleted |
|
|
470
|
+
* | `newActiveStory` | `number` | The storey the editor fell back to as active |
|
|
471
|
+
*/
|
|
472
|
+
export const PluginStoryDeleteResult = z.object({
|
|
473
|
+
storyValue: z.number(),
|
|
474
|
+
newActiveStory: z.number(),
|
|
475
|
+
})
|
|
476
|
+
|
|
477
|
+
export type PluginStoryDeleteResult = z.infer<typeof PluginStoryDeleteResult>
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Arguments for {@linkcode PluginStoryApi.duplicate} (options flattened).
|
|
481
|
+
*
|
|
482
|
+
* | Property | Type | Description |
|
|
483
|
+
* |---|---|---|
|
|
484
|
+
* | `direction` | `'up' \| 'down'` | Which adjacent story to duplicate into |
|
|
485
|
+
* | `components` | {@linkcode ComponentHandle}`[]?` | Restrict to a subset; omit for the whole story |
|
|
486
|
+
* | `unique` | `boolean?` | `false` (default) = instanced copies; `true` = independent geometry |
|
|
487
|
+
*/
|
|
488
|
+
export const PluginStoryDuplicateArgs = z.object({
|
|
489
|
+
direction: z.enum(["up", "down"]),
|
|
490
|
+
components: z.array(ComponentHandle).optional(),
|
|
491
|
+
unique: z.boolean().optional(),
|
|
492
|
+
})
|
|
493
|
+
|
|
494
|
+
export type PluginStoryDuplicateArgs = z.infer<typeof PluginStoryDuplicateArgs>
|
|
495
|
+
|
|
496
|
+
/**
|
|
497
|
+
* Result of {@linkcode PluginStoryApi.duplicate}.
|
|
498
|
+
*
|
|
499
|
+
* | Property | Type | Description |
|
|
500
|
+
* |---|---|---|
|
|
501
|
+
* | `sourceStory` | `number` | Storey value the copies were duplicated from |
|
|
502
|
+
* | `targetStories` | `number[]` | Storey values the copies landed on |
|
|
503
|
+
* | `created` | {@linkcode ComponentHandle}`[]` | Handles of the newly created components |
|
|
504
|
+
* | `createdStoryValues` | `number[]` | Storey values that were generated to receive the copies |
|
|
505
|
+
* | `skipped` | `number` | Count of ineligible elements that were skipped |
|
|
506
|
+
*/
|
|
507
|
+
export const PluginStoryDuplicateResult = z.object({
|
|
508
|
+
sourceStory: z.number(),
|
|
509
|
+
targetStories: z.array(z.number()),
|
|
510
|
+
created: z.array(ComponentHandle),
|
|
511
|
+
createdStoryValues: z.array(z.number()),
|
|
512
|
+
skipped: z.number(),
|
|
513
|
+
})
|
|
514
|
+
|
|
515
|
+
export type PluginStoryDuplicateResult = z.infer<
|
|
516
|
+
typeof PluginStoryDuplicateResult
|
|
517
|
+
>
|
package/src/api/index.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { PluginCoreApi } from "./core"
|
|
2
|
+
import { PluginDesignApi } from "./design"
|
|
3
|
+
import { PluginEntityApi } from "./entity"
|
|
4
|
+
import { PluginProgramApi } from "./program"
|
|
5
|
+
import { PluginPresentationApi } from "./presentation"
|
|
6
|
+
import { PluginAnalysisApi } from "./analysis"
|
|
7
|
+
import { PluginWorkspaceApi } from "./workspace"
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Root API surface for Snaptrude plugins.
|
|
11
|
+
*
|
|
12
|
+
* Access all plugin capabilities through the namespaced properties:
|
|
13
|
+
*
|
|
14
|
+
* - {@linkcode PluginApi.core} — Math, geometry kernel, history, units, zoom, project, comments (infrastructure)
|
|
15
|
+
* - {@linkcode PluginApi.design} — Author, query & edit BIM geometry
|
|
16
|
+
* - {@linkcode PluginApi.entity} — CRUD operations on Snaptrude entities (spaces, stories)
|
|
17
|
+
* - {@linkcode PluginApi.program} — Program-mode planning reads (departments, metrics)
|
|
18
|
+
* - {@linkcode PluginApi.presentation} — Presentation preparation (views, AI Inspiration)
|
|
19
|
+
* - {@linkcode PluginApi.analysis} — Sustainability analysis (sunpath, shadows, sunlight/illuminance heatmaps)
|
|
20
|
+
* - {@linkcode PluginApi.workspace} — Dashboard surface: projects and teams
|
|
21
|
+
*/
|
|
22
|
+
export abstract class PluginApi {
|
|
23
|
+
/** Core math, geometry, history, and units primitives. See {@linkcode PluginCoreApi}. */
|
|
24
|
+
public abstract core: PluginCoreApi
|
|
25
|
+
/** Author, query & edit BIM geometry. See {@linkcode PluginDesignApi}. */
|
|
26
|
+
public abstract design: PluginDesignApi
|
|
27
|
+
/** CRUD operations on Snaptrude entities. See {@linkcode PluginEntityApi}. */
|
|
28
|
+
public abstract entity: PluginEntityApi
|
|
29
|
+
/** Program-mode planning reads — departments and area metrics. See {@linkcode PluginProgramApi}. */
|
|
30
|
+
public abstract program: PluginProgramApi
|
|
31
|
+
/** Presentation preparation reads — saved views. See {@linkcode PluginPresentationApi}. */
|
|
32
|
+
public abstract presentation: PluginPresentationApi
|
|
33
|
+
/** Sustainability analysis — sun & daylight studies. See {@linkcode PluginAnalysisApi}. */
|
|
34
|
+
public abstract analysis: PluginAnalysisApi
|
|
35
|
+
/** Dashboard surface — projects and teams. See {@linkcode PluginWorkspaceApi}. */
|
|
36
|
+
public abstract workspace: PluginWorkspaceApi
|
|
37
|
+
|
|
38
|
+
constructor() {}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export * from "./core"
|
|
42
|
+
export * from "./design"
|
|
43
|
+
export * from "./entity"
|
|
44
|
+
export * from "./program"
|
|
45
|
+
export * from "./presentation"
|
|
46
|
+
export * from "./analysis"
|
|
47
|
+
export * from "./workspace"
|