@snaptrude/plugin-core 0.0.0-dev-20260708130115 → 0.0.0-dev-20260827135706
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +152 -1
- package/api-manifest.json +3620 -276
- 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/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 +105 -2
- package/dist/api/core/comment/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +840 -14
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/delete/index.d.ts +8 -2
- package/dist/api/core/geom/delete/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/arc.d.ts +5 -5
- package/dist/api/core/geom/query/brep.d.ts +130 -18
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/circle.d.ts +18 -18
- package/dist/api/core/geom/query/contour.d.ts +20 -20
- package/dist/api/core/geom/query/curve.d.ts +49 -49
- package/dist/api/core/geom/query/edge.d.ts +5 -5
- package/dist/api/core/geom/query/face.d.ts +16 -16
- package/dist/api/core/geom/query/halfedge.d.ts +8 -8
- package/dist/api/core/geom/query/profile.d.ts +19 -19
- package/dist/api/core/geom/query/vertex.d.ts +8 -8
- package/dist/api/core/geom/update/contour.d.ts +14 -14
- package/dist/api/core/geom/update/curve.d.ts +7 -7
- package/dist/api/core/geom/update/profile.d.ts +16 -16
- 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/index.d.ts +34 -0
- package/dist/api/core/index.d.ts.map +1 -1
- 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 +453 -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 +7 -7
- package/dist/api/core/mode/index.d.ts +99 -0
- package/dist/api/core/mode/index.d.ts.map +1 -0
- package/dist/api/core/project/index.d.ts +68 -1
- package/dist/api/core/project/index.d.ts.map +1 -1
- package/dist/api/core/proposals/index.d.ts +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 +24 -0
- package/dist/api/core/tags.d.ts.map +1 -1
- 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 +4 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -1
- package/dist/api/design/boolean/index.d.ts +4 -4
- package/dist/api/design/create/index.d.ts +568 -45
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/delete/index.d.ts +3 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +195 -0
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/edit/index.d.ts +1 -1
- package/dist/api/design/erase/index.d.ts +2 -2
- package/dist/api/design/family.d.ts +349 -0
- package/dist/api/design/family.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +181 -8
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +98 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/lock.d.ts +26 -0
- package/dist/api/design/lock.d.ts.map +1 -1
- package/dist/api/design/materials/index.d.ts +270 -16
- package/dist/api/design/materials/index.d.ts.map +1 -1
- package/dist/api/design/query/geometry/index.d.ts +112 -0
- package/dist/api/design/query/geometry/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +282 -11
- package/dist/api/design/query/index.d.ts.map +1 -1
- 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 +181 -8
- package/dist/api/design/query/spaces.d.ts.map +1 -1
- package/dist/api/design/selection/index.d.ts +144 -0
- package/dist/api/design/selection/index.d.ts.map +1 -1
- package/dist/api/design/transform/index.d.ts +172 -10
- package/dist/api/design/transform/index.d.ts.map +1 -1
- 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 +553 -2
- package/dist/api/design/update/index.d.ts.map +1 -1
- 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 +113 -2
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/entity/buildableEnvelope.d.ts +4 -0
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +10 -2
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +21 -21
- package/dist/api/entity/story.d.ts +242 -15
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +10 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +25 -25
- package/dist/api/presentation/annotate.d.ts +467 -0
- package/dist/api/presentation/annotate.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +111 -8
- package/dist/api/presentation/diagrams.d.ts.map +1 -1
- package/dist/api/presentation/export.d.ts +108 -0
- package/dist/api/presentation/export.d.ts.map +1 -0
- package/dist/api/presentation/import.d.ts +55 -4
- package/dist/api/presentation/import.d.ts.map +1 -1
- package/dist/api/presentation/index.d.ts +58 -1
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +1139 -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 +452 -13
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- 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/views.d.ts +367 -7
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/program/areas.d.ts +102 -12
- package/dist/api/program/areas.d.ts.map +1 -1
- package/dist/api/program/cores.d.ts +3 -99
- package/dist/api/program/cores.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +7 -15
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/layout.d.ts +346 -11
- package/dist/api/program/layout.d.ts.map +1 -1
- package/dist/api/program/site.d.ts +469 -13
- package/dist/api/program/site.d.ts.map +1 -1
- package/dist/api/program/spreadsheet.d.ts +365 -41
- package/dist/api/program/spreadsheet.d.ts.map +1 -1
- package/dist/api/workspace/index.d.ts +505 -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 +97 -25
- package/dist/handles.d.ts.map +1 -1
- package/dist/host-utils.d.ts +4 -0
- package/dist/host-utils.d.ts.map +1 -1
- package/dist/index.cjs +4582 -1422
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4171 -1411
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/scripts/generate-manifest.mjs +45 -0
- package/scripts/generate-manifest.test.mjs +103 -4
- 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/camera/index.ts +268 -0
- package/src/api/core/comment/index.ts +120 -2
- package/src/api/core/geom/create/index.ts +912 -1
- package/src/api/core/geom/delete/index.ts +6 -0
- package/src/api/core/geom/query/brep.ts +119 -0
- package/src/api/core/handles/index.ts +233 -0
- package/src/api/core/index.ts +34 -0
- package/src/api/core/io/export/index.ts +126 -0
- package/src/api/core/io/import/index.ts +496 -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/mode/index.ts +96 -0
- package/src/api/core/project/index.ts +62 -1
- package/src/api/core/proposals/index.ts +569 -0
- package/src/api/core/storeys/index.ts +294 -0
- package/src/api/core/tags.ts +27 -0
- package/src/api/core/user.ts +46 -0
- package/src/api/core/zoom/index.ts +4 -0
- package/src/api/design/create/index.ts +670 -30
- package/src/api/design/delete/index.ts +3 -0
- package/src/api/design/doors/index.ts +208 -0
- package/src/api/design/erase/index.ts +1 -1
- package/src/api/design/family.ts +388 -0
- package/src/api/design/furniture/index.ts +197 -8
- package/src/api/design/index.ts +102 -0
- package/src/api/design/lock.ts +27 -0
- package/src/api/design/materials/index.ts +334 -27
- package/src/api/design/query/geometry/index.ts +125 -3
- package/src/api/design/query/index.ts +217 -7
- package/src/api/design/query/referenceLines.ts +52 -0
- package/src/api/design/query/spaces.ts +143 -0
- package/src/api/design/selection/index.ts +129 -0
- package/src/api/design/transform/index.ts +170 -9
- package/src/api/design/types/index.ts +156 -0
- package/src/api/design/update/index.ts +631 -3
- package/src/api/design/visibility.ts +143 -0
- package/src/api/design/windows/index.ts +128 -2
- package/src/api/entity/buildableEnvelope.ts +4 -0
- package/src/api/entity/referenceLine.ts +8 -0
- package/src/api/entity/story.ts +259 -15
- package/src/api/index.ts +10 -0
- package/src/api/presentation/annotate.ts +385 -0
- package/src/api/presentation/diagrams.ts +118 -8
- package/src/api/presentation/export.ts +108 -0
- package/src/api/presentation/import.ts +51 -4
- package/src/api/presentation/index.ts +66 -1
- package/src/api/presentation/placedViews.ts +1120 -0
- package/src/api/presentation/shapes.ts +274 -0
- package/src/api/presentation/sheets.ts +400 -13
- package/src/api/presentation/slideshow.ts +134 -0
- package/src/api/presentation/tables.ts +84 -0
- package/src/api/presentation/views.ts +376 -8
- package/src/api/program/areas.ts +88 -15
- package/src/api/program/cores.ts +3 -91
- package/src/api/program/index.ts +7 -15
- package/src/api/program/layout.ts +365 -11
- package/src/api/program/site.ts +435 -13
- package/src/api/program/spreadsheet.ts +376 -35
- package/src/api/workspace/index.ts +563 -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 +123 -13
- package/src/host-utils.ts +4 -0
- package/src/index.ts +1 -0
- package/test/errors.test.mjs +184 -0
- package/tsconfig.json +7 -2
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import * as z from "zod"
|
|
2
|
+
import { PluginApiReturn } from "../../../types"
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The editor's top-bar application modes — the tabs a user switches between
|
|
6
|
+
* while working on a project.
|
|
7
|
+
*/
|
|
8
|
+
export const PluginAppMode = z.enum(["design", "bim", "present", "program"])
|
|
9
|
+
export type PluginAppMode = z.infer<typeof PluginAppMode>
|
|
10
|
+
|
|
11
|
+
export const PluginCoreModeSetArgs = z.object({
|
|
12
|
+
mode: PluginAppMode,
|
|
13
|
+
})
|
|
14
|
+
export type PluginCoreModeSetArgs = z.infer<typeof PluginCoreModeSetArgs>
|
|
15
|
+
|
|
16
|
+
export interface PluginCoreModeListResult {
|
|
17
|
+
modes: PluginAppMode[]
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface PluginCoreModeSetResult {
|
|
21
|
+
mode: PluginAppMode
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Application-mode control — read and switch the editor's top-bar mode
|
|
26
|
+
* (Design, BIM, Present, Program), the same tabs a user clicks in the
|
|
27
|
+
* top menu bar. Accessed via `snaptrude.core.mode`.
|
|
28
|
+
*
|
|
29
|
+
* Not to be confused with the viewport's 2D/3D camera mode
|
|
30
|
+
* (`core.camera.setMode`) or saved presentation views (`presentation.views`).
|
|
31
|
+
*
|
|
32
|
+
* `set` covers `design`, `bim`, and `present` — in-page switches.
|
|
33
|
+
* `program` opens in its own browser tab in the product, which a plugin worker
|
|
34
|
+
* cannot do, so `set("program")` fails with `PRECONDITION_FAILED`; `get()`
|
|
35
|
+
* still reports `"program"` for code running in the Program tab.
|
|
36
|
+
*/
|
|
37
|
+
export abstract class PluginCoreModeApi {
|
|
38
|
+
constructor() {}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* List every application mode the editor has.
|
|
42
|
+
*
|
|
43
|
+
* @returns The full set of mode tokens accepted by {@linkcode get} / {@linkcode set}.
|
|
44
|
+
*
|
|
45
|
+
* @examplePrompt What modes does Snaptrude have?
|
|
46
|
+
* @examplePrompt List the editor modes I can switch to
|
|
47
|
+
*
|
|
48
|
+
* # Example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const { modes } = await snaptrude.core.mode.list()
|
|
51
|
+
* // ["design", "bim", "present", "program"]
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
public abstract list(): PluginApiReturn<PluginCoreModeListResult>
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Get the currently active application mode.
|
|
58
|
+
*
|
|
59
|
+
* @returns The active mode token (e.g. `"design"`).
|
|
60
|
+
*
|
|
61
|
+
* @examplePrompt Which mode am I in right now?
|
|
62
|
+
* @examplePrompt Am I in present mode?
|
|
63
|
+
* @examplePrompt Check whether the editor is in BIM mode
|
|
64
|
+
*
|
|
65
|
+
* # Example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const mode = await snaptrude.core.mode.get()
|
|
68
|
+
* if (mode !== "present") await snaptrude.core.mode.set("present")
|
|
69
|
+
* ```
|
|
70
|
+
*/
|
|
71
|
+
public abstract get(): PluginApiReturn<PluginAppMode>
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Switch the editor to another application mode — the same action as
|
|
75
|
+
* clicking that tab in the top menu bar.
|
|
76
|
+
*
|
|
77
|
+
* Supported: `"design"`, `"bim"`, `"present"`. Switching to
|
|
78
|
+
* `"program"` is rejected with `PRECONDITION_FAILED` (the Program surface
|
|
79
|
+
* opens in its own browser tab in the product; a plugin cannot open one).
|
|
80
|
+
*
|
|
81
|
+
* @param mode - Target mode token from {@linkcode PluginAppMode}
|
|
82
|
+
* @returns The committed `{ mode }` after the switch.
|
|
83
|
+
*
|
|
84
|
+
* @examplePrompt Switch to present mode
|
|
85
|
+
* @examplePrompt Open BIM mode
|
|
86
|
+
* @examplePrompt Go back to design mode
|
|
87
|
+
*
|
|
88
|
+
* # Example
|
|
89
|
+
* ```ts
|
|
90
|
+
* await snaptrude.core.mode.set("present")
|
|
91
|
+
* // ... presentation work ...
|
|
92
|
+
* await snaptrude.core.mode.set("design")
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
public abstract set(mode: PluginAppMode): PluginApiReturn<PluginCoreModeSetResult>
|
|
96
|
+
}
|
|
@@ -1,15 +1,47 @@
|
|
|
1
1
|
import * as z from "zod"
|
|
2
2
|
import { PluginApiReturn } from "../../../types"
|
|
3
|
+
import { PUnitType } from "../units"
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Project-level settings and info.
|
|
6
7
|
*
|
|
7
|
-
* Accessed via `snaptrude.core.project`.
|
|
8
|
+
* Accessed via `snaptrude.core.project`. Exposes
|
|
9
|
+
* {@linkcode PluginProjectApi.getInfo} (project identity) and
|
|
8
10
|
* {@linkcode PluginProjectApi.settings} (snap + grid controls).
|
|
9
11
|
*/
|
|
10
12
|
export abstract class PluginProjectApi {
|
|
11
13
|
constructor() {}
|
|
12
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Read identity and headline facts about the currently open project — id,
|
|
17
|
+
* display name, unit type, storey count, active storey, and site location
|
|
18
|
+
* when the project is geo-located.
|
|
19
|
+
*
|
|
20
|
+
* `activeStorey` and `storeyCount` are both scoped to the ACTIVE BUILDING, so
|
|
21
|
+
* they always describe the same building. In a multi-building project
|
|
22
|
+
* `storeyCount` is therefore NOT the total across every building — use
|
|
23
|
+
* `core.storeys.list()`, which spans all buildings, for that.
|
|
24
|
+
*
|
|
25
|
+
* @returns A {@linkcode PluginProjectInfo}. `name` is `null` only when the
|
|
26
|
+
* project genuinely has no title; `location` is `null` only when the project
|
|
27
|
+
* is not geo-located. Neither is used to signal a failure.
|
|
28
|
+
* @throws PRECONDITION_FAILED when no project is open.
|
|
29
|
+
* @throws OPERATION_FAILED when the project lookup or the site-location read
|
|
30
|
+
* fails. A failed read is never reported as `null`.
|
|
31
|
+
*
|
|
32
|
+
* @examplePrompt What is this project called?
|
|
33
|
+
* @examplePrompt Where is this project located?
|
|
34
|
+
* @examplePrompt Give me a summary of this project
|
|
35
|
+
* @examplePrompt How many storeys does this project have?
|
|
36
|
+
*
|
|
37
|
+
* # Example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const info = await snaptrude.core.project.getInfo()
|
|
40
|
+
* console.log(info.name, info.units, info.storeyCount)
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
public abstract getInfo(): PluginApiReturn<PluginProjectInfo>
|
|
44
|
+
|
|
13
45
|
/** Project settings — snaps and grid. See {@linkcode PluginProjectSettingsApi}. */
|
|
14
46
|
public abstract settings: PluginProjectSettingsApi
|
|
15
47
|
}
|
|
@@ -416,3 +448,32 @@ export const PluginToleranceArgs = z.object({
|
|
|
416
448
|
})
|
|
417
449
|
|
|
418
450
|
export type PluginToleranceArgs = z.infer<typeof PluginToleranceArgs>
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Identity and headline facts about the currently open project.
|
|
454
|
+
*
|
|
455
|
+
* `location` is a read-only projection of {@linkcode PluginProgramSiteApi.getLocation}
|
|
456
|
+
* — `program.site.*` remains the full site surface (context, weather, polygons).
|
|
457
|
+
* It is mirrored here because "what and where is this project" is one question.
|
|
458
|
+
*
|
|
459
|
+
* | Property | Type | Description |
|
|
460
|
+
* |---|---|---|
|
|
461
|
+
* | `projectId` | `string` | The open project's id (floorkey) |
|
|
462
|
+
* | `name` | `string \| null` | Display name; `null` only when the project has no title (a failed lookup throws) |
|
|
463
|
+
* | `units` | {@linkcode PUnitType} | The project's unit type |
|
|
464
|
+
* | `activeStorey` | `number` | The active storey value, in the active building |
|
|
465
|
+
* | `storeyCount` | `number` | How many storeys the ACTIVE BUILDING has (not the project-wide total — `core.storeys.list()` spans all buildings) |
|
|
466
|
+
* | `location` | `{ latitude, longitude } \| null` | Site location; `null` only when not geo-located (a failed read throws) |
|
|
467
|
+
*/
|
|
468
|
+
export const PluginProjectInfo = z.object({
|
|
469
|
+
projectId: z.string(),
|
|
470
|
+
name: z.string().nullable(),
|
|
471
|
+
units: PUnitType,
|
|
472
|
+
activeStorey: z.number(),
|
|
473
|
+
storeyCount: z.number(),
|
|
474
|
+
location: z
|
|
475
|
+
.object({ latitude: z.number(), longitude: z.number() })
|
|
476
|
+
.nullable(),
|
|
477
|
+
})
|
|
478
|
+
|
|
479
|
+
export type PluginProjectInfo = z.infer<typeof PluginProjectInfo>
|