@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,698 @@
|
|
|
1
|
+
import * as z from "zod"
|
|
2
|
+
import { PluginApiReturn } from "../../types"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Presentation views — read the saved plan, 3D, and elevation views used to prepare presentations.
|
|
6
|
+
*
|
|
7
|
+
* A **view** is a saved camera/plan: a sheet-ready 2D plan or a saved 3D view.
|
|
8
|
+
* A plugin can list and read views, capture them to images, activate one (move
|
|
9
|
+
* the camera to it), save the current camera as a new view, rename or delete a
|
|
10
|
+
* saved view, and read/update a view's display settings (background, color
|
|
11
|
+
* mode, view mode, axis, edges, labels). Each view carries the `storey` it was
|
|
12
|
+
* saved on.
|
|
13
|
+
*
|
|
14
|
+
* `list`/`get`/`getActive`/`capture`/`getSettings` are reads;
|
|
15
|
+
* `setActive`/`create`/`rename`/`delete`/`updateSettings` are writes (a view is
|
|
16
|
+
* a camera bookmark — not geometry).
|
|
17
|
+
*
|
|
18
|
+
* Accessed via `snaptrude.presentation.views`.
|
|
19
|
+
*/
|
|
20
|
+
export abstract class PluginPresentationViewsApi {
|
|
21
|
+
constructor() {}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* List the saved views in the active project.
|
|
25
|
+
*
|
|
26
|
+
* @returns A {@linkcode PluginPresentationViewsListResult} with a `views` array
|
|
27
|
+
* of plan, 3D, and elevation views (empty when the project has none).
|
|
28
|
+
*
|
|
29
|
+
* @examplePrompt List all the saved views
|
|
30
|
+
* @examplePrompt What plan, 3D, and elevation views are in this project?
|
|
31
|
+
* @examplePrompt Which view is currently active?
|
|
32
|
+
* @examplePrompt Get the names of every presentation view
|
|
33
|
+
* @examplePrompt Show me the 3D views I can put on a sheet
|
|
34
|
+
*
|
|
35
|
+
* # Example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const { views } = await snaptrude.presentation.views.list()
|
|
38
|
+
* const active = views.find((v) => v.isActive)
|
|
39
|
+
* const plans = views.filter((v) => v.type === "2d")
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
public abstract list(): PluginApiReturn<PluginPresentationViewsListResult>
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Get a single saved view by id.
|
|
46
|
+
*
|
|
47
|
+
* @param viewId - The id of the view to read.
|
|
48
|
+
* @returns The matching {@linkcode PluginPresentationView}, or `null` if no view
|
|
49
|
+
* has that id.
|
|
50
|
+
*
|
|
51
|
+
* @examplePrompt Get the view with id view_12345
|
|
52
|
+
* @examplePrompt Find the saved view called Ground Floor Plan
|
|
53
|
+
* @examplePrompt Look up a presentation view by its id
|
|
54
|
+
*
|
|
55
|
+
* # Example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const view = await snaptrude.presentation.views.get("view_123")
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
public abstract get(
|
|
61
|
+
viewId: string,
|
|
62
|
+
): PluginApiReturn<PluginPresentationViewsGetResult>
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Get the currently active view.
|
|
66
|
+
*
|
|
67
|
+
* @returns The active {@linkcode PluginPresentationView}, or `null` if none is
|
|
68
|
+
* active.
|
|
69
|
+
*
|
|
70
|
+
* @examplePrompt Which view is active right now?
|
|
71
|
+
* @examplePrompt Get the current view
|
|
72
|
+
* @examplePrompt What view am I looking at?
|
|
73
|
+
*
|
|
74
|
+
* # Example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const active = await snaptrude.presentation.views.getActive()
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
public abstract getActive(): PluginApiReturn<PluginPresentationViewsGetResult>
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Capture a screenshot of a view as a base64 image.
|
|
83
|
+
*
|
|
84
|
+
* Captures the **current** viewport by default; pass `viewId` to capture a
|
|
85
|
+
* specific saved view (which briefly applies that view to the scene). Use
|
|
86
|
+
* `format`/`resolution` to control the output.
|
|
87
|
+
*
|
|
88
|
+
* @param options - All optional: `viewId` (capture this saved view; omit for the
|
|
89
|
+
* current viewport), `format` (default `"png"`), `resolution` (e.g. `"1280x720"`).
|
|
90
|
+
* @returns A {@linkcode PluginPresentationViewsCaptureResult} with the base64
|
|
91
|
+
* `image` data URL.
|
|
92
|
+
* @throws If a given `viewId` does not exist.
|
|
93
|
+
*
|
|
94
|
+
* @examplePrompt Take a screenshot of the current view
|
|
95
|
+
* @examplePrompt Capture this view as a PNG
|
|
96
|
+
* @examplePrompt Render the Site Plan view to an image
|
|
97
|
+
* @examplePrompt Export a high-res image of what I'm looking at
|
|
98
|
+
*
|
|
99
|
+
* # Example
|
|
100
|
+
* ```ts
|
|
101
|
+
* const { image } = await snaptrude.presentation.views.capture({ format: "png" })
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
public abstract capture(options?: {
|
|
105
|
+
viewId?: string
|
|
106
|
+
format?: "png" | "jpeg"
|
|
107
|
+
resolution?: string
|
|
108
|
+
}): PluginApiReturn<PluginPresentationViewsCaptureResult>
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Activate a saved view — move the camera to it and restore its scene state.
|
|
112
|
+
*
|
|
113
|
+
* Applies the view's camera, visibility, and storey state to the live scene.
|
|
114
|
+
* Paired with {@linkcode PluginPresentationViewsApi.getActive}.
|
|
115
|
+
*
|
|
116
|
+
* @param viewId - The id of the view to activate.
|
|
117
|
+
* @returns The id of the now-active view.
|
|
118
|
+
* @throws If no view has the given id.
|
|
119
|
+
*
|
|
120
|
+
* @examplePrompt Switch to the Ground Floor plan view
|
|
121
|
+
* @examplePrompt Make the 3D view active
|
|
122
|
+
* @examplePrompt Go to the view named Entrance
|
|
123
|
+
* @examplePrompt Load the site plan view
|
|
124
|
+
*
|
|
125
|
+
* # Example
|
|
126
|
+
* ```ts
|
|
127
|
+
* await snaptrude.presentation.views.setActive("view_123")
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
public abstract setActive(
|
|
131
|
+
viewId: string,
|
|
132
|
+
): PluginApiReturn<PluginPresentationViewsSetActiveResult>
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Save the current camera/scene state as a new named view.
|
|
136
|
+
*
|
|
137
|
+
* Creates a camera bookmark (not geometry) from where the camera is now.
|
|
138
|
+
*
|
|
139
|
+
* @param name - Name for the new view (a default is used when omitted).
|
|
140
|
+
* @param options - Optional `kind` (what kind of view to save, default
|
|
141
|
+
* `"view"`) and `storey` (save the view on a specific storey — the storey is
|
|
142
|
+
* activated first, matching the storey the view is captured on; when omitted
|
|
143
|
+
* the current active storey is used).
|
|
144
|
+
* @returns The newly created {@linkcode PluginPresentationView}.
|
|
145
|
+
* @throws If `storey` is given but no such storey exists, or the view could
|
|
146
|
+
* not be saved.
|
|
147
|
+
*
|
|
148
|
+
* @examplePrompt Save the current view as Lobby Perspective
|
|
149
|
+
* @examplePrompt Create a new saved view from where I'm looking
|
|
150
|
+
* @examplePrompt Bookmark this camera angle
|
|
151
|
+
* @examplePrompt Save the current 2D plan as a view
|
|
152
|
+
* @examplePrompt Save a view on the second storey
|
|
153
|
+
*
|
|
154
|
+
* # Example
|
|
155
|
+
* ```ts
|
|
156
|
+
* const view = await snaptrude.presentation.views.create("Lobby")
|
|
157
|
+
* // …or capture the view on a specific storey
|
|
158
|
+
* const level2 = await snaptrude.presentation.views.create("Level 2", { storey: 2 })
|
|
159
|
+
* ```
|
|
160
|
+
*/
|
|
161
|
+
public abstract create(
|
|
162
|
+
name?: string,
|
|
163
|
+
options?: { kind?: "view" | "sitePlan"; storey?: number },
|
|
164
|
+
): PluginApiReturn<PluginPresentationViewsCreateResult>
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Read a saved view's display settings (background, color mode, view mode,
|
|
168
|
+
* axis, edges, labels).
|
|
169
|
+
*
|
|
170
|
+
* @param viewId - The id of the view to read settings for.
|
|
171
|
+
* @returns The view's {@linkcode PluginPresentationViewSettings}, or `null` if
|
|
172
|
+
* no view has that id.
|
|
173
|
+
*
|
|
174
|
+
* @examplePrompt What color mode is the Ground Floor view using?
|
|
175
|
+
* @examplePrompt Get the display settings for this view
|
|
176
|
+
* @examplePrompt Does the site plan view show axes and labels?
|
|
177
|
+
* @examplePrompt Read the background color of the active view
|
|
178
|
+
*
|
|
179
|
+
* # Example
|
|
180
|
+
* ```ts
|
|
181
|
+
* const settings = await snaptrude.presentation.views.getSettings("view_123")
|
|
182
|
+
* if (settings) console.log(settings.colorMode, settings.backgroundColor)
|
|
183
|
+
* ```
|
|
184
|
+
*/
|
|
185
|
+
public abstract getSettings(
|
|
186
|
+
viewId: string,
|
|
187
|
+
): PluginApiReturn<PluginPresentationViewsGetSettingsResult>
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Update a saved view's display settings (partial patch — only the fields you
|
|
191
|
+
* pass change).
|
|
192
|
+
*
|
|
193
|
+
* Persists and broadcasts the change; if the view is currently active, the
|
|
194
|
+
* scene updates live. **Not Ctrl+Z-undoable** — view-metadata edits publish
|
|
195
|
+
* directly and do not land on the local undo stack; this matches how the
|
|
196
|
+
* product's own view-settings UI behaves.
|
|
197
|
+
*
|
|
198
|
+
* Label patch semantics (mirroring the product, which stores no label
|
|
199
|
+
* selection while labels are off):
|
|
200
|
+
*
|
|
201
|
+
* - `{ showLabels: true }` alone turns labels on; if the view has no stored
|
|
202
|
+
* selection, the product defaults (`objectLabels`, `areas`) are applied —
|
|
203
|
+
* labels are never "on" with an empty selection (the product has no such
|
|
204
|
+
* state; labels render only while the selection is non-empty).
|
|
205
|
+
* - `{ labels: [...] }` alone sets the selection **and turns labels on**.
|
|
206
|
+
* - `{ showLabels: false }` turns labels off and **clears the stored
|
|
207
|
+
* selection** — a later read returns `labels: []`.
|
|
208
|
+
* - `{ showLabels: false, labels: [...] }` with a non-empty list is
|
|
209
|
+
* contradictory and **rejected** (nothing is silently discarded).
|
|
210
|
+
* - `{ showLabels: true, labels: [] }` is likewise contradictory and
|
|
211
|
+
* **rejected** — pass a non-empty list, or omit `labels` to get the
|
|
212
|
+
* defaults.
|
|
213
|
+
*
|
|
214
|
+
* `colorMode` accepts the `tag:<categoryId>` scheme strings returned by
|
|
215
|
+
* {@linkcode PluginPresentationViewsApi.getSettings}, so read-then-write
|
|
216
|
+
* round-trips a tag-based color scheme unchanged.
|
|
217
|
+
*
|
|
218
|
+
* `viewMode` (`"perspective"` | `"isometric"`) applies to **3D views only** —
|
|
219
|
+
* a 2D plan is always orthographic, so a `viewMode: "perspective"` patch on a
|
|
220
|
+
* 2D view is rejected. `"isometric"` on a 2D plan is accepted as a no-op (the
|
|
221
|
+
* plan is already orthographic), so writing back exactly what
|
|
222
|
+
* {@linkcode PluginPresentationViewsApi.getSettings} returned is always a
|
|
223
|
+
* no-op. On the active view the camera switches projection live (the same
|
|
224
|
+
* toggle the view-settings modal runs); on other views the mode is applied
|
|
225
|
+
* the next time the view is activated.
|
|
226
|
+
*
|
|
227
|
+
* @param viewId - The id of the view to update.
|
|
228
|
+
* @param settings - A partial {@linkcode PluginPresentationViewSettings}; any
|
|
229
|
+
* omitted field is left unchanged.
|
|
230
|
+
* @returns The updated view's `id`.
|
|
231
|
+
* @throws If writes are disabled, no view has the given id, the patch is
|
|
232
|
+
* contradictory (`showLabels: false` with a non-empty `labels`, or
|
|
233
|
+
* `showLabels: true` with an explicitly empty `labels` list), or
|
|
234
|
+
* `viewMode: "perspective"` is patched on a 2D plan view.
|
|
235
|
+
*
|
|
236
|
+
* @examplePrompt Switch this view to monochrome color mode
|
|
237
|
+
* @examplePrompt Turn off the axis in the Ground Floor view
|
|
238
|
+
* @examplePrompt Set the background of the active view to white
|
|
239
|
+
* @examplePrompt Show area labels on this view
|
|
240
|
+
* @examplePrompt Enable hidden-line mode for the section view
|
|
241
|
+
* @examplePrompt Make the 3D view orthographic instead of perspective
|
|
242
|
+
*
|
|
243
|
+
* # Example
|
|
244
|
+
* ```ts
|
|
245
|
+
* await snaptrude.presentation.views.updateSettings("view_123", {
|
|
246
|
+
* colorMode: "monochrome",
|
|
247
|
+
* showAxis: false,
|
|
248
|
+
* })
|
|
249
|
+
* // switch a 3D view to an isometric (orthographic) projection
|
|
250
|
+
* await snaptrude.presentation.views.updateSettings("view_123", {
|
|
251
|
+
* viewMode: "isometric",
|
|
252
|
+
* })
|
|
253
|
+
* ```
|
|
254
|
+
*/
|
|
255
|
+
public abstract updateSettings(
|
|
256
|
+
viewId: string,
|
|
257
|
+
settings: Partial<PluginPresentationViewSettings>,
|
|
258
|
+
): PluginApiReturn<PluginPresentationViewsUpdateSettingsResult>
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Rename a saved view.
|
|
262
|
+
*
|
|
263
|
+
* Sets the view's display name — the same label the views panel shows and
|
|
264
|
+
* that `list`/`get` read back. Names must be unique within the proposal and
|
|
265
|
+
* cannot contain the characters `\ : { } [ ] | ; < > ? ~`.
|
|
266
|
+
*
|
|
267
|
+
* @param viewId - The id of the view to rename.
|
|
268
|
+
* @param name - The new display name (non-empty after trimming).
|
|
269
|
+
* @returns The updated {@linkcode PluginPresentationView}.
|
|
270
|
+
* @throws If writes are disabled, no view has the given id, the name is
|
|
271
|
+
* empty/invalid, or another view in the proposal already has that name.
|
|
272
|
+
*
|
|
273
|
+
* @examplePrompt Rename the view Lobby to Entrance Lobby
|
|
274
|
+
* @examplePrompt Call this view Ground Floor Plan
|
|
275
|
+
* @examplePrompt Change the active view's name to Final
|
|
276
|
+
*
|
|
277
|
+
* # Example
|
|
278
|
+
* ```ts
|
|
279
|
+
* const view = await snaptrude.presentation.views.rename("view_123", "Entrance")
|
|
280
|
+
* ```
|
|
281
|
+
*/
|
|
282
|
+
public abstract rename(
|
|
283
|
+
viewId: string,
|
|
284
|
+
name: string,
|
|
285
|
+
): PluginApiReturn<PluginPresentationViewsRenameResult>
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Delete a saved view.
|
|
289
|
+
*
|
|
290
|
+
* Removes the view from the project and the views panel (the panel's own
|
|
291
|
+
* delete action). If the deleted view was active, the product falls back to
|
|
292
|
+
* the default plan/3D view. Default views (the built-in plan/3D/site-plan
|
|
293
|
+
* entries) cannot be deleted.
|
|
294
|
+
*
|
|
295
|
+
* @param viewId - The id of the view to delete.
|
|
296
|
+
* @returns The id of the deleted view
|
|
297
|
+
* (a {@linkcode PluginPresentationViewsDeleteResult}).
|
|
298
|
+
* @throws If writes are disabled, no view has the given id, or the view is a
|
|
299
|
+
* default view.
|
|
300
|
+
*
|
|
301
|
+
* @examplePrompt Delete the view named Old Draft
|
|
302
|
+
* @examplePrompt Remove this saved view
|
|
303
|
+
* @examplePrompt Get rid of the Lobby camera bookmark
|
|
304
|
+
*
|
|
305
|
+
* # Example
|
|
306
|
+
* ```ts
|
|
307
|
+
* const { id } = await snaptrude.presentation.views.delete("view_123")
|
|
308
|
+
* ```
|
|
309
|
+
*/
|
|
310
|
+
public abstract delete(
|
|
311
|
+
viewId: string,
|
|
312
|
+
): PluginApiReturn<PluginPresentationViewsDeleteResult>
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* The rendering category of a saved view. Existing plan/3D values are preserved;
|
|
317
|
+
* elevations are identified independently of their orthographic 3D camera.
|
|
318
|
+
*/
|
|
319
|
+
export const PluginPresentationViewType = z.enum(["2d", "3d", "elevation"])
|
|
320
|
+
export type PluginPresentationViewType = z.infer<
|
|
321
|
+
typeof PluginPresentationViewType
|
|
322
|
+
>
|
|
323
|
+
|
|
324
|
+
/** The native semantic kind persisted for a saved view. */
|
|
325
|
+
export const PluginPresentationViewKind = z.enum([
|
|
326
|
+
"plan",
|
|
327
|
+
"sitePlan",
|
|
328
|
+
"threeD",
|
|
329
|
+
"elevation",
|
|
330
|
+
])
|
|
331
|
+
export type PluginPresentationViewKind = z.infer<
|
|
332
|
+
typeof PluginPresentationViewKind
|
|
333
|
+
>
|
|
334
|
+
|
|
335
|
+
/** Cardinal direction for an elevation; non-elevation views return `null`. */
|
|
336
|
+
export const PluginPresentationElevationDirection = z.enum([
|
|
337
|
+
"north",
|
|
338
|
+
"east",
|
|
339
|
+
"south",
|
|
340
|
+
"west",
|
|
341
|
+
])
|
|
342
|
+
export type PluginPresentationElevationDirection = z.infer<
|
|
343
|
+
typeof PluginPresentationElevationDirection
|
|
344
|
+
>
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* A saved presentation view.
|
|
348
|
+
*
|
|
349
|
+
* | Property | Type | Description |
|
|
350
|
+
* |---|---|---|
|
|
351
|
+
* | `id` | `string` | Unique view id |
|
|
352
|
+
* | `name` | `string` | Display name |
|
|
353
|
+
* | `type` | `"2d" \| "3d" \| "elevation"` | Rendering category; elevations are distinct from ordinary 3D views |
|
|
354
|
+
* | `kind` | {@linkcode PluginPresentationViewKind} | Native semantic view kind |
|
|
355
|
+
* | `direction` | {@linkcode PluginPresentationElevationDirection}` \| null` | Cardinal direction for elevations; otherwise `null` |
|
|
356
|
+
* | `isActive` | `boolean` | Whether this view is the currently active view |
|
|
357
|
+
* | `storey` | `number \| null` | The storey this view was saved on (`null` on older views saved without one) |
|
|
358
|
+
*/
|
|
359
|
+
export const PluginPresentationView = z.object({
|
|
360
|
+
id: z.string(),
|
|
361
|
+
name: z.string(),
|
|
362
|
+
type: PluginPresentationViewType,
|
|
363
|
+
kind: PluginPresentationViewKind,
|
|
364
|
+
direction: PluginPresentationElevationDirection.nullable(),
|
|
365
|
+
isActive: z.boolean(),
|
|
366
|
+
storey: z.number().nullable(),
|
|
367
|
+
})
|
|
368
|
+
export type PluginPresentationView = z.infer<typeof PluginPresentationView>
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Result of {@linkcode PluginPresentationViewsApi.list}.
|
|
372
|
+
*
|
|
373
|
+
* | Property | Type | Description |
|
|
374
|
+
* |---|---|---|
|
|
375
|
+
* | `views` | {@linkcode PluginPresentationView}`[]` | All saved views in the project |
|
|
376
|
+
*/
|
|
377
|
+
export const PluginPresentationViewsListResult = z.object({
|
|
378
|
+
views: z.array(PluginPresentationView),
|
|
379
|
+
})
|
|
380
|
+
export type PluginPresentationViewsListResult = z.infer<
|
|
381
|
+
typeof PluginPresentationViewsListResult
|
|
382
|
+
>
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Arguments for {@linkcode PluginPresentationViewsApi.get}.
|
|
386
|
+
*
|
|
387
|
+
* | Property | Type | Description |
|
|
388
|
+
* |---|---|---|
|
|
389
|
+
* | `id` | `string` | The id of the view to read |
|
|
390
|
+
*/
|
|
391
|
+
export const PluginPresentationViewsGetArgs = z.object({
|
|
392
|
+
id: z.string(),
|
|
393
|
+
})
|
|
394
|
+
export type PluginPresentationViewsGetArgs = z.infer<
|
|
395
|
+
typeof PluginPresentationViewsGetArgs
|
|
396
|
+
>
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Result of {@linkcode PluginPresentationViewsApi.get} and
|
|
400
|
+
* {@linkcode PluginPresentationViewsApi.getActive} — the view, or `null` when
|
|
401
|
+
* there is no match / no active view.
|
|
402
|
+
*/
|
|
403
|
+
export const PluginPresentationViewsGetResult =
|
|
404
|
+
PluginPresentationView.nullable()
|
|
405
|
+
export type PluginPresentationViewsGetResult = z.infer<
|
|
406
|
+
typeof PluginPresentationViewsGetResult
|
|
407
|
+
>
|
|
408
|
+
|
|
409
|
+
/** Image format for {@linkcode PluginPresentationViewsApi.capture}. */
|
|
410
|
+
export const PluginPresentationImageFormat = z.enum(["png", "jpeg"])
|
|
411
|
+
export type PluginPresentationImageFormat = z.infer<
|
|
412
|
+
typeof PluginPresentationImageFormat
|
|
413
|
+
>
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Arguments for {@linkcode PluginPresentationViewsApi.capture}. All optional.
|
|
417
|
+
*
|
|
418
|
+
* | Property | Type | Description |
|
|
419
|
+
* |---|---|---|
|
|
420
|
+
* | `viewId` | `string \| undefined` | Capture this saved view; omit to capture the current viewport |
|
|
421
|
+
* | `format` | `"png" \| "jpeg" \| undefined` | Output image format (default `"png"`) |
|
|
422
|
+
* | `resolution` | `string \| undefined` | Optional resolution hint (e.g. `"1280x720"`) |
|
|
423
|
+
*/
|
|
424
|
+
export const PluginPresentationViewsCaptureArgs = z.object({
|
|
425
|
+
viewId: z.string().optional(),
|
|
426
|
+
format: PluginPresentationImageFormat.optional(),
|
|
427
|
+
resolution: z.string().optional(),
|
|
428
|
+
})
|
|
429
|
+
export type PluginPresentationViewsCaptureArgs = z.infer<
|
|
430
|
+
typeof PluginPresentationViewsCaptureArgs
|
|
431
|
+
>
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Result of {@linkcode PluginPresentationViewsApi.capture}.
|
|
435
|
+
*
|
|
436
|
+
* | Property | Type | Description |
|
|
437
|
+
* |---|---|---|
|
|
438
|
+
* | `image` | `string` | The captured image as a base64 data URL |
|
|
439
|
+
*/
|
|
440
|
+
export const PluginPresentationViewsCaptureResult = z.object({
|
|
441
|
+
image: z.string(),
|
|
442
|
+
})
|
|
443
|
+
export type PluginPresentationViewsCaptureResult = z.infer<
|
|
444
|
+
typeof PluginPresentationViewsCaptureResult
|
|
445
|
+
>
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Arguments for {@linkcode PluginPresentationViewsApi.setActive}.
|
|
449
|
+
*
|
|
450
|
+
* | Property | Type | Description |
|
|
451
|
+
* |---|---|---|
|
|
452
|
+
* | `id` | `string` | The id of the view to activate |
|
|
453
|
+
*/
|
|
454
|
+
export const PluginPresentationViewsSetActiveArgs = z.object({
|
|
455
|
+
id: z.string(),
|
|
456
|
+
})
|
|
457
|
+
export type PluginPresentationViewsSetActiveArgs = z.infer<
|
|
458
|
+
typeof PluginPresentationViewsSetActiveArgs
|
|
459
|
+
>
|
|
460
|
+
|
|
461
|
+
/** Result of {@linkcode PluginPresentationViewsApi.setActive} — the active view's id. */
|
|
462
|
+
export const PluginPresentationViewsSetActiveResult = z.object({
|
|
463
|
+
id: z.string(),
|
|
464
|
+
})
|
|
465
|
+
export type PluginPresentationViewsSetActiveResult = z.infer<
|
|
466
|
+
typeof PluginPresentationViewsSetActiveResult
|
|
467
|
+
>
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Arguments for {@linkcode PluginPresentationViewsApi.create}. All optional.
|
|
471
|
+
*
|
|
472
|
+
* | Property | Type | Description |
|
|
473
|
+
* |---|---|---|
|
|
474
|
+
* | `name` | `string \| undefined` | Name for the new view (a default is used when omitted) |
|
|
475
|
+
* | `kind` | `"view" \| "sitePlan" \| undefined` | What kind of view to save (default `"view"`). `"plan"` is not offered — the host cannot create a plan view without a `planId` this API does not carry. |
|
|
476
|
+
* | `storey` | `number \| undefined` | Save the view on this storey (activated before capture); defaults to the current active storey |
|
|
477
|
+
*/
|
|
478
|
+
export const PluginPresentationViewsCreateArgs = z.object({
|
|
479
|
+
name: z.string().optional(),
|
|
480
|
+
kind: z.enum(["view", "sitePlan"]).optional(),
|
|
481
|
+
storey: z.number().optional(),
|
|
482
|
+
})
|
|
483
|
+
export type PluginPresentationViewsCreateArgs = z.infer<
|
|
484
|
+
typeof PluginPresentationViewsCreateArgs
|
|
485
|
+
>
|
|
486
|
+
|
|
487
|
+
/** Result of {@linkcode PluginPresentationViewsApi.create} — the saved view. */
|
|
488
|
+
export const PluginPresentationViewsCreateResult = PluginPresentationView
|
|
489
|
+
export type PluginPresentationViewsCreateResult = z.infer<
|
|
490
|
+
typeof PluginPresentationViewsCreateResult
|
|
491
|
+
>
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* How the scene is colored in a view.
|
|
495
|
+
*
|
|
496
|
+
* | Value | Meaning |
|
|
497
|
+
* |---|---|
|
|
498
|
+
* | `monochrome` | Flat single-tone shading |
|
|
499
|
+
* | `texture` | Material textures/colors |
|
|
500
|
+
* | `department` | Colored by department |
|
|
501
|
+
* | `tag:<categoryId>` | Colored by a project tag category (e.g. `tag:ZONE`) |
|
|
502
|
+
*
|
|
503
|
+
* The `tag:<categoryId>` form carries the product's tag-based color schemes
|
|
504
|
+
* losslessly — reading a view that uses one returns the `tag:` string as-is,
|
|
505
|
+
* and writing it back preserves the scheme (read-then-write is safe).
|
|
506
|
+
*/
|
|
507
|
+
export const PluginPresentationViewColorMode = z.union([
|
|
508
|
+
z.enum(["monochrome", "texture", "department"]),
|
|
509
|
+
z.templateLiteral(["tag:", z.string()]),
|
|
510
|
+
])
|
|
511
|
+
export type PluginPresentationViewColorMode = z.infer<
|
|
512
|
+
typeof PluginPresentationViewColorMode
|
|
513
|
+
>
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* A category of on-canvas labels a view can show.
|
|
517
|
+
*
|
|
518
|
+
* | Value | Meaning |
|
|
519
|
+
* |---|---|
|
|
520
|
+
* | `objectLabels` | Per-object name labels |
|
|
521
|
+
* | `areas` | Area/room labels |
|
|
522
|
+
* | `department` | Department labels |
|
|
523
|
+
*/
|
|
524
|
+
export const PluginPresentationViewLabel = z.enum([
|
|
525
|
+
"objectLabels",
|
|
526
|
+
"areas",
|
|
527
|
+
"department",
|
|
528
|
+
])
|
|
529
|
+
export type PluginPresentationViewLabel = z.infer<
|
|
530
|
+
typeof PluginPresentationViewLabel
|
|
531
|
+
>
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* A view's camera projection: perspective, or isometric (orthographic).
|
|
535
|
+
*
|
|
536
|
+
* | Value | Meaning |
|
|
537
|
+
* |---|---|
|
|
538
|
+
* | `perspective` | Perspective projection (vanishing points) |
|
|
539
|
+
* | `isometric` | Orthographic projection (no perspective distortion) |
|
|
540
|
+
*
|
|
541
|
+
* Applies to 3D views; a 2D plan view is always orthographic and reads
|
|
542
|
+
* `"isometric"`.
|
|
543
|
+
*/
|
|
544
|
+
export const PluginPresentationViewMode = z.enum(["perspective", "isometric"])
|
|
545
|
+
export type PluginPresentationViewMode = z.infer<
|
|
546
|
+
typeof PluginPresentationViewMode
|
|
547
|
+
>
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* A view's display settings.
|
|
551
|
+
*
|
|
552
|
+
* | Property | Type | Description |
|
|
553
|
+
* |---|---|---|
|
|
554
|
+
* | `backgroundColor` | `string` | Canvas background as a hex color (e.g. `#ffffff`) |
|
|
555
|
+
* | `colorMode` | {@linkcode PluginPresentationViewColorMode} | How the scene is colored (including `tag:<categoryId>` schemes) |
|
|
556
|
+
* | `viewMode` | {@linkcode PluginPresentationViewMode} | Camera projection — `"perspective"` or `"isometric"` (orthographic). Writable on 3D views only; a 2D plan always reads `"isometric"` and accepts only `"isometric"` (a no-op) |
|
|
557
|
+
* | `showAxis` | `boolean` | Whether the X/Y/Z axes are shown |
|
|
558
|
+
* | `showEdges` | `boolean` | Whether edges are shown; `false` = hidden-line rendering |
|
|
559
|
+
* | `showLabels` | `boolean` | Master label switch — whether on-canvas labels are shown at all. `true` always pairs with a non-empty `labels` selection (labels render only while the selection is non-empty; there is no labels-on-with-empty-selection state) |
|
|
560
|
+
* | `labels` | {@linkcode PluginPresentationViewLabel}`[]` | Which label categories are selected. When `showLabels` is `false` the view stores no selection and this reads `[]` |
|
|
561
|
+
*/
|
|
562
|
+
export const PluginPresentationViewSettings = z.object({
|
|
563
|
+
backgroundColor: z.string(),
|
|
564
|
+
colorMode: PluginPresentationViewColorMode,
|
|
565
|
+
viewMode: PluginPresentationViewMode,
|
|
566
|
+
showAxis: z.boolean(),
|
|
567
|
+
showEdges: z.boolean(),
|
|
568
|
+
showLabels: z.boolean(),
|
|
569
|
+
labels: z.array(PluginPresentationViewLabel),
|
|
570
|
+
})
|
|
571
|
+
export type PluginPresentationViewSettings = z.infer<
|
|
572
|
+
typeof PluginPresentationViewSettings
|
|
573
|
+
>
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Arguments for {@linkcode PluginPresentationViewsApi.getSettings}.
|
|
577
|
+
*
|
|
578
|
+
* | Property | Type | Description |
|
|
579
|
+
* |---|---|---|
|
|
580
|
+
* | `id` | `string` | The id of the view to read settings for |
|
|
581
|
+
*/
|
|
582
|
+
export const PluginPresentationViewsGetSettingsArgs = z.object({
|
|
583
|
+
id: z.string(),
|
|
584
|
+
})
|
|
585
|
+
export type PluginPresentationViewsGetSettingsArgs = z.infer<
|
|
586
|
+
typeof PluginPresentationViewsGetSettingsArgs
|
|
587
|
+
>
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Result of {@linkcode PluginPresentationViewsApi.getSettings} — the settings,
|
|
591
|
+
* or `null` when no view has that id.
|
|
592
|
+
*/
|
|
593
|
+
export const PluginPresentationViewsGetSettingsResult =
|
|
594
|
+
PluginPresentationViewSettings.nullable()
|
|
595
|
+
export type PluginPresentationViewsGetSettingsResult = z.infer<
|
|
596
|
+
typeof PluginPresentationViewsGetSettingsResult
|
|
597
|
+
>
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Arguments for {@linkcode PluginPresentationViewsApi.updateSettings}. The
|
|
601
|
+
* `settings` patch is partial — any omitted field is left unchanged. A patch
|
|
602
|
+
* pairing `showLabels: false` with a non-empty `labels` list, or
|
|
603
|
+
* `showLabels: true` with an explicitly empty `labels` list, is rejected as
|
|
604
|
+
* contradictory (see the method JSDoc for the full label patch semantics).
|
|
605
|
+
*
|
|
606
|
+
* | Property | Type | Description |
|
|
607
|
+
* |---|---|---|
|
|
608
|
+
* | `id` | `string` | The id of the view to update |
|
|
609
|
+
* | `settings` | `Partial<`{@linkcode PluginPresentationViewSettings}`>` | The fields to change |
|
|
610
|
+
*/
|
|
611
|
+
export const PluginPresentationViewsUpdateSettingsArgs = z
|
|
612
|
+
.object({
|
|
613
|
+
id: z.string(),
|
|
614
|
+
settings: PluginPresentationViewSettings.partial(),
|
|
615
|
+
})
|
|
616
|
+
.refine(
|
|
617
|
+
(v) =>
|
|
618
|
+
!(
|
|
619
|
+
v.settings.showLabels === false && (v.settings.labels?.length ?? 0) > 0
|
|
620
|
+
),
|
|
621
|
+
{
|
|
622
|
+
message:
|
|
623
|
+
"Contradictory patch: labels cannot be set while showLabels is false",
|
|
624
|
+
},
|
|
625
|
+
)
|
|
626
|
+
.refine(
|
|
627
|
+
(v) =>
|
|
628
|
+
!(
|
|
629
|
+
v.settings.showLabels === true &&
|
|
630
|
+
v.settings.labels !== undefined &&
|
|
631
|
+
v.settings.labels.length === 0
|
|
632
|
+
),
|
|
633
|
+
{
|
|
634
|
+
message:
|
|
635
|
+
"Contradictory patch: showLabels cannot be true with an explicitly empty labels list — pass a non-empty list, or omit labels to apply the defaults",
|
|
636
|
+
},
|
|
637
|
+
)
|
|
638
|
+
export type PluginPresentationViewsUpdateSettingsArgs = z.infer<
|
|
639
|
+
typeof PluginPresentationViewsUpdateSettingsArgs
|
|
640
|
+
>
|
|
641
|
+
|
|
642
|
+
/** Result of {@linkcode PluginPresentationViewsApi.updateSettings} — the updated view's id. */
|
|
643
|
+
export const PluginPresentationViewsUpdateSettingsResult = z.object({
|
|
644
|
+
id: z.string(),
|
|
645
|
+
})
|
|
646
|
+
export type PluginPresentationViewsUpdateSettingsResult = z.infer<
|
|
647
|
+
typeof PluginPresentationViewsUpdateSettingsResult
|
|
648
|
+
>
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* Arguments for {@linkcode PluginPresentationViewsApi.rename}.
|
|
652
|
+
*
|
|
653
|
+
* | Property | Type | Description |
|
|
654
|
+
* |---|---|---|
|
|
655
|
+
* | `id` | `string` | The id of the view to rename |
|
|
656
|
+
* | `name` | `string` | New display name (non-empty after trimming) |
|
|
657
|
+
*/
|
|
658
|
+
export const PluginPresentationViewsRenameArgs = z.object({
|
|
659
|
+
id: z.string(),
|
|
660
|
+
name: z.string().trim().min(1),
|
|
661
|
+
})
|
|
662
|
+
export type PluginPresentationViewsRenameArgs = z.infer<
|
|
663
|
+
typeof PluginPresentationViewsRenameArgs
|
|
664
|
+
>
|
|
665
|
+
|
|
666
|
+
/** Result of {@linkcode PluginPresentationViewsApi.rename} — the renamed view. */
|
|
667
|
+
export const PluginPresentationViewsRenameResult = PluginPresentationView
|
|
668
|
+
export type PluginPresentationViewsRenameResult = z.infer<
|
|
669
|
+
typeof PluginPresentationViewsRenameResult
|
|
670
|
+
>
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Arguments for {@linkcode PluginPresentationViewsApi.delete}.
|
|
674
|
+
*
|
|
675
|
+
* | Property | Type | Description |
|
|
676
|
+
* |---|---|---|
|
|
677
|
+
* | `id` | `string` | The id of the view to delete |
|
|
678
|
+
*/
|
|
679
|
+
export const PluginPresentationViewsDeleteArgs = z.object({
|
|
680
|
+
id: z.string(),
|
|
681
|
+
})
|
|
682
|
+
export type PluginPresentationViewsDeleteArgs = z.infer<
|
|
683
|
+
typeof PluginPresentationViewsDeleteArgs
|
|
684
|
+
>
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Result of {@linkcode PluginPresentationViewsApi.delete}.
|
|
688
|
+
*
|
|
689
|
+
* | Property | Type | Description |
|
|
690
|
+
* |---|---|---|
|
|
691
|
+
* | `id` | `string` | Id of the deleted view |
|
|
692
|
+
*/
|
|
693
|
+
export const PluginPresentationViewsDeleteResult = z.object({
|
|
694
|
+
id: z.string(),
|
|
695
|
+
})
|
|
696
|
+
export type PluginPresentationViewsDeleteResult = z.infer<
|
|
697
|
+
typeof PluginPresentationViewsDeleteResult
|
|
698
|
+
>
|