@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,529 @@
|
|
|
1
|
+
import * as z from "zod"
|
|
2
|
+
import type { PluginApiReturn } from "../../types"
|
|
3
|
+
import {
|
|
4
|
+
PluginPlacedView,
|
|
5
|
+
PluginPlacedViewCrop,
|
|
6
|
+
PluginPlacedViewStylePatch,
|
|
7
|
+
PluginViewLineStyle,
|
|
8
|
+
PluginPlacedViewLabel,
|
|
9
|
+
} from "./placedViews"
|
|
10
|
+
import { PluginSheetPosition } from "./sheets"
|
|
11
|
+
import { PluginPresentationExportResolution } from "./export"
|
|
12
|
+
|
|
13
|
+
/** Drawing ids are existing Present view-shape ids, stable across reload and undo. */
|
|
14
|
+
export const PluginDrawingIdArgs = z
|
|
15
|
+
.object({ drawingId: z.string().min(1) })
|
|
16
|
+
.strict()
|
|
17
|
+
export const PluginDrawingNameArgs = PluginDrawingIdArgs.extend({
|
|
18
|
+
name: z.string().trim().min(1),
|
|
19
|
+
})
|
|
20
|
+
export const PluginDrawingIdsArgs = z
|
|
21
|
+
.object({ drawingIds: z.array(z.string().min(1)).min(1).max(100) })
|
|
22
|
+
.strict()
|
|
23
|
+
export const PluginDrawingCreateOptions = z
|
|
24
|
+
.object({
|
|
25
|
+
position: PluginSheetPosition.optional(),
|
|
26
|
+
scale: z.number().finite().positive().optional(),
|
|
27
|
+
})
|
|
28
|
+
.strict()
|
|
29
|
+
export type PluginDrawingCreateOptions = z.infer<
|
|
30
|
+
typeof PluginDrawingCreateOptions
|
|
31
|
+
>
|
|
32
|
+
export const PluginDrawingCreateArgs = PluginDrawingCreateOptions.extend({
|
|
33
|
+
viewId: z.string().min(1),
|
|
34
|
+
})
|
|
35
|
+
export type PluginDrawingCreateArgs = z.infer<typeof PluginDrawingCreateArgs>
|
|
36
|
+
export type PluginDrawingIdArgs = z.infer<typeof PluginDrawingIdArgs>
|
|
37
|
+
export type PluginDrawingNameArgs = z.infer<typeof PluginDrawingNameArgs>
|
|
38
|
+
export type PluginDrawingIdsArgs = z.infer<typeof PluginDrawingIdsArgs>
|
|
39
|
+
export const PluginDrawingScaleArgs = PluginDrawingIdArgs.extend({
|
|
40
|
+
scale: z.number().finite().positive(),
|
|
41
|
+
})
|
|
42
|
+
export type PluginDrawingScaleArgs = z.infer<typeof PluginDrawingScaleArgs>
|
|
43
|
+
export const PluginDrawingCropArgs = PluginDrawingIdArgs.extend({
|
|
44
|
+
crop: PluginPlacedViewCrop.nullable(),
|
|
45
|
+
})
|
|
46
|
+
export type PluginDrawingCropArgs = z.infer<typeof PluginDrawingCropArgs>
|
|
47
|
+
export const PluginDrawingPresetArgs = PluginDrawingIdArgs.extend({
|
|
48
|
+
presetId: z.string().min(1),
|
|
49
|
+
})
|
|
50
|
+
export type PluginDrawingPresetArgs = z.infer<typeof PluginDrawingPresetArgs>
|
|
51
|
+
|
|
52
|
+
/** Architectural scale is a denominator (100 means 1:100); positions are Present canvas units. */
|
|
53
|
+
export const PluginDrawing = PluginPlacedView.extend({
|
|
54
|
+
id: z.string(),
|
|
55
|
+
presetId: z.string().nullable(),
|
|
56
|
+
kind: z.enum(["plan", "sitePlan", "threeD", "elevation"]),
|
|
57
|
+
direction: z.enum(["north", "east", "south", "west"]).nullable(),
|
|
58
|
+
})
|
|
59
|
+
export type PluginDrawing = z.infer<typeof PluginDrawing>
|
|
60
|
+
|
|
61
|
+
const color = z.string().regex(/^#[0-9a-fA-F]{6}$/)
|
|
62
|
+
const weight = z.number().finite().min(0).max(2.11)
|
|
63
|
+
const opacity = z.number().finite().min(0).max(100)
|
|
64
|
+
const pattern = z
|
|
65
|
+
.object({
|
|
66
|
+
id: z.string().min(1).optional(),
|
|
67
|
+
scale: z.number().finite().min(0.25).max(4).optional(),
|
|
68
|
+
color: color.optional(),
|
|
69
|
+
background: color.optional(),
|
|
70
|
+
weight: weight.optional(),
|
|
71
|
+
})
|
|
72
|
+
.strict()
|
|
73
|
+
const face = z
|
|
74
|
+
.object({
|
|
75
|
+
fontStyle: z.enum(["400", "500", "700", "italic"]).optional(),
|
|
76
|
+
fontSize: z.enum(["12px", "16px", "24px", "2.5", "3.5", "5"]).optional(),
|
|
77
|
+
color: color.optional(),
|
|
78
|
+
})
|
|
79
|
+
.strict()
|
|
80
|
+
const part = z
|
|
81
|
+
.object({
|
|
82
|
+
show: z.boolean().optional(),
|
|
83
|
+
lineStyle: PluginViewLineStyle.optional(),
|
|
84
|
+
weight: weight.optional(),
|
|
85
|
+
})
|
|
86
|
+
.strict()
|
|
87
|
+
const title = z
|
|
88
|
+
.object({
|
|
89
|
+
show: z.boolean().optional(),
|
|
90
|
+
text: z.string().max(2000).optional(),
|
|
91
|
+
})
|
|
92
|
+
.strict()
|
|
93
|
+
const material = z
|
|
94
|
+
.object({
|
|
95
|
+
show: z.boolean().optional(),
|
|
96
|
+
color: color.optional(),
|
|
97
|
+
pattern: pattern.optional(),
|
|
98
|
+
})
|
|
99
|
+
.strict()
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Vector-plan row patch. Only controls returned by getStyles are accepted for that row.
|
|
103
|
+
* Paper weights are mm; opacity is 0–100. Nested values merge, never replace the whole row.
|
|
104
|
+
* Presets apply to kernel plans only; other drawings use the legacy category patch.
|
|
105
|
+
*/
|
|
106
|
+
export const PluginDrawingVectorStylePatch = z
|
|
107
|
+
.object({
|
|
108
|
+
hide: z.boolean().optional(),
|
|
109
|
+
lineStyle: PluginViewLineStyle.optional(),
|
|
110
|
+
lineColor: color.optional(),
|
|
111
|
+
cutWidth: weight.optional(),
|
|
112
|
+
projectionWidth: weight.optional(),
|
|
113
|
+
weight: weight.optional(),
|
|
114
|
+
fillMode: z.string().optional(),
|
|
115
|
+
fillColor: color.optional(),
|
|
116
|
+
opacity: opacity.optional(),
|
|
117
|
+
pattern: pattern.optional(),
|
|
118
|
+
mask: z.boolean().optional(),
|
|
119
|
+
materials: z
|
|
120
|
+
.object({
|
|
121
|
+
brick: material.optional(),
|
|
122
|
+
glass: material.optional(),
|
|
123
|
+
concrete: material.optional(),
|
|
124
|
+
metalFrame: material.optional(),
|
|
125
|
+
woodFrame: material.optional(),
|
|
126
|
+
plaster: material.optional(),
|
|
127
|
+
paint: material.optional(),
|
|
128
|
+
insulation: material.optional(),
|
|
129
|
+
})
|
|
130
|
+
.strict()
|
|
131
|
+
.optional(),
|
|
132
|
+
components: z
|
|
133
|
+
.object({
|
|
134
|
+
frame: z.boolean().optional(),
|
|
135
|
+
leaf: z.boolean().optional(),
|
|
136
|
+
jambs: z.boolean().optional(),
|
|
137
|
+
glazing: z.boolean().optional(),
|
|
138
|
+
track: z.boolean().optional(),
|
|
139
|
+
operation: z.boolean().optional(),
|
|
140
|
+
operationStyle: PluginViewLineStyle.optional(),
|
|
141
|
+
})
|
|
142
|
+
.strict()
|
|
143
|
+
.optional(),
|
|
144
|
+
tag: z
|
|
145
|
+
.object({
|
|
146
|
+
show: z.boolean().optional(),
|
|
147
|
+
fontFamily: z.string().min(1).optional(),
|
|
148
|
+
fontStyle: z.enum(["400", "500", "700", "italic"]).optional(),
|
|
149
|
+
fontSize: z.enum(["12px", "16px", "24px"]).optional(),
|
|
150
|
+
frame: z.enum(["pill", "hexagon"]).optional(),
|
|
151
|
+
color: color.optional(),
|
|
152
|
+
opacity: opacity.optional(),
|
|
153
|
+
outline: weight.optional(),
|
|
154
|
+
})
|
|
155
|
+
.strict()
|
|
156
|
+
.optional(),
|
|
157
|
+
text: z
|
|
158
|
+
.object({
|
|
159
|
+
show: z.boolean().optional(),
|
|
160
|
+
labels: z.boolean().optional(),
|
|
161
|
+
areas: z.boolean().optional(),
|
|
162
|
+
department: z.boolean().optional(),
|
|
163
|
+
fontFamily: z.string().min(1).optional(),
|
|
164
|
+
color: color.optional(),
|
|
165
|
+
fontSize: z.enum(["12px", "16px", "24px"]).optional(),
|
|
166
|
+
label: face.optional(),
|
|
167
|
+
metrics: face.optional(),
|
|
168
|
+
title: face.optional(),
|
|
169
|
+
scale: face.optional(),
|
|
170
|
+
})
|
|
171
|
+
.strict()
|
|
172
|
+
.optional(),
|
|
173
|
+
detail: z
|
|
174
|
+
.object({ show: z.boolean().optional(), weight: weight.optional() })
|
|
175
|
+
.strict()
|
|
176
|
+
.optional(),
|
|
177
|
+
belowCut: part.optional(),
|
|
178
|
+
aboveCut: part.optional(),
|
|
179
|
+
underlay: part.optional(),
|
|
180
|
+
walkLine: part.optional(),
|
|
181
|
+
breakLine: part.optional(),
|
|
182
|
+
overlay: part.optional(),
|
|
183
|
+
title: title.optional(),
|
|
184
|
+
proposal: title.optional(),
|
|
185
|
+
building: title.optional(),
|
|
186
|
+
scale: z
|
|
187
|
+
.object({
|
|
188
|
+
show: z.boolean().optional(),
|
|
189
|
+
format: z.enum(["automatic", "ratio", "text"]).optional(),
|
|
190
|
+
})
|
|
191
|
+
.strict()
|
|
192
|
+
.optional(),
|
|
193
|
+
scaleBar: z
|
|
194
|
+
.object({
|
|
195
|
+
show: z.boolean().optional(),
|
|
196
|
+
format: z.enum(["divided", "simple"]).optional(),
|
|
197
|
+
length: z.enum(["1", "2", "5", "10"]).optional(),
|
|
198
|
+
})
|
|
199
|
+
.strict()
|
|
200
|
+
.optional(),
|
|
201
|
+
extension: z
|
|
202
|
+
.object({
|
|
203
|
+
show: z.boolean().optional(),
|
|
204
|
+
length: z.enum(["underTitle", "fullWidth"]).optional(),
|
|
205
|
+
weight: weight.optional(),
|
|
206
|
+
color: color.optional(),
|
|
207
|
+
})
|
|
208
|
+
.strict()
|
|
209
|
+
.optional(),
|
|
210
|
+
position: z.enum(["bottomLeft", "bottomCentre", "topLeft"]).optional(),
|
|
211
|
+
})
|
|
212
|
+
.strict()
|
|
213
|
+
export const PluginDrawingStylePatch = z.union([
|
|
214
|
+
PluginDrawingVectorStylePatch,
|
|
215
|
+
PluginPlacedViewStylePatch,
|
|
216
|
+
])
|
|
217
|
+
export type PluginDrawingStylePatch = z.infer<typeof PluginDrawingStylePatch>
|
|
218
|
+
export const PluginDrawingStylesArgs = PluginDrawingIdArgs.extend({
|
|
219
|
+
category: z.string().min(1),
|
|
220
|
+
patch: PluginDrawingStylePatch,
|
|
221
|
+
})
|
|
222
|
+
export type PluginDrawingStylesArgs = z.infer<typeof PluginDrawingStylesArgs>
|
|
223
|
+
|
|
224
|
+
/** One selectable value exposed by a native drawing style control. */
|
|
225
|
+
export const PluginDrawingStyleControlOption = z.object({
|
|
226
|
+
label: z.string(),
|
|
227
|
+
value: z.string(),
|
|
228
|
+
})
|
|
229
|
+
export type PluginDrawingStyleControlOption = z.infer<
|
|
230
|
+
typeof PluginDrawingStyleControlOption
|
|
231
|
+
>
|
|
232
|
+
|
|
233
|
+
/** Numeric bounds exposed by a native drawing style control. */
|
|
234
|
+
export const PluginDrawingStyleControlRange = z.object({
|
|
235
|
+
min: z.number().finite(),
|
|
236
|
+
max: z.number().finite(),
|
|
237
|
+
step: z.number().finite().positive(),
|
|
238
|
+
})
|
|
239
|
+
export type PluginDrawingStyleControlRange = z.infer<
|
|
240
|
+
typeof PluginDrawingStyleControlRange
|
|
241
|
+
>
|
|
242
|
+
|
|
243
|
+
/** Description of one editable control returned by `drawings.getStyles`. */
|
|
244
|
+
export const PluginDrawingStyleControl = z.object({
|
|
245
|
+
key: z.string(),
|
|
246
|
+
kind: z.string(),
|
|
247
|
+
options: z.array(PluginDrawingStyleControlOption).optional(),
|
|
248
|
+
range: PluginDrawingStyleControlRange.optional(),
|
|
249
|
+
})
|
|
250
|
+
export type PluginDrawingStyleControl = z.infer<
|
|
251
|
+
typeof PluginDrawingStyleControl
|
|
252
|
+
>
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* Read values differ from write patches: legacy renderers use -1 for an unset opacity and
|
|
256
|
+
* include the read-only `disable` flag. These values must not be echoed as an update patch.
|
|
257
|
+
*/
|
|
258
|
+
export const PluginDrawingStyleValues = z.union([
|
|
259
|
+
PluginDrawingVectorStylePatch,
|
|
260
|
+
z
|
|
261
|
+
.object({
|
|
262
|
+
...PluginPlacedViewStylePatch.shape,
|
|
263
|
+
disable: z.boolean().optional(),
|
|
264
|
+
opacity: z.number().finite().min(-1).max(100).optional(),
|
|
265
|
+
mapOpacity: z.number().finite().min(-1).max(100).optional(),
|
|
266
|
+
buildingOpacity: z.number().finite().min(-1).max(100).optional(),
|
|
267
|
+
})
|
|
268
|
+
.strict(),
|
|
269
|
+
])
|
|
270
|
+
export type PluginDrawingStyleValues = z.infer<typeof PluginDrawingStyleValues>
|
|
271
|
+
|
|
272
|
+
/** Read-only effective settings and editable controls for one drawing category. */
|
|
273
|
+
export const PluginDrawingStyleCategory = z.object({
|
|
274
|
+
category: z.string(),
|
|
275
|
+
absent: z.boolean(),
|
|
276
|
+
settings: PluginDrawingStyleValues,
|
|
277
|
+
controls: z.array(PluginDrawingStyleControl),
|
|
278
|
+
})
|
|
279
|
+
export type PluginDrawingStyleCategory = z.infer<
|
|
280
|
+
typeof PluginDrawingStyleCategory
|
|
281
|
+
>
|
|
282
|
+
|
|
283
|
+
/** Effective style categories and their native editing capabilities. */
|
|
284
|
+
export const PluginDrawingStyles = z.object({
|
|
285
|
+
categories: z.array(PluginDrawingStyleCategory),
|
|
286
|
+
})
|
|
287
|
+
export type PluginDrawingStyles = z.infer<typeof PluginDrawingStyles>
|
|
288
|
+
export const PluginDrawingStatus = z.object({
|
|
289
|
+
drawingId: z.string(),
|
|
290
|
+
generation: z.enum(["ready", "updating", "missing"]),
|
|
291
|
+
assetSave: z.enum(["uploading", "retrying", "uploaded", "missing"]),
|
|
292
|
+
layout: z.enum(["pending", "ready", "unsupported"]),
|
|
293
|
+
exportReady: z.boolean(),
|
|
294
|
+
warnings: z.array(z.string()),
|
|
295
|
+
})
|
|
296
|
+
export type PluginDrawingStatus = z.infer<typeof PluginDrawingStatus>
|
|
297
|
+
export const PluginDrawingStatusArgs = PluginDrawingIdArgs.extend({
|
|
298
|
+
waitMs: z.number().finite().int().min(0).max(30000).optional(),
|
|
299
|
+
})
|
|
300
|
+
export type PluginDrawingStatusArgs = z.infer<typeof PluginDrawingStatusArgs>
|
|
301
|
+
export const PluginDrawingExportFormat = z.enum(["pdf", "svg", "png", "jpg"])
|
|
302
|
+
export type PluginDrawingExportFormat = z.infer<
|
|
303
|
+
typeof PluginDrawingExportFormat
|
|
304
|
+
>
|
|
305
|
+
/** Renderer-specific operations and formats supported by a drawing. */
|
|
306
|
+
export const PluginDrawingCapabilities = z.object({
|
|
307
|
+
renderer: z.enum(["vector", "hybrid", "raster", "unknown"]),
|
|
308
|
+
presets: z.boolean(),
|
|
309
|
+
labelLayout: z.boolean(),
|
|
310
|
+
architecturalScale: z.boolean(),
|
|
311
|
+
standardScales: z.array(
|
|
312
|
+
z.object({ label: z.string(), value: z.number().finite().positive() }),
|
|
313
|
+
),
|
|
314
|
+
exportFormats: z.array(PluginDrawingExportFormat),
|
|
315
|
+
})
|
|
316
|
+
export type PluginDrawingCapabilities = z.infer<
|
|
317
|
+
typeof PluginDrawingCapabilities
|
|
318
|
+
>
|
|
319
|
+
export const PluginDrawingExportOptions = z
|
|
320
|
+
.object({
|
|
321
|
+
fileName: z.string().trim().min(1).max(200).optional(),
|
|
322
|
+
resolution: PluginPresentationExportResolution.optional(),
|
|
323
|
+
download: z.boolean().optional(),
|
|
324
|
+
})
|
|
325
|
+
.strict()
|
|
326
|
+
export type PluginDrawingExportOptions = z.infer<
|
|
327
|
+
typeof PluginDrawingExportOptions
|
|
328
|
+
>
|
|
329
|
+
export const PluginDrawingExportArgs = PluginDrawingIdArgs.extend({
|
|
330
|
+
format: PluginDrawingExportFormat,
|
|
331
|
+
...PluginDrawingExportOptions.shape,
|
|
332
|
+
})
|
|
333
|
+
export type PluginDrawingExportArgs = z.infer<typeof PluginDrawingExportArgs>
|
|
334
|
+
export const PluginDrawingExportResult = z.object({
|
|
335
|
+
files: z.array(
|
|
336
|
+
z.object({
|
|
337
|
+
fileName: z.string(),
|
|
338
|
+
mimeType: z.string(),
|
|
339
|
+
byteLength: z.number(),
|
|
340
|
+
dataBase64: z.string().optional(),
|
|
341
|
+
}),
|
|
342
|
+
),
|
|
343
|
+
downloadStarted: z.boolean(),
|
|
344
|
+
warnings: z.array(z.string()),
|
|
345
|
+
})
|
|
346
|
+
export type PluginDrawingExportResult = z.infer<
|
|
347
|
+
typeof PluginDrawingExportResult
|
|
348
|
+
>
|
|
349
|
+
|
|
350
|
+
export const PluginDrawingLabelArgs = z
|
|
351
|
+
.object({ labelId: z.string().min(1) })
|
|
352
|
+
.strict()
|
|
353
|
+
export type PluginDrawingLabelArgs = z.infer<typeof PluginDrawingLabelArgs>
|
|
354
|
+
export const PluginDrawingLabelMoveArgs = PluginDrawingLabelArgs.extend({
|
|
355
|
+
position: PluginSheetPosition,
|
|
356
|
+
})
|
|
357
|
+
export type PluginDrawingLabelMoveArgs = z.infer<
|
|
358
|
+
typeof PluginDrawingLabelMoveArgs
|
|
359
|
+
>
|
|
360
|
+
export const PluginDrawingLabelHiddenArgs = PluginDrawingLabelArgs.extend({
|
|
361
|
+
hidden: z.boolean(),
|
|
362
|
+
})
|
|
363
|
+
export type PluginDrawingLabelHiddenArgs = z.infer<
|
|
364
|
+
typeof PluginDrawingLabelHiddenArgs
|
|
365
|
+
>
|
|
366
|
+
export const PluginDrawingLabelResetArgs = PluginDrawingIdArgs.extend({
|
|
367
|
+
scope: z.enum(["scale", "all"]).optional(),
|
|
368
|
+
})
|
|
369
|
+
export type PluginDrawingLabelResetArgs = z.infer<
|
|
370
|
+
typeof PluginDrawingLabelResetArgs
|
|
371
|
+
>
|
|
372
|
+
|
|
373
|
+
/** Collision-layout diagnostics for drawing labels, including actionable scale suggestions. */
|
|
374
|
+
export const PluginDrawingLabelLayout = z.object({
|
|
375
|
+
pending: z.boolean(),
|
|
376
|
+
pinned: z.number().int().nonnegative(),
|
|
377
|
+
unplaced: z.array(
|
|
378
|
+
z.object({
|
|
379
|
+
labelId: z.string(),
|
|
380
|
+
name: z.string(),
|
|
381
|
+
reason: z.string(),
|
|
382
|
+
suggestedScale: z.number().finite().positive().nullable(),
|
|
383
|
+
}),
|
|
384
|
+
),
|
|
385
|
+
duplicatesMerged: z.number().int().nonnegative(),
|
|
386
|
+
rowsDropped: z.object({
|
|
387
|
+
department: z.number().int().nonnegative(),
|
|
388
|
+
area: z.number().int().nonnegative(),
|
|
389
|
+
wrapped: z.number().int().nonnegative(),
|
|
390
|
+
}),
|
|
391
|
+
})
|
|
392
|
+
export type PluginDrawingLabelLayout = z.infer<typeof PluginDrawingLabelLayout>
|
|
393
|
+
|
|
394
|
+
/** Label ids are text-shape ids returned by list; positions are drawing-local canvas units. */
|
|
395
|
+
export abstract class PluginDrawingLabelsApi {
|
|
396
|
+
/**
|
|
397
|
+
* List every text label on a drawing, including hidden labels.
|
|
398
|
+
* @examplePrompt List all labels in this drawing
|
|
399
|
+
*/
|
|
400
|
+
public abstract list(
|
|
401
|
+
drawingId: string,
|
|
402
|
+
): PluginApiReturn<PluginPlacedViewLabel[]>
|
|
403
|
+
/**
|
|
404
|
+
* Read collision diagnostics, suggested scales and pin counts without hiding failed labels.
|
|
405
|
+
* @examplePrompt Check this drawing for overlapping labels
|
|
406
|
+
*/
|
|
407
|
+
public abstract getLayout(
|
|
408
|
+
drawingId: string,
|
|
409
|
+
): PluginApiReturn<PluginDrawingLabelLayout>
|
|
410
|
+
/** Move a label; room labels retain the chosen position at the current architectural scale. */
|
|
411
|
+
public abstract move(
|
|
412
|
+
labelId: string,
|
|
413
|
+
position: z.infer<typeof PluginSheetPosition>,
|
|
414
|
+
): PluginApiReturn<PluginPlacedViewLabel>
|
|
415
|
+
/** Set user visibility, independently of layout/crop visibility. */
|
|
416
|
+
public abstract setHidden(
|
|
417
|
+
labelId: string,
|
|
418
|
+
hidden: boolean,
|
|
419
|
+
): PluginApiReturn<PluginPlacedViewLabel>
|
|
420
|
+
/** Pin an unclean room label at its best available position. May wait up to ten seconds for fitting. */
|
|
421
|
+
public abstract place(labelId: string): PluginApiReturn<boolean>
|
|
422
|
+
/** Clear pins at this scale (default) or every scale. Returns the number cleared. */
|
|
423
|
+
public abstract reset(
|
|
424
|
+
drawingId: string,
|
|
425
|
+
options?: { scope?: "scale" | "all" },
|
|
426
|
+
): PluginApiReturn<number>
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* First-class drawing deliverables on the Present canvas. Present must be open for every method;
|
|
431
|
+
* no method changes tabs. Native shape history/sync are reused. Creating does not wait for upload:
|
|
432
|
+
* inspect getStatus; "uploaded" describes the asset, not a server acknowledgement of document sync.
|
|
433
|
+
* A drawing needs no sheet. Legacy placedViews/sheets.place continue to address the same shape ids.
|
|
434
|
+
*/
|
|
435
|
+
export abstract class PluginPresentationDrawingsApi {
|
|
436
|
+
public abstract labels: PluginDrawingLabelsApi
|
|
437
|
+
/**
|
|
438
|
+
* Generate a saved source view on the canvas. Options use page coordinates and a standard scale denominator.
|
|
439
|
+
* @examplePrompt Create a drawing from the ground floor view
|
|
440
|
+
*/
|
|
441
|
+
public abstract create(
|
|
442
|
+
viewId: string,
|
|
443
|
+
options?: PluginDrawingCreateOptions,
|
|
444
|
+
): PluginApiReturn<PluginDrawing>
|
|
445
|
+
/**
|
|
446
|
+
* List drawing deliverables on the current Present page.
|
|
447
|
+
* @examplePrompt List all drawings in this presentation
|
|
448
|
+
*/
|
|
449
|
+
public abstract list(): PluginApiReturn<PluginDrawing[]>
|
|
450
|
+
/** Read a drawing by its stable id; null if it no longer exists. */
|
|
451
|
+
public abstract get(drawingId: string): PluginApiReturn<PluginDrawing | null>
|
|
452
|
+
/** Copy a drawing and its annotations with native duplication; returns the new drawing. */
|
|
453
|
+
public abstract copy(drawingId: string): PluginApiReturn<PluginDrawing>
|
|
454
|
+
/** Rename the drawing title without renaming its source saved view. */
|
|
455
|
+
public abstract rename(
|
|
456
|
+
drawingId: string,
|
|
457
|
+
name: string,
|
|
458
|
+
): PluginApiReturn<PluginDrawing>
|
|
459
|
+
/** Delete a drawing and its children as one Present undo step. */
|
|
460
|
+
public abstract delete(drawingId: string): PluginApiReturn<void>
|
|
461
|
+
/** Regenerate specified drawings. Reports actual changed assets, not merely submitted ids. */
|
|
462
|
+
public abstract updateContent(
|
|
463
|
+
drawingIds: string[],
|
|
464
|
+
): PluginApiReturn<{ drawingId: string; updated: boolean }[]>
|
|
465
|
+
/**
|
|
466
|
+
* Read actual renderer and supported operations; presets are kernel-plan-only.
|
|
467
|
+
* @examplePrompt What editing capabilities does this drawing support?
|
|
468
|
+
*/
|
|
469
|
+
public abstract getCapabilities(
|
|
470
|
+
drawingId: string,
|
|
471
|
+
): PluginApiReturn<PluginDrawingCapabilities>
|
|
472
|
+
/** Wait at most waitMs (0 by default) for export readiness and upload; returns current status on timeout. */
|
|
473
|
+
public abstract getStatus(
|
|
474
|
+
drawingId: string,
|
|
475
|
+
options?: { waitMs?: number },
|
|
476
|
+
): PluginApiReturn<PluginDrawingStatus>
|
|
477
|
+
/** Set a standard architectural scale; perspective/isometric drawings reject this. */
|
|
478
|
+
public abstract setScale(
|
|
479
|
+
drawingId: string,
|
|
480
|
+
scale: number,
|
|
481
|
+
): PluginApiReturn<PluginDrawing>
|
|
482
|
+
/** Set normalized crop corners (0–1), or null to remove the crop. */
|
|
483
|
+
public abstract setCrop(
|
|
484
|
+
drawingId: string,
|
|
485
|
+
crop: z.infer<typeof PluginPlacedViewCrop> | null,
|
|
486
|
+
): PluginApiReturn<PluginDrawing>
|
|
487
|
+
/**
|
|
488
|
+
* Read effective categories/controls before editing; absent categories reject writes.
|
|
489
|
+
* @examplePrompt Show the editable styles for this drawing
|
|
490
|
+
*/
|
|
491
|
+
public abstract getStyles(
|
|
492
|
+
drawingId: string,
|
|
493
|
+
): PluginApiReturn<PluginDrawingStyles>
|
|
494
|
+
/** Merge a typed category patch as one undo step. Invalid/unsupported fields reject the whole call. */
|
|
495
|
+
public abstract updateStyles(
|
|
496
|
+
drawingId: string,
|
|
497
|
+
category: string,
|
|
498
|
+
patch: PluginDrawingStylePatch,
|
|
499
|
+
): PluginApiReturn<PluginDrawingStyles>
|
|
500
|
+
/**
|
|
501
|
+
* Bind a kernel plan to a preset and clear declared overrides; local title text is retained.
|
|
502
|
+
* @examplePrompt Apply the presentation plan preset to this drawing
|
|
503
|
+
*/
|
|
504
|
+
public abstract applyPreset(
|
|
505
|
+
drawingId: string,
|
|
506
|
+
presetId: string,
|
|
507
|
+
): PluginApiReturn<PluginDrawing>
|
|
508
|
+
/** Reset declared overrides to the bound preset, preserving local title/proposal/building text. */
|
|
509
|
+
public abstract resetOverrides(
|
|
510
|
+
drawingId: string,
|
|
511
|
+
): PluginApiReturn<PluginDrawing>
|
|
512
|
+
/** List pattern ids accepted by the native hatch catalog. */
|
|
513
|
+
public abstract listPatterns(): PluginApiReturn<
|
|
514
|
+
{ id: string; label: string; group: string }[]
|
|
515
|
+
>
|
|
516
|
+
/** List available font families from the native catalog (including DEFAULT). */
|
|
517
|
+
public abstract listFonts(): PluginApiReturn<string[]>
|
|
518
|
+
/**
|
|
519
|
+
* Export the drawing including labels/annotations, no sheet required. PDF size follows its canvas bounds.
|
|
520
|
+
* download:true starts a browser download and returns metadata only (never send large base64 to an agent).
|
|
521
|
+
* Otherwise files contain dataBase64. downloadStarted means initiated, not proof of an OS-saved file.
|
|
522
|
+
* SVG/PDF preserve vector content; raster fallbacks remain raster. Layout warnings are returned.
|
|
523
|
+
*/
|
|
524
|
+
public abstract export(
|
|
525
|
+
drawingId: string,
|
|
526
|
+
format: PluginDrawingExportFormat,
|
|
527
|
+
options?: PluginDrawingExportOptions,
|
|
528
|
+
): PluginApiReturn<PluginDrawingExportResult>
|
|
529
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import * as z from "zod"
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Presentation export — render the Present-mode layout sheets to a downloadable
|
|
5
|
+
* file (PDF / PNG / JPG), returning base64 by default or starting a browser download.
|
|
6
|
+
*
|
|
7
|
+
* This wraps the same pipeline the Present-mode **Export** dialog drives:
|
|
8
|
+
* each sheet is serialized to an SVG, then either composed into a PDF
|
|
9
|
+
* (svg2pdf/jspdf) or rasterized to a PNG/JPG. By default the plugin receives the
|
|
10
|
+
* encoded bytes to save, upload or preview. With `download: true`, the host
|
|
11
|
+
* initiates browser downloads and returns metadata only, keeping agent results small.
|
|
12
|
+
*
|
|
13
|
+
* Requires **Present mode to be open** (the documentation editor); the call
|
|
14
|
+
* throws `PRECONDITION_FAILED` when it is not.
|
|
15
|
+
*
|
|
16
|
+
* The result is always a uniform `{ files }` array (see
|
|
17
|
+
* {@linkcode PluginPresentationExportResult}):
|
|
18
|
+
* - `pdf` with `combine` (the default) → a single multi-page file.
|
|
19
|
+
* - `pdf` with `combine: false`, or any `png`/`jpg` → one file per sheet.
|
|
20
|
+
*
|
|
21
|
+
* Accessed via `snaptrude.presentation.export`.
|
|
22
|
+
*
|
|
23
|
+
* For a different export intent, see `core.io.export.model` (the 3D model as a
|
|
24
|
+
* GLB/OBJ/FBX/3DS file) and `program.spreadsheet.export` (the area-program /
|
|
25
|
+
* takeoff workbook as XLSX/PDF/CSV).
|
|
26
|
+
*
|
|
27
|
+
* The schemas and result types live here; the callable method is declared on
|
|
28
|
+
* {@linkcode PluginPresentationApi.export}.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
/** Output file format: a vector `pdf`, or a rasterized `png` / `jpg`. */
|
|
32
|
+
export const PluginPresentationExportFormat = z.enum(["pdf", "png", "jpg"])
|
|
33
|
+
export type PluginPresentationExportFormat = z.infer<
|
|
34
|
+
typeof PluginPresentationExportFormat
|
|
35
|
+
>
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Target pixel dimensions for a rasterized (`png`/`jpg`) export. Ignored for
|
|
39
|
+
* `pdf`, which stays vector and takes its size from the sheet.
|
|
40
|
+
*
|
|
41
|
+
* | Property | Type | Description |
|
|
42
|
+
* |---|---|---|
|
|
43
|
+
* | `width` | `number` | Output width in pixels |
|
|
44
|
+
* | `height` | `number` | Output height in pixels |
|
|
45
|
+
*/
|
|
46
|
+
export const PluginPresentationExportResolution = z.object({
|
|
47
|
+
width: z.number().positive(),
|
|
48
|
+
height: z.number().positive(),
|
|
49
|
+
})
|
|
50
|
+
export type PluginPresentationExportResolution = z.infer<
|
|
51
|
+
typeof PluginPresentationExportResolution
|
|
52
|
+
>
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Arguments for {@linkcode PluginPresentationApi.export}.
|
|
56
|
+
*
|
|
57
|
+
* | Property | Type | Description |
|
|
58
|
+
* |---|---|---|
|
|
59
|
+
* | `format` | `"pdf" \| "png" \| "jpg"` | Output format |
|
|
60
|
+
* | `sheetIds` | `string[] \| undefined` | Sheets to export (all sheets when omitted) |
|
|
61
|
+
* | `combine` | `boolean \| undefined` | PDF only: one multi-page file (default `true`) vs one file per sheet |
|
|
62
|
+
* | `resolution` | {@linkcode PluginPresentationExportResolution}` \| undefined` | Raster target size (`png`/`jpg` only) |
|
|
63
|
+
* | `fileName` | `string \| undefined` | Base file name (without extension) |
|
|
64
|
+
* | `download` | `boolean \| undefined` | Start browser downloads and return metadata without base64 (default `false`) |
|
|
65
|
+
*/
|
|
66
|
+
export const PluginPresentationExportArgs = z.object({
|
|
67
|
+
format: PluginPresentationExportFormat,
|
|
68
|
+
sheetIds: z.array(z.string()).optional(),
|
|
69
|
+
combine: z.boolean().optional(),
|
|
70
|
+
resolution: PluginPresentationExportResolution.optional(),
|
|
71
|
+
fileName: z.string().optional(),
|
|
72
|
+
download: z.boolean().optional(),
|
|
73
|
+
})
|
|
74
|
+
export type PluginPresentationExportArgs = z.infer<
|
|
75
|
+
typeof PluginPresentationExportArgs
|
|
76
|
+
>
|
|
77
|
+
|
|
78
|
+
/** Options after the positional export format. Omitted `download` preserves base64 results. */
|
|
79
|
+
export type PluginPresentationExportOptions = Omit<
|
|
80
|
+
PluginPresentationExportArgs,
|
|
81
|
+
"format"
|
|
82
|
+
>
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* A single exported file.
|
|
86
|
+
*
|
|
87
|
+
* | Property | Type | Description |
|
|
88
|
+
* |---|---|---|
|
|
89
|
+
* | `fileName` | `string` | File name including extension |
|
|
90
|
+
* | `mimeType` | `string` | MIME type (`application/pdf`, `image/png`, `image/jpeg`) |
|
|
91
|
+
* | `dataBase64` | `string` | The file bytes, base64-encoded (no data-URL prefix) |
|
|
92
|
+
*/
|
|
93
|
+
export const PluginPresentationExportFile = z.object({
|
|
94
|
+
fileName: z.string(),
|
|
95
|
+
mimeType: z.string(),
|
|
96
|
+
dataBase64: z.string(),
|
|
97
|
+
})
|
|
98
|
+
export type PluginPresentationExportFile = z.infer<
|
|
99
|
+
typeof PluginPresentationExportFile
|
|
100
|
+
>
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Result of {@linkcode PluginPresentationApi.export} — always a `files` array.
|
|
104
|
+
* A combined PDF yields one entry; per-sheet exports yield one entry each, in
|
|
105
|
+
* sheet order.
|
|
106
|
+
*
|
|
107
|
+
* | Property | Type | Description |
|
|
108
|
+
* |---|---|---|
|
|
109
|
+
* | `files` | {@linkcode PluginPresentationExportFile}`[]` | The exported files |
|
|
110
|
+
*/
|
|
111
|
+
export const PluginPresentationExportResult = z.object({
|
|
112
|
+
files: z.array(PluginPresentationExportFile),
|
|
113
|
+
})
|
|
114
|
+
export type PluginPresentationExportResult = z.infer<
|
|
115
|
+
typeof PluginPresentationExportResult
|
|
116
|
+
>
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Metadata-only result for `download: true`. `downloadStarted` confirms initiation,
|
|
120
|
+
* not an OS-saved file: browsers may require multiple-download permission. No base64
|
|
121
|
+
* is returned. Default exports retain their existing result and TypeScript contract.
|
|
122
|
+
*/
|
|
123
|
+
export const PluginPresentationExportDownloadResult = z.object({
|
|
124
|
+
files: z.array(
|
|
125
|
+
PluginPresentationExportFile.omit({ dataBase64: true }).extend({
|
|
126
|
+
byteLength: z.number().int().nonnegative(),
|
|
127
|
+
}),
|
|
128
|
+
),
|
|
129
|
+
downloadStarted: z.boolean(),
|
|
130
|
+
})
|
|
131
|
+
export type PluginPresentationExportDownloadResult = z.infer<
|
|
132
|
+
typeof PluginPresentationExportDownloadResult
|
|
133
|
+
>
|