@snaptrude/plugin-core 0.7.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/api-manifest.full.json +7703 -0
- package/api-manifest.json +2946 -259
- 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 +438 -14
- package/dist/api/analysis/heatmaps.d.ts.map +1 -1
- package/dist/api/analysis/index.d.ts +15 -0
- package/dist/api/analysis/index.d.ts.map +1 -1
- package/dist/api/analysis/solar.d.ts +249 -0
- package/dist/api/analysis/solar.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 +245 -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 +331 -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 +18 -18
- 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 +24 -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 +62 -1
- package/dist/api/core/io/import/index.d.ts.map +1 -1
- package/dist/api/core/io/index.d.ts +5 -0
- package/dist/api/core/io/index.d.ts.map +1 -1
- 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/proposals/index.d.ts +65 -9
- package/dist/api/core/proposals/index.d.ts.map +1 -1
- package/dist/api/core/storeys/index.d.ts +251 -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 +253 -47
- 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 +36 -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/furniture/index.d.ts +114 -3
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +10 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/materials/index.d.ts +111 -14
- 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 +35 -1
- 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 +178 -5
- package/dist/api/design/query/spaces.d.ts.map +1 -1
- package/dist/api/design/transform/index.d.ts +95 -14
- 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 +385 -2
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/visibility.d.ts +98 -0
- package/dist/api/design/visibility.d.ts.map +1 -0
- 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 +19 -19
- package/dist/api/entity/story.d.ts +148 -15
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +5 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/presentation/annotate.d.ts +448 -0
- package/dist/api/presentation/annotate.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +49 -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 +6 -0
- package/dist/api/presentation/import.d.ts.map +1 -1
- package/dist/api/presentation/index.d.ts +47 -0
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +370 -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 +410 -13
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/views.d.ts +165 -10
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/program/areas.d.ts +63 -3
- 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 +2 -2
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/layout.d.ts +172 -12
- package/dist/api/program/layout.d.ts.map +1 -1
- package/dist/api/program/site.d.ts +105 -8
- 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 +460 -0
- package/dist/api/workspace/index.d.ts.map +1 -0
- package/dist/handles.d.ts +64 -25
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +3210 -1671
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3008 -1666
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/scripts/generate-manifest.mjs +45 -0
- package/src/api/analysis/daylight.ts +470 -0
- package/src/api/analysis/heatmaps.ts +444 -17
- package/src/api/analysis/index.ts +15 -0
- package/src/api/analysis/solar.ts +237 -0
- package/src/api/analysis/weather.ts +179 -0
- package/src/api/core/camera/index.ts +251 -0
- package/src/api/core/comment/index.ts +120 -2
- package/src/api/core/geom/create/index.ts +344 -1
- package/src/api/core/geom/delete/index.ts +6 -0
- package/src/api/core/handles/index.ts +233 -0
- package/src/api/core/index.ts +24 -0
- package/src/api/core/io/export/index.ts +126 -0
- package/src/api/core/io/import/index.ts +64 -0
- package/src/api/core/io/index.ts +5 -0
- package/src/api/core/mode/index.ts +96 -0
- package/src/api/core/proposals/index.ts +71 -11
- package/src/api/core/storeys/index.ts +279 -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 +303 -36
- package/src/api/design/delete/index.ts +3 -0
- package/src/api/design/doors/index.ts +40 -0
- package/src/api/design/furniture/index.ts +127 -3
- package/src/api/design/index.ts +10 -0
- package/src/api/design/materials/index.ts +157 -30
- package/src/api/design/query/geometry/index.ts +125 -3
- package/src/api/design/query/index.ts +37 -7
- package/src/api/design/query/referenceLines.ts +52 -0
- package/src/api/design/query/spaces.ts +143 -0
- package/src/api/design/transform/index.ts +101 -12
- package/src/api/design/types/index.ts +156 -0
- package/src/api/design/update/index.ts +467 -6
- package/src/api/design/visibility.ts +109 -0
- package/src/api/entity/buildableEnvelope.ts +4 -0
- package/src/api/entity/referenceLine.ts +8 -0
- package/src/api/entity/story.ts +161 -15
- package/src/api/index.ts +5 -0
- package/src/api/presentation/annotate.ts +360 -0
- package/src/api/presentation/diagrams.ts +53 -8
- package/src/api/presentation/export.ts +108 -0
- package/src/api/presentation/import.ts +6 -0
- package/src/api/presentation/index.ts +55 -0
- package/src/api/presentation/placedViews.ts +363 -0
- package/src/api/presentation/shapes.ts +274 -0
- package/src/api/presentation/sheets.ts +346 -13
- package/src/api/presentation/views.ts +164 -12
- package/src/api/program/areas.ts +57 -6
- package/src/api/program/cores.ts +3 -91
- package/src/api/program/index.ts +2 -2
- package/src/api/program/layout.ts +182 -12
- package/src/api/program/site.ts +106 -8
- package/src/api/program/spreadsheet.ts +376 -35
- package/src/api/workspace/index.ts +516 -0
- package/src/handles.ts +77 -13
- package/tsconfig.json +7 -2
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* `snaptrude.workspace.*` — the dashboard surface: projects and teams outside the
|
|
5
|
+
* open canvas.
|
|
6
|
+
*
|
|
7
|
+
* This namespace reads and creates the containers a design lives in — the
|
|
8
|
+
* project itself and the team it belongs to — mirroring the Snaptrude dashboard.
|
|
9
|
+
* Teams are **read-only** here (no create/invite/delete in v1, a deliberate
|
|
10
|
+
* safety decision); there are no folders in v1. A `projectId` is the project's
|
|
11
|
+
* floorkey. Plan limits are enforced by the backend — a limit rejection surfaces
|
|
12
|
+
* as a normal host error.
|
|
13
|
+
*
|
|
14
|
+
* - {@linkcode PluginWorkspaceApi.projects} — Create, copy, list, read & rename projects
|
|
15
|
+
* - {@linkcode PluginWorkspaceApi.teams} — Read teams and their members
|
|
16
|
+
*/
|
|
17
|
+
export declare abstract class PluginWorkspaceApi {
|
|
18
|
+
/** Projects — create, copy, list, read & rename. See {@linkcode PluginWorkspaceProjectsApi}. */
|
|
19
|
+
abstract projects: PluginWorkspaceProjectsApi;
|
|
20
|
+
/** Teams — read teams and their members. See {@linkcode PluginWorkspaceTeamsApi}. */
|
|
21
|
+
abstract teams: PluginWorkspaceTeamsApi;
|
|
22
|
+
constructor();
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* `workspace.projects.*` — create, copy, list, read & rename projects.
|
|
26
|
+
*
|
|
27
|
+
* A **project** is a single Snaptrude model, identified by its `projectId`
|
|
28
|
+
* (floorkey). Reads never throw for a miss ({@linkcode PluginWorkspaceProjectsApi.get}
|
|
29
|
+
* returns `null`). Create/copy/rename go through the backend, which enforces plan
|
|
30
|
+
* limits — a rejection surfaces as a normal host error.
|
|
31
|
+
*
|
|
32
|
+
* Accessed via `snaptrude.workspace.projects`.
|
|
33
|
+
*/
|
|
34
|
+
export declare abstract class PluginWorkspaceProjectsApi {
|
|
35
|
+
constructor();
|
|
36
|
+
/**
|
|
37
|
+
* Create a new, empty BIM project.
|
|
38
|
+
*
|
|
39
|
+
* Creates the project on the backend and returns its `projectId` (floorkey).
|
|
40
|
+
* Pass `options.teamId` to create it inside a team (otherwise it lands in the
|
|
41
|
+
* user's personal workspace) and `options.unit` to set the default length unit.
|
|
42
|
+
*
|
|
43
|
+
* @param name - Display name of the new project.
|
|
44
|
+
* @param options - Optional `unit` (default length unit) and `teamId` (owning team).
|
|
45
|
+
* @returns The new project's `projectId`.
|
|
46
|
+
* @throws If the backend rejects the create (e.g. a plan project limit).
|
|
47
|
+
*
|
|
48
|
+
* @examplePrompt Create a new project called Tower Study
|
|
49
|
+
* @examplePrompt Start a new project in the Acme team
|
|
50
|
+
* @examplePrompt Make a fresh project using millimeters
|
|
51
|
+
* @examplePrompt Create an empty project for me to work in
|
|
52
|
+
*
|
|
53
|
+
* # Example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const { projectId } = await snaptrude.workspace.projects.create("Tower Study", {
|
|
56
|
+
* teamId: "team_1",
|
|
57
|
+
* unit: "mm",
|
|
58
|
+
* })
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
abstract create(name: string, options?: {
|
|
62
|
+
unit?: string;
|
|
63
|
+
teamId?: string;
|
|
64
|
+
}): PluginApiReturn<PluginWorkspaceProjectsCreateResult>;
|
|
65
|
+
/**
|
|
66
|
+
* Copy the **current** project into a new project — the dashboard's "Save As".
|
|
67
|
+
*
|
|
68
|
+
* Duplicates the project that is currently open into a new project with the
|
|
69
|
+
* given name, and returns the new `projectId`. Pass `options.teamId` to place
|
|
70
|
+
* the copy in a specific team.
|
|
71
|
+
*
|
|
72
|
+
* @param name - Display name for the copy.
|
|
73
|
+
* @param options - Optional `teamId` (team to place the copy in).
|
|
74
|
+
* @returns The new project's `projectId`.
|
|
75
|
+
* @throws If the backend rejects the copy (e.g. a plan project limit).
|
|
76
|
+
*
|
|
77
|
+
* @examplePrompt Save this project as a new copy called Tower Study v2
|
|
78
|
+
* @examplePrompt Duplicate the current project into the Acme team
|
|
79
|
+
* @examplePrompt Make a copy of this project so I can try changes
|
|
80
|
+
*
|
|
81
|
+
* # Example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const { projectId } = await snaptrude.workspace.projects.copy("Tower Study v2")
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
abstract copy(name: string, options?: {
|
|
87
|
+
teamId?: string;
|
|
88
|
+
}): PluginApiReturn<PluginWorkspaceProjectsCopyResult>;
|
|
89
|
+
/**
|
|
90
|
+
* List the projects the user can access.
|
|
91
|
+
*
|
|
92
|
+
* Returns a {@linkcode PluginProjectRef} per project. Pass `options.teamId` to
|
|
93
|
+
* scope the list to a single team; omit it for the user's accessible projects.
|
|
94
|
+
*
|
|
95
|
+
* @param options - Optional `teamId` filter.
|
|
96
|
+
* @returns A {@linkcode PluginWorkspaceProjectsListResult} with a `projects`
|
|
97
|
+
* array (empty when there are none).
|
|
98
|
+
*
|
|
99
|
+
* @examplePrompt List all my projects
|
|
100
|
+
* @examplePrompt Show the projects in the Acme team
|
|
101
|
+
* @examplePrompt How many projects do I have?
|
|
102
|
+
* @examplePrompt What projects can I open?
|
|
103
|
+
*
|
|
104
|
+
* # Example
|
|
105
|
+
* ```ts
|
|
106
|
+
* const { projects } = await snaptrude.workspace.projects.list({ teamId: "team_1" })
|
|
107
|
+
* for (const p of projects) console.log(p.id, p.name)
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
110
|
+
abstract list(options?: {
|
|
111
|
+
teamId?: string;
|
|
112
|
+
}): PluginApiReturn<PluginWorkspaceProjectsListResult>;
|
|
113
|
+
/**
|
|
114
|
+
* Get a single project by id.
|
|
115
|
+
*
|
|
116
|
+
* @param projectId - The project's `projectId` (floorkey).
|
|
117
|
+
* @returns The matching {@linkcode PluginProjectRef}, or `null` if no project
|
|
118
|
+
* has that id / the user cannot access it.
|
|
119
|
+
*
|
|
120
|
+
* @examplePrompt Get the project with this id
|
|
121
|
+
* @examplePrompt Look up a project by its floorkey
|
|
122
|
+
* @examplePrompt What is the name of this project?
|
|
123
|
+
*
|
|
124
|
+
* # Example
|
|
125
|
+
* ```ts
|
|
126
|
+
* const project = await snaptrude.workspace.projects.get("floorkey_123")
|
|
127
|
+
* if (project) console.log(project.name)
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
abstract get(projectId: string): PluginApiReturn<PluginWorkspaceProjectsGetResult>;
|
|
131
|
+
/**
|
|
132
|
+
* Rename a project.
|
|
133
|
+
*
|
|
134
|
+
* @param projectId - The project's `projectId` (floorkey).
|
|
135
|
+
* @param name - The project's new display name.
|
|
136
|
+
* @returns The renamed project's `projectId`.
|
|
137
|
+
* @throws If no project has the given id or the rename is rejected.
|
|
138
|
+
*
|
|
139
|
+
* @examplePrompt Rename this project to Tower Study Final
|
|
140
|
+
* @examplePrompt Change the name of project floorkey_123
|
|
141
|
+
* @examplePrompt Give this project a new name
|
|
142
|
+
*
|
|
143
|
+
* # Example
|
|
144
|
+
* ```ts
|
|
145
|
+
* const { projectId } = await snaptrude.workspace.projects.rename(
|
|
146
|
+
* "floorkey_123",
|
|
147
|
+
* "Tower Study Final",
|
|
148
|
+
* )
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
abstract rename(projectId: string, name: string): PluginApiReturn<PluginWorkspaceProjectsRenameResult>;
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* `workspace.teams.*` — read teams and their members.
|
|
155
|
+
*
|
|
156
|
+
* A **team** is a shared workspace that owns projects and members. **Read-only**
|
|
157
|
+
* in v1: there is no create/invite/delete (a deliberate safety decision). Reads
|
|
158
|
+
* never throw for a miss ({@linkcode PluginWorkspaceTeamsApi.get} returns `null`).
|
|
159
|
+
*
|
|
160
|
+
* Accessed via `snaptrude.workspace.teams`.
|
|
161
|
+
*/
|
|
162
|
+
export declare abstract class PluginWorkspaceTeamsApi {
|
|
163
|
+
constructor();
|
|
164
|
+
/**
|
|
165
|
+
* List the teams the user belongs to.
|
|
166
|
+
*
|
|
167
|
+
* @returns A {@linkcode PluginWorkspaceTeamsListResult} with a `teams` array
|
|
168
|
+
* (empty when the user belongs to none).
|
|
169
|
+
*
|
|
170
|
+
* @examplePrompt List all my teams
|
|
171
|
+
* @examplePrompt Which teams am I a member of?
|
|
172
|
+
* @examplePrompt Show every team I can access
|
|
173
|
+
*
|
|
174
|
+
* # Example
|
|
175
|
+
* ```ts
|
|
176
|
+
* const { teams } = await snaptrude.workspace.teams.list()
|
|
177
|
+
* for (const t of teams) console.log(t.id, t.name)
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
180
|
+
abstract list(): PluginApiReturn<PluginWorkspaceTeamsListResult>;
|
|
181
|
+
/**
|
|
182
|
+
* Get a single team by id.
|
|
183
|
+
*
|
|
184
|
+
* @param teamId - The id of the team to read.
|
|
185
|
+
* @returns The matching {@linkcode PluginTeamRef}, or `null` if no team has that
|
|
186
|
+
* id / the user is not a member.
|
|
187
|
+
*
|
|
188
|
+
* @examplePrompt Get the team with id team_1
|
|
189
|
+
* @examplePrompt Look up a team by its id
|
|
190
|
+
* @examplePrompt What is the name of this team?
|
|
191
|
+
*
|
|
192
|
+
* # Example
|
|
193
|
+
* ```ts
|
|
194
|
+
* const team = await snaptrude.workspace.teams.get("team_1")
|
|
195
|
+
* if (team) console.log(team.name)
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
abstract get(teamId: string): PluginApiReturn<PluginWorkspaceTeamsGetResult>;
|
|
199
|
+
/**
|
|
200
|
+
* List the members of a team.
|
|
201
|
+
*
|
|
202
|
+
* @param teamId - The id of the team whose members to list.
|
|
203
|
+
* @returns A {@linkcode PluginWorkspaceTeamsListMembersResult} with a `members`
|
|
204
|
+
* array (empty when the team has none / is missing).
|
|
205
|
+
*
|
|
206
|
+
* @examplePrompt List the members of the Acme team
|
|
207
|
+
* @examplePrompt Who is on team_1?
|
|
208
|
+
* @examplePrompt How many people are in this team?
|
|
209
|
+
*
|
|
210
|
+
* # Example
|
|
211
|
+
* ```ts
|
|
212
|
+
* const { members } = await snaptrude.workspace.teams.listMembers("team_1")
|
|
213
|
+
* for (const m of members) console.log(m.name, m.email)
|
|
214
|
+
* ```
|
|
215
|
+
*/
|
|
216
|
+
abstract listMembers(teamId: string): PluginApiReturn<PluginWorkspaceTeamsListMembersResult>;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* A project reference — a conservative projection of a project, never the raw
|
|
220
|
+
* backend payload.
|
|
221
|
+
*
|
|
222
|
+
* | Property | Type | Description |
|
|
223
|
+
* |---|---|---|
|
|
224
|
+
* | `id` | `string` | The project's `projectId` (floorkey) |
|
|
225
|
+
* | `name` | `string` | Display name |
|
|
226
|
+
* | `teamId` | `string?` | Owning team id (absent for personal projects) |
|
|
227
|
+
* | `createdAt` | `string?` | Creation timestamp (ISO 8601) when known |
|
|
228
|
+
* | `modifiedAt` | `string?` | Last-modified timestamp (ISO 8601) when known |
|
|
229
|
+
*/
|
|
230
|
+
export declare const PluginProjectRef: z.ZodObject<{
|
|
231
|
+
id: z.ZodString;
|
|
232
|
+
name: z.ZodString;
|
|
233
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
234
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
235
|
+
modifiedAt: z.ZodOptional<z.ZodString>;
|
|
236
|
+
}, z.core.$strip>;
|
|
237
|
+
export type PluginProjectRef = z.infer<typeof PluginProjectRef>;
|
|
238
|
+
/**
|
|
239
|
+
* A team reference — a conservative projection of a team, never the raw backend
|
|
240
|
+
* payload.
|
|
241
|
+
*
|
|
242
|
+
* | Property | Type | Description |
|
|
243
|
+
* |---|---|---|
|
|
244
|
+
* | `id` | `string` | Stable team id |
|
|
245
|
+
* | `name` | `string` | Display name |
|
|
246
|
+
* | `role` | `string?` | The user's role in the team when known |
|
|
247
|
+
*/
|
|
248
|
+
export declare const PluginTeamRef: z.ZodObject<{
|
|
249
|
+
id: z.ZodString;
|
|
250
|
+
name: z.ZodString;
|
|
251
|
+
role: z.ZodOptional<z.ZodString>;
|
|
252
|
+
}, z.core.$strip>;
|
|
253
|
+
export type PluginTeamRef = z.infer<typeof PluginTeamRef>;
|
|
254
|
+
/**
|
|
255
|
+
* A team member reference — a conservative projection of a member, never the raw
|
|
256
|
+
* backend payload.
|
|
257
|
+
*
|
|
258
|
+
* | Property | Type | Description |
|
|
259
|
+
* |---|---|---|
|
|
260
|
+
* | `id` | `string` | Stable user id |
|
|
261
|
+
* | `name` | `string` | Display name |
|
|
262
|
+
* | `email` | `string?` | Email address when known |
|
|
263
|
+
* | `role` | `string?` | The member's role in the team when known |
|
|
264
|
+
*/
|
|
265
|
+
export declare const PluginTeamMemberRef: z.ZodObject<{
|
|
266
|
+
id: z.ZodString;
|
|
267
|
+
name: z.ZodString;
|
|
268
|
+
email: z.ZodOptional<z.ZodString>;
|
|
269
|
+
role: z.ZodOptional<z.ZodString>;
|
|
270
|
+
}, z.core.$strip>;
|
|
271
|
+
export type PluginTeamMemberRef = z.infer<typeof PluginTeamMemberRef>;
|
|
272
|
+
/**
|
|
273
|
+
* Arguments for {@linkcode PluginWorkspaceProjectsApi.create} (options flattened).
|
|
274
|
+
*
|
|
275
|
+
* | Property | Type | Description |
|
|
276
|
+
* |---|---|---|
|
|
277
|
+
* | `name` | `string` | Display name of the new project |
|
|
278
|
+
* | `unit` | `string?` | Default length unit |
|
|
279
|
+
* | `teamId` | `string?` | Owning team id (personal workspace if omitted) |
|
|
280
|
+
*/
|
|
281
|
+
export declare const PluginWorkspaceProjectsCreateArgs: z.ZodObject<{
|
|
282
|
+
name: z.ZodString;
|
|
283
|
+
unit: z.ZodOptional<z.ZodString>;
|
|
284
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
285
|
+
}, z.core.$strip>;
|
|
286
|
+
export type PluginWorkspaceProjectsCreateArgs = z.infer<typeof PluginWorkspaceProjectsCreateArgs>;
|
|
287
|
+
/**
|
|
288
|
+
* Result of {@linkcode PluginWorkspaceProjectsApi.create}.
|
|
289
|
+
*
|
|
290
|
+
* | Property | Type | Description |
|
|
291
|
+
* |---|---|---|
|
|
292
|
+
* | `projectId` | `string` | The id (floorkey) of the created project |
|
|
293
|
+
*/
|
|
294
|
+
export declare const PluginWorkspaceProjectsCreateResult: z.ZodObject<{
|
|
295
|
+
projectId: z.ZodString;
|
|
296
|
+
}, z.core.$strip>;
|
|
297
|
+
export type PluginWorkspaceProjectsCreateResult = z.infer<typeof PluginWorkspaceProjectsCreateResult>;
|
|
298
|
+
/**
|
|
299
|
+
* Arguments for {@linkcode PluginWorkspaceProjectsApi.copy} (options flattened).
|
|
300
|
+
*
|
|
301
|
+
* | Property | Type | Description |
|
|
302
|
+
* |---|---|---|
|
|
303
|
+
* | `name` | `string` | Display name for the copy |
|
|
304
|
+
* | `teamId` | `string?` | Team to place the copy in |
|
|
305
|
+
*/
|
|
306
|
+
export declare const PluginWorkspaceProjectsCopyArgs: z.ZodObject<{
|
|
307
|
+
name: z.ZodString;
|
|
308
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
309
|
+
}, z.core.$strip>;
|
|
310
|
+
export type PluginWorkspaceProjectsCopyArgs = z.infer<typeof PluginWorkspaceProjectsCopyArgs>;
|
|
311
|
+
/**
|
|
312
|
+
* Result of {@linkcode PluginWorkspaceProjectsApi.copy}.
|
|
313
|
+
*
|
|
314
|
+
* | Property | Type | Description |
|
|
315
|
+
* |---|---|---|
|
|
316
|
+
* | `projectId` | `string` | The id (floorkey) of the copied project |
|
|
317
|
+
*/
|
|
318
|
+
export declare const PluginWorkspaceProjectsCopyResult: z.ZodObject<{
|
|
319
|
+
projectId: z.ZodString;
|
|
320
|
+
}, z.core.$strip>;
|
|
321
|
+
export type PluginWorkspaceProjectsCopyResult = z.infer<typeof PluginWorkspaceProjectsCopyResult>;
|
|
322
|
+
/**
|
|
323
|
+
* Arguments for {@linkcode PluginWorkspaceProjectsApi.list} (options flattened).
|
|
324
|
+
*
|
|
325
|
+
* | Property | Type | Description |
|
|
326
|
+
* |---|---|---|
|
|
327
|
+
* | `teamId` | `string?` | Scope the list to this team; omit for all accessible projects |
|
|
328
|
+
*/
|
|
329
|
+
export declare const PluginWorkspaceProjectsListArgs: z.ZodObject<{
|
|
330
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
331
|
+
}, z.core.$strip>;
|
|
332
|
+
export type PluginWorkspaceProjectsListArgs = z.infer<typeof PluginWorkspaceProjectsListArgs>;
|
|
333
|
+
/**
|
|
334
|
+
* Result of {@linkcode PluginWorkspaceProjectsApi.list}.
|
|
335
|
+
*
|
|
336
|
+
* | Property | Type | Description |
|
|
337
|
+
* |---|---|---|
|
|
338
|
+
* | `projects` | {@linkcode PluginProjectRef}`[]` | Accessible projects (empty when none) |
|
|
339
|
+
*/
|
|
340
|
+
export declare const PluginWorkspaceProjectsListResult: z.ZodObject<{
|
|
341
|
+
projects: z.ZodArray<z.ZodObject<{
|
|
342
|
+
id: z.ZodString;
|
|
343
|
+
name: z.ZodString;
|
|
344
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
345
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
346
|
+
modifiedAt: z.ZodOptional<z.ZodString>;
|
|
347
|
+
}, z.core.$strip>>;
|
|
348
|
+
}, z.core.$strip>;
|
|
349
|
+
export type PluginWorkspaceProjectsListResult = z.infer<typeof PluginWorkspaceProjectsListResult>;
|
|
350
|
+
/**
|
|
351
|
+
* Arguments for {@linkcode PluginWorkspaceProjectsApi.get}.
|
|
352
|
+
*
|
|
353
|
+
* | Property | Type | Description |
|
|
354
|
+
* |---|---|---|
|
|
355
|
+
* | `projectId` | `string` | The project's `projectId` (floorkey) |
|
|
356
|
+
*/
|
|
357
|
+
export declare const PluginWorkspaceProjectsGetArgs: z.ZodObject<{
|
|
358
|
+
projectId: z.ZodString;
|
|
359
|
+
}, z.core.$strip>;
|
|
360
|
+
export type PluginWorkspaceProjectsGetArgs = z.infer<typeof PluginWorkspaceProjectsGetArgs>;
|
|
361
|
+
/**
|
|
362
|
+
* Result of {@linkcode PluginWorkspaceProjectsApi.get} — the project, or `null`
|
|
363
|
+
* when no project has the given id.
|
|
364
|
+
*/
|
|
365
|
+
export declare const PluginWorkspaceProjectsGetResult: z.ZodNullable<z.ZodObject<{
|
|
366
|
+
id: z.ZodString;
|
|
367
|
+
name: z.ZodString;
|
|
368
|
+
teamId: z.ZodOptional<z.ZodString>;
|
|
369
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
370
|
+
modifiedAt: z.ZodOptional<z.ZodString>;
|
|
371
|
+
}, z.core.$strip>>;
|
|
372
|
+
export type PluginWorkspaceProjectsGetResult = z.infer<typeof PluginWorkspaceProjectsGetResult>;
|
|
373
|
+
/**
|
|
374
|
+
* Arguments for {@linkcode PluginWorkspaceProjectsApi.rename}.
|
|
375
|
+
*
|
|
376
|
+
* | Property | Type | Description |
|
|
377
|
+
* |---|---|---|
|
|
378
|
+
* | `projectId` | `string` | The project's `projectId` (floorkey) |
|
|
379
|
+
* | `name` | `string` | The project's new display name |
|
|
380
|
+
*/
|
|
381
|
+
export declare const PluginWorkspaceProjectsRenameArgs: z.ZodObject<{
|
|
382
|
+
projectId: z.ZodString;
|
|
383
|
+
name: z.ZodString;
|
|
384
|
+
}, z.core.$strip>;
|
|
385
|
+
export type PluginWorkspaceProjectsRenameArgs = z.infer<typeof PluginWorkspaceProjectsRenameArgs>;
|
|
386
|
+
/**
|
|
387
|
+
* Result of {@linkcode PluginWorkspaceProjectsApi.rename}.
|
|
388
|
+
*
|
|
389
|
+
* | Property | Type | Description |
|
|
390
|
+
* |---|---|---|
|
|
391
|
+
* | `projectId` | `string` | The id (floorkey) of the renamed project |
|
|
392
|
+
*/
|
|
393
|
+
export declare const PluginWorkspaceProjectsRenameResult: z.ZodObject<{
|
|
394
|
+
projectId: z.ZodString;
|
|
395
|
+
}, z.core.$strip>;
|
|
396
|
+
export type PluginWorkspaceProjectsRenameResult = z.infer<typeof PluginWorkspaceProjectsRenameResult>;
|
|
397
|
+
/**
|
|
398
|
+
* Result of {@linkcode PluginWorkspaceTeamsApi.list}.
|
|
399
|
+
*
|
|
400
|
+
* | Property | Type | Description |
|
|
401
|
+
* |---|---|---|
|
|
402
|
+
* | `teams` | {@linkcode PluginTeamRef}`[]` | The user's teams (empty when none) |
|
|
403
|
+
*/
|
|
404
|
+
export declare const PluginWorkspaceTeamsListResult: z.ZodObject<{
|
|
405
|
+
teams: z.ZodArray<z.ZodObject<{
|
|
406
|
+
id: z.ZodString;
|
|
407
|
+
name: z.ZodString;
|
|
408
|
+
role: z.ZodOptional<z.ZodString>;
|
|
409
|
+
}, z.core.$strip>>;
|
|
410
|
+
}, z.core.$strip>;
|
|
411
|
+
export type PluginWorkspaceTeamsListResult = z.infer<typeof PluginWorkspaceTeamsListResult>;
|
|
412
|
+
/**
|
|
413
|
+
* Arguments for {@linkcode PluginWorkspaceTeamsApi.get}.
|
|
414
|
+
*
|
|
415
|
+
* | Property | Type | Description |
|
|
416
|
+
* |---|---|---|
|
|
417
|
+
* | `teamId` | `string` | The id of the team to read |
|
|
418
|
+
*/
|
|
419
|
+
export declare const PluginWorkspaceTeamsGetArgs: z.ZodObject<{
|
|
420
|
+
teamId: z.ZodString;
|
|
421
|
+
}, z.core.$strip>;
|
|
422
|
+
export type PluginWorkspaceTeamsGetArgs = z.infer<typeof PluginWorkspaceTeamsGetArgs>;
|
|
423
|
+
/**
|
|
424
|
+
* Result of {@linkcode PluginWorkspaceTeamsApi.get} — the team, or `null` when no
|
|
425
|
+
* team has the given id.
|
|
426
|
+
*/
|
|
427
|
+
export declare const PluginWorkspaceTeamsGetResult: z.ZodNullable<z.ZodObject<{
|
|
428
|
+
id: z.ZodString;
|
|
429
|
+
name: z.ZodString;
|
|
430
|
+
role: z.ZodOptional<z.ZodString>;
|
|
431
|
+
}, z.core.$strip>>;
|
|
432
|
+
export type PluginWorkspaceTeamsGetResult = z.infer<typeof PluginWorkspaceTeamsGetResult>;
|
|
433
|
+
/**
|
|
434
|
+
* Arguments for {@linkcode PluginWorkspaceTeamsApi.listMembers}.
|
|
435
|
+
*
|
|
436
|
+
* | Property | Type | Description |
|
|
437
|
+
* |---|---|---|
|
|
438
|
+
* | `teamId` | `string` | The id of the team whose members to list |
|
|
439
|
+
*/
|
|
440
|
+
export declare const PluginWorkspaceTeamsListMembersArgs: z.ZodObject<{
|
|
441
|
+
teamId: z.ZodString;
|
|
442
|
+
}, z.core.$strip>;
|
|
443
|
+
export type PluginWorkspaceTeamsListMembersArgs = z.infer<typeof PluginWorkspaceTeamsListMembersArgs>;
|
|
444
|
+
/**
|
|
445
|
+
* Result of {@linkcode PluginWorkspaceTeamsApi.listMembers}.
|
|
446
|
+
*
|
|
447
|
+
* | Property | Type | Description |
|
|
448
|
+
* |---|---|---|
|
|
449
|
+
* | `members` | {@linkcode PluginTeamMemberRef}`[]` | The team's members (empty when none) |
|
|
450
|
+
*/
|
|
451
|
+
export declare const PluginWorkspaceTeamsListMembersResult: z.ZodObject<{
|
|
452
|
+
members: z.ZodArray<z.ZodObject<{
|
|
453
|
+
id: z.ZodString;
|
|
454
|
+
name: z.ZodString;
|
|
455
|
+
email: z.ZodOptional<z.ZodString>;
|
|
456
|
+
role: z.ZodOptional<z.ZodString>;
|
|
457
|
+
}, z.core.$strip>>;
|
|
458
|
+
}, z.core.$strip>;
|
|
459
|
+
export type PluginWorkspaceTeamsListMembersResult = z.infer<typeof PluginWorkspaceTeamsListMembersResult>;
|
|
460
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/workspace/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;GAaG;AACH,8BAAsB,kBAAkB;IACtC,gGAAgG;IAChG,SAAgB,QAAQ,EAAE,0BAA0B,CAAA;IACpD,qFAAqF;IACrF,SAAgB,KAAK,EAAE,uBAAuB,CAAA;;CAG/C;AAED;;;;;;;;;GASG;AACH,8BAAsB,0BAA0B;;IAG9C;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,MAAM,CACpB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3C,eAAe,CAAC,mCAAmC,CAAC;IAEvD;;;;;;;;;;;;;;;;;;;;OAoBG;aACa,IAAI,CACl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AAM,MAAM,iCAAiC,GAAG,CAAC,CAAC,KAAK,CACrD,OAAO,iCAAiC,CACzC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC;;iBAE9C,CAAA;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAMD;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;;;;;;iBAEzC,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,8BAA8B,CACtC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B;;iBAEtC,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,2BAA2B,CACnC,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,6BAA6B;;;;kBAA2B,CAAA;AACrE,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CACjD,OAAO,6BAA6B,CACrC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,mCAAmC;;iBAE9C,CAAA;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC;;;;;;;iBAEhD,CAAA;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,qCAAqC,CAC7C,CAAA"}
|
package/dist/handles.d.ts
CHANGED
|
@@ -1,22 +1,57 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
import type { ArenaKind } from "./api/core/handles";
|
|
2
3
|
/**
|
|
3
4
|
* An opaque, kind-tagged reference to a host-side object that crosses the RPC
|
|
4
5
|
* boundary by IDENTITY rather than by value. See `PLUGIN_API_EXPOSURE_HLD.md` §9.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
* `Handle<"
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* A handle is a small CLASS instance wrapping the wire id. The phantom
|
|
8
|
+
* `__handle` brand makes a `Handle<"profile">` incompatible with a
|
|
9
|
+
* `Handle<"vec3">` at compile time. On the wire the id string is all that
|
|
10
|
+
* travels: the client SDK unwraps `Handle` arguments to `.id` before the RPC
|
|
11
|
+
* call, and the host tags returned handles as `{ __h: "<id>" }` (via
|
|
12
|
+
* {@linkcode Handle.toJSON}) for the client to re-wrap.
|
|
13
|
+
*
|
|
14
|
+
* Plugin-side lifecycle: the client SDK interns one live instance per id and
|
|
15
|
+
* registers it with a FinalizationRegistry — dropping every reference to a
|
|
16
|
+
* handle eventually releases its host registry entry. Deterministic release is
|
|
17
|
+
* still preferred: `core.handles.release/releaseAll` or scopes.
|
|
18
|
+
*
|
|
19
|
+
* Crossing non-RPC boundaries (popup UI postMessage, persistence, logging):
|
|
20
|
+
* send {@linkcode Handle.id} — structured clone strips the class prototype.
|
|
10
21
|
*/
|
|
11
|
-
export
|
|
22
|
+
export declare class Handle<K extends string> {
|
|
23
|
+
readonly id: string;
|
|
24
|
+
/** Phantom brand — keeps `Handle<"vec3">` ≠ `Handle<"mass">` at compile time. */
|
|
12
25
|
readonly __handle: K;
|
|
13
|
-
|
|
26
|
+
constructor(id: string);
|
|
27
|
+
/** Wire tag — the host's result serialization (JSON round-trip) calls this. */
|
|
28
|
+
toJSON(): {
|
|
29
|
+
__h: string;
|
|
30
|
+
};
|
|
31
|
+
/** Template-string / logging form stays the bare id. */
|
|
32
|
+
toString(): string;
|
|
33
|
+
/** Identity comparison by id — safe across re-wraps. */
|
|
34
|
+
equals(other: Handle<string>): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Explicit-resource-management hook (`await using`). A no-op here; the
|
|
37
|
+
* plugin-client runtime installs the real enqueue-release behavior on the
|
|
38
|
+
* interned instance.
|
|
39
|
+
*/
|
|
40
|
+
[Symbol.asyncDispose](): Promise<void>;
|
|
41
|
+
}
|
|
42
|
+
/** Union of all releasable (arena-backed) handle kinds. */
|
|
43
|
+
export type AnyArenaHandle = Handle<ArenaKind>;
|
|
14
44
|
/**
|
|
15
45
|
* A scene-entity handle. Backed by the host `Component.id` and resolved live via
|
|
16
46
|
* the host scene index (StructureCollection) — never stored in the resource
|
|
17
47
|
* registry. Stable across undo/redo and persistable across sessions (§9.2).
|
|
48
|
+
* Entity handles remain raw branded STRINGS (not {@linkcode Handle} instances):
|
|
49
|
+
* they have no arena entry, no lifecycle, and are equality-matched against
|
|
50
|
+
* plain ids embedded in result records.
|
|
18
51
|
*/
|
|
19
|
-
export type EntityId<K extends string = string> =
|
|
52
|
+
export type EntityId<K extends string = string> = string & {
|
|
53
|
+
readonly __handle: K;
|
|
54
|
+
};
|
|
20
55
|
/** Resource handle: a host-resident, session-ephemeral geometry object (§9.2). */
|
|
21
56
|
export type ProfileHandle = Handle<"profile">;
|
|
22
57
|
/** Resource handle: a host-resident contour (outer profile + hole profiles). */
|
|
@@ -108,14 +143,18 @@ export type BBoxComponents = {
|
|
|
108
143
|
};
|
|
109
144
|
/**
|
|
110
145
|
* Build a Zod schema validating a handle of the given `kind` at the trust
|
|
111
|
-
* boundary
|
|
112
|
-
*
|
|
113
|
-
* the
|
|
146
|
+
* boundary and emitting a {@linkcode Handle} instance for impl code. Inbound
|
|
147
|
+
* forms accepted:
|
|
148
|
+
* - the bare id string (the wire form — the client unwraps args to ids)
|
|
149
|
+
* - a live `Handle` instance (host-internal re-parse, direct host callers)
|
|
150
|
+
* - `{ __h: string }` (the tagged result form, echoed back as an arg)
|
|
151
|
+
* - `{ id: string }` (a Handle stripped by structured clone at the popup-UI boundary)
|
|
152
|
+
* Shape checking stays prefix-only; existence, kind, and ownership are enforced
|
|
153
|
+
* host-side by the HandleRegistry (§9.7) — no existence oracle.
|
|
114
154
|
*/
|
|
115
|
-
export declare const handleSchema: <K extends string>(kind: K) => z.ZodPipe<z.
|
|
116
|
-
export declare const ProfileHandle: z.ZodPipe<z.
|
|
117
|
-
export declare const ContourHandle: z.ZodPipe<z.
|
|
118
|
-
export declare const MassHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Handle<"mass">, string>>;
|
|
155
|
+
export declare const handleSchema: <K extends string>(kind: K) => z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<K>, string>>;
|
|
156
|
+
export declare const ProfileHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"profile">, string>>;
|
|
157
|
+
export declare const ContourHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"contour">, string>>;
|
|
119
158
|
/**
|
|
120
159
|
* Entity handles are raw `Component.id` strings (no `"<kind>_"` prefix) — validated
|
|
121
160
|
* only as a non-empty string, resolved live via the scene index host-side.
|
|
@@ -134,17 +173,17 @@ export declare const MaterialHandle: z.ZodPipe<z.ZodString, z.ZodTransform<Mater
|
|
|
134
173
|
export declare const UnderlayHandle: z.ZodPipe<z.ZodString, z.ZodTransform<UnderlayHandle, string>>;
|
|
135
174
|
export declare const TerrainHandle: z.ZodPipe<z.ZodString, z.ZodTransform<TerrainHandle, string>>;
|
|
136
175
|
export declare const ImportJobHandle: z.ZodPipe<z.ZodString, z.ZodTransform<ImportJobHandle, string>>;
|
|
137
|
-
export declare const Vec3Handle: z.ZodPipe<z.
|
|
138
|
-
export declare const QuatHandle: z.ZodPipe<z.
|
|
139
|
-
export declare const LineHandle: z.ZodPipe<z.
|
|
140
|
-
export declare const ArcHandle: z.ZodPipe<z.
|
|
141
|
-
export declare const CurveHandle: z.ZodUnion<readonly [z.ZodPipe<z.
|
|
142
|
-
export declare const CircleHandle: z.ZodPipe<z.
|
|
143
|
-
export declare const BrepHandle: z.ZodPipe<z.
|
|
144
|
-
export declare const FaceHandle: z.ZodPipe<z.
|
|
145
|
-
export declare const EdgeHandle: z.ZodPipe<z.
|
|
146
|
-
export declare const HalfEdgeHandle: z.ZodPipe<z.
|
|
147
|
-
export declare const VertexHandle: z.ZodPipe<z.
|
|
176
|
+
export declare const Vec3Handle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"vec3">, string>>;
|
|
177
|
+
export declare const QuatHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"quat">, string>>;
|
|
178
|
+
export declare const LineHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"line">, string>>;
|
|
179
|
+
export declare const ArcHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"arc">, string>>;
|
|
180
|
+
export declare const CurveHandle: z.ZodUnion<readonly [z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"line">, string>>, z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"arc">, string>>]>;
|
|
181
|
+
export declare const CircleHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"circle">, string>>;
|
|
182
|
+
export declare const BrepHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"brep">, string>>;
|
|
183
|
+
export declare const FaceHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"face">, string>>;
|
|
184
|
+
export declare const EdgeHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"edge">, string>>;
|
|
185
|
+
export declare const HalfEdgeHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"halfedge">, string>>;
|
|
186
|
+
export declare const VertexHandle: z.ZodPipe<z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodString>, z.ZodTransform<Handle<"vertex">, string>>;
|
|
148
187
|
export declare const Vec3Components: z.ZodObject<{
|
|
149
188
|
x: z.ZodNumber;
|
|
150
189
|
y: z.ZodNumber;
|
package/dist/handles.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"handles.d.ts","sourceRoot":"","sources":["../src/handles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAKlD;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,MAAM,CAAC,CAAC,SAAS,MAAM;IAItB,QAAQ,CAAC,EAAE,EAAE,MAAM;IAH/B,iFAAiF;IACjF,SAAiB,QAAQ,EAAE,CAAC,CAAA;gBAEP,EAAE,EAAE,MAAM;IAE/B,+EAA+E;IAC/E,MAAM,IAAI;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE;IAIzB,wDAAwD;IACxD,QAAQ,IAAI,MAAM;IAIlB,wDAAwD;IACxD,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,OAAO;IAItC;;;;OAIG;IACG,CAAC,MAAM,CAAC,YAAY,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC;CAC7C;AAED,2DAA2D;AAC3D,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,SAAS,CAAC,CAAA;AAE9C;;;;;;;GAOG;AACH,MAAM,MAAM,QAAQ,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,MAAM,GAAG;IAAE,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAA;CAAE,C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