@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,481 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../types";
|
|
3
|
+
/**
|
|
4
|
+
* Presentation shapes — a stable, plugin-owned shape lifecycle on Present-mode
|
|
5
|
+
* sheets.
|
|
6
|
+
*
|
|
7
|
+
* Where {@linkcode PluginPresentationAnnotateApi} is fire-and-forget (every call
|
|
8
|
+
* creates a new shape), this namespace keys each shape by a caller-chosen
|
|
9
|
+
* string, so rerunning an analysis **updates** its sheet output in place instead
|
|
10
|
+
* of duplicating it:
|
|
11
|
+
*
|
|
12
|
+
* - {@linkcode PluginPresentationShapesApi.upsert} — create or update the shape for a key
|
|
13
|
+
* - {@linkcode PluginPresentationShapesApi.remove} — delete the shape for a key
|
|
14
|
+
* - {@linkcode PluginPresentationShapesApi.removeAll} — delete every shape owned by the calling plugin
|
|
15
|
+
* - {@linkcode PluginPresentationShapesApi.list} — the calling plugin's shapes (key, shapeId, type)
|
|
16
|
+
*
|
|
17
|
+
* Shape ids are derived deterministically from the plugin id + key, so upserts
|
|
18
|
+
* converge across collaborators. Mutations require **Present mode to be open**
|
|
19
|
+
* (`list` is a never-throw read); each plugin sees and mutates only its own
|
|
20
|
+
* shapes.
|
|
21
|
+
*
|
|
22
|
+
* Accessed via `snaptrude.presentation.shapes`.
|
|
23
|
+
*/
|
|
24
|
+
export declare abstract class PluginPresentationShapesApi {
|
|
25
|
+
constructor();
|
|
26
|
+
/**
|
|
27
|
+
* Create or update the shape for a key.
|
|
28
|
+
*
|
|
29
|
+
* The `shape` spec is a discriminated union over the same four annotation
|
|
30
|
+
* kinds as `presentation.annotate` (`text`, `note`, `arrow`, `geo`), with the
|
|
31
|
+
* same option shapes. On first call for a key the shape is created on the
|
|
32
|
+
* target sheet (`options.sheetId`, default: the first sheet) and nested under
|
|
33
|
+
* the sheet frame; on later calls the existing shape is updated in place —
|
|
34
|
+
* same shape id, same sheet, one undo step. Positions/bounds are relative to
|
|
35
|
+
* the sheet's top-left, in canvas units. Requires Present mode to be open.
|
|
36
|
+
*
|
|
37
|
+
* @param key - Caller-chosen stable identifier for the shape (per plugin).
|
|
38
|
+
* @param shape - The desired shape ({@linkcode PluginPresentationShapeSpec}):
|
|
39
|
+
* `{ type: "text" | "note" | "arrow" | "geo", ... }` with the matching
|
|
40
|
+
* annotate options. Changing `type` for an existing key replaces the shape
|
|
41
|
+
* (same shape id).
|
|
42
|
+
* @param options - Optional `sheetId` — the sheet to create the shape on
|
|
43
|
+
* (defaults to the first sheet; ignored on update, the shape stays on its
|
|
44
|
+
* sheet).
|
|
45
|
+
* @returns A {@linkcode PluginPresentationShapesUpsertResult} — the stable
|
|
46
|
+
* `shapeId` and `created` (`true` on first upsert, `false` on update).
|
|
47
|
+
* @throws If Present mode is not open, the args are invalid, or the sheet id
|
|
48
|
+
* is unknown.
|
|
49
|
+
*
|
|
50
|
+
* @examplePrompt Update the analysis label on the sheet instead of adding another one
|
|
51
|
+
* @examplePrompt Rerun the daylight report and refresh its annotations
|
|
52
|
+
* @examplePrompt Keep one "FAR: 2.4" text on Sheet 1 that updates on each run
|
|
53
|
+
* @examplePrompt Draw a highlight rectangle the plugin can move on the next run
|
|
54
|
+
*
|
|
55
|
+
* # Example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const { shapeId, created } = await snaptrude.presentation.shapes.upsert("far-label", {
|
|
58
|
+
* type: "text",
|
|
59
|
+
* text: "FAR: 2.4",
|
|
60
|
+
* position: { x: 40, y: 40 },
|
|
61
|
+
* color: "blue",
|
|
62
|
+
* })
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
abstract upsert(key: string, shape: PluginPresentationShapeSpec, options?: {
|
|
66
|
+
sheetId?: string;
|
|
67
|
+
}): PluginApiReturn<PluginPresentationShapesUpsertResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Delete the shape for a key.
|
|
70
|
+
*
|
|
71
|
+
* Removes the calling plugin's shape registered under `key`, if it exists.
|
|
72
|
+
* Requires Present mode to be open.
|
|
73
|
+
*
|
|
74
|
+
* @param key - The key passed to {@linkcode PluginPresentationShapesApi.upsert}.
|
|
75
|
+
* @returns `true` if a shape was deleted, `false` if no shape exists for the
|
|
76
|
+
* key.
|
|
77
|
+
* @throws If Present mode is not open or the key is invalid.
|
|
78
|
+
*
|
|
79
|
+
* @examplePrompt Remove the FAR label from the sheet
|
|
80
|
+
* @examplePrompt Delete the highlight the plugin added earlier
|
|
81
|
+
* @examplePrompt Clear the "far-label" annotation
|
|
82
|
+
*
|
|
83
|
+
* # Example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const removed = await snaptrude.presentation.shapes.remove("far-label")
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
abstract remove(key: string): PluginApiReturn<boolean>;
|
|
89
|
+
/**
|
|
90
|
+
* Delete every shape owned by the calling plugin.
|
|
91
|
+
*
|
|
92
|
+
* Removes all shapes the calling plugin has upserted (across all sheets) in
|
|
93
|
+
* one undo step. Requires Present mode to be open.
|
|
94
|
+
*
|
|
95
|
+
* @returns The number of shapes deleted.
|
|
96
|
+
* @throws If Present mode is not open.
|
|
97
|
+
*
|
|
98
|
+
* @examplePrompt Clear all annotations my plugin added
|
|
99
|
+
* @examplePrompt Reset the sheet output before rerunning the analysis
|
|
100
|
+
* @examplePrompt Remove every plugin-drawn shape
|
|
101
|
+
*
|
|
102
|
+
* # Example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const deleted = await snaptrude.presentation.shapes.removeAll()
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
abstract removeAll(): PluginApiReturn<number>;
|
|
108
|
+
/**
|
|
109
|
+
* List the calling plugin's shapes.
|
|
110
|
+
*
|
|
111
|
+
* Returns one entry per live shape the calling plugin has upserted — its
|
|
112
|
+
* `key`, the underlying canvas `shapeId`, and the shape `type`. A never-throw
|
|
113
|
+
* read: returns an empty list when Present mode is closed.
|
|
114
|
+
*
|
|
115
|
+
* @returns A {@linkcode PluginPresentationShapesListResult} with the `shapes`
|
|
116
|
+
* array (empty when Present mode is closed).
|
|
117
|
+
*
|
|
118
|
+
* @examplePrompt Which annotations has my plugin placed on the sheets?
|
|
119
|
+
* @examplePrompt List the plugin's shapes before refreshing them
|
|
120
|
+
* @examplePrompt Check whether the FAR label already exists
|
|
121
|
+
*
|
|
122
|
+
* # Example
|
|
123
|
+
* ```ts
|
|
124
|
+
* const { shapes } = await snaptrude.presentation.shapes.list()
|
|
125
|
+
* const hasLabel = shapes.some((s) => s.key === "far-label")
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
abstract list(): PluginApiReturn<PluginPresentationShapesListResult>;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Desired shape for {@linkcode PluginPresentationShapesApi.upsert} — a
|
|
132
|
+
* discriminated union over the four annotate kinds, with the same option shapes
|
|
133
|
+
* as the matching `presentation.annotate` call:
|
|
134
|
+
*
|
|
135
|
+
* | `type` | Payload | Mirrors |
|
|
136
|
+
* |---|---|---|
|
|
137
|
+
* | `"text"` | `text`, `position?`, `size?`, `color?` | `annotate.text` |
|
|
138
|
+
* | `"note"` | `text`, `position?`, `color?`, `size?` | `annotate.note` |
|
|
139
|
+
* | `"arrow"` | `start`, `end`, `color?`, `size?` | `annotate.arrow` |
|
|
140
|
+
* | `"geo"` | `kind`, `bounds`, `color?`, `fill?` | `annotate.shape` |
|
|
141
|
+
*
|
|
142
|
+
* Positions/bounds are relative to the sheet's top-left, in canvas units.
|
|
143
|
+
*/
|
|
144
|
+
export declare const PluginPresentationShapeSpec: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
145
|
+
type: z.ZodLiteral<"text">;
|
|
146
|
+
text: z.ZodString;
|
|
147
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
148
|
+
x: z.ZodNumber;
|
|
149
|
+
y: z.ZodNumber;
|
|
150
|
+
}, z.core.$strip>>;
|
|
151
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
152
|
+
m: "m";
|
|
153
|
+
s: "s";
|
|
154
|
+
l: "l";
|
|
155
|
+
xl: "xl";
|
|
156
|
+
}>>;
|
|
157
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
158
|
+
black: "black";
|
|
159
|
+
grey: "grey";
|
|
160
|
+
"light-violet": "light-violet";
|
|
161
|
+
violet: "violet";
|
|
162
|
+
blue: "blue";
|
|
163
|
+
"light-blue": "light-blue";
|
|
164
|
+
yellow: "yellow";
|
|
165
|
+
orange: "orange";
|
|
166
|
+
green: "green";
|
|
167
|
+
"light-green": "light-green";
|
|
168
|
+
"light-red": "light-red";
|
|
169
|
+
red: "red";
|
|
170
|
+
white: "white";
|
|
171
|
+
}>>;
|
|
172
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
173
|
+
type: z.ZodLiteral<"note">;
|
|
174
|
+
text: z.ZodString;
|
|
175
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
176
|
+
x: z.ZodNumber;
|
|
177
|
+
y: z.ZodNumber;
|
|
178
|
+
}, z.core.$strip>>;
|
|
179
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
180
|
+
black: "black";
|
|
181
|
+
grey: "grey";
|
|
182
|
+
"light-violet": "light-violet";
|
|
183
|
+
violet: "violet";
|
|
184
|
+
blue: "blue";
|
|
185
|
+
"light-blue": "light-blue";
|
|
186
|
+
yellow: "yellow";
|
|
187
|
+
orange: "orange";
|
|
188
|
+
green: "green";
|
|
189
|
+
"light-green": "light-green";
|
|
190
|
+
"light-red": "light-red";
|
|
191
|
+
red: "red";
|
|
192
|
+
white: "white";
|
|
193
|
+
}>>;
|
|
194
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
195
|
+
m: "m";
|
|
196
|
+
s: "s";
|
|
197
|
+
l: "l";
|
|
198
|
+
xl: "xl";
|
|
199
|
+
}>>;
|
|
200
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
201
|
+
type: z.ZodLiteral<"arrow">;
|
|
202
|
+
start: z.ZodObject<{
|
|
203
|
+
x: z.ZodNumber;
|
|
204
|
+
y: z.ZodNumber;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
end: z.ZodObject<{
|
|
207
|
+
x: z.ZodNumber;
|
|
208
|
+
y: z.ZodNumber;
|
|
209
|
+
}, z.core.$strip>;
|
|
210
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
211
|
+
black: "black";
|
|
212
|
+
grey: "grey";
|
|
213
|
+
"light-violet": "light-violet";
|
|
214
|
+
violet: "violet";
|
|
215
|
+
blue: "blue";
|
|
216
|
+
"light-blue": "light-blue";
|
|
217
|
+
yellow: "yellow";
|
|
218
|
+
orange: "orange";
|
|
219
|
+
green: "green";
|
|
220
|
+
"light-green": "light-green";
|
|
221
|
+
"light-red": "light-red";
|
|
222
|
+
red: "red";
|
|
223
|
+
white: "white";
|
|
224
|
+
}>>;
|
|
225
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
226
|
+
m: "m";
|
|
227
|
+
s: "s";
|
|
228
|
+
l: "l";
|
|
229
|
+
xl: "xl";
|
|
230
|
+
}>>;
|
|
231
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
232
|
+
type: z.ZodLiteral<"geo">;
|
|
233
|
+
kind: z.ZodEnum<{
|
|
234
|
+
rectangle: "rectangle";
|
|
235
|
+
ellipse: "ellipse";
|
|
236
|
+
triangle: "triangle";
|
|
237
|
+
diamond: "diamond";
|
|
238
|
+
hexagon: "hexagon";
|
|
239
|
+
oval: "oval";
|
|
240
|
+
rhombus: "rhombus";
|
|
241
|
+
star: "star";
|
|
242
|
+
cloud: "cloud";
|
|
243
|
+
heart: "heart";
|
|
244
|
+
"x-box": "x-box";
|
|
245
|
+
"check-box": "check-box";
|
|
246
|
+
"arrow-left": "arrow-left";
|
|
247
|
+
"arrow-up": "arrow-up";
|
|
248
|
+
"arrow-right": "arrow-right";
|
|
249
|
+
"arrow-down": "arrow-down";
|
|
250
|
+
}>;
|
|
251
|
+
bounds: z.ZodObject<{
|
|
252
|
+
x: z.ZodNumber;
|
|
253
|
+
y: z.ZodNumber;
|
|
254
|
+
w: z.ZodNumber;
|
|
255
|
+
h: z.ZodNumber;
|
|
256
|
+
}, z.core.$strip>;
|
|
257
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
258
|
+
black: "black";
|
|
259
|
+
grey: "grey";
|
|
260
|
+
"light-violet": "light-violet";
|
|
261
|
+
violet: "violet";
|
|
262
|
+
blue: "blue";
|
|
263
|
+
"light-blue": "light-blue";
|
|
264
|
+
yellow: "yellow";
|
|
265
|
+
orange: "orange";
|
|
266
|
+
green: "green";
|
|
267
|
+
"light-green": "light-green";
|
|
268
|
+
"light-red": "light-red";
|
|
269
|
+
red: "red";
|
|
270
|
+
white: "white";
|
|
271
|
+
}>>;
|
|
272
|
+
fill: z.ZodOptional<z.ZodEnum<{
|
|
273
|
+
pattern: "pattern";
|
|
274
|
+
none: "none";
|
|
275
|
+
semi: "semi";
|
|
276
|
+
solid: "solid";
|
|
277
|
+
}>>;
|
|
278
|
+
}, z.core.$strip>], "type">;
|
|
279
|
+
export type PluginPresentationShapeSpec = z.infer<typeof PluginPresentationShapeSpec>;
|
|
280
|
+
/** The shape kind of a plugin-owned shape (the `type` discriminant of {@linkcode PluginPresentationShapeSpec}). */
|
|
281
|
+
export declare const PluginPresentationShapeType: z.ZodEnum<{
|
|
282
|
+
text: "text";
|
|
283
|
+
note: "note";
|
|
284
|
+
arrow: "arrow";
|
|
285
|
+
geo: "geo";
|
|
286
|
+
}>;
|
|
287
|
+
export type PluginPresentationShapeType = z.infer<typeof PluginPresentationShapeType>;
|
|
288
|
+
/**
|
|
289
|
+
* Arguments for {@linkcode PluginPresentationShapesApi.upsert}.
|
|
290
|
+
*
|
|
291
|
+
* | Property | Type | Description |
|
|
292
|
+
* |---|---|---|
|
|
293
|
+
* | `key` | `string` | Caller-chosen stable identifier (non-empty) |
|
|
294
|
+
* | `shape` | {@linkcode PluginPresentationShapeSpec} | The desired shape |
|
|
295
|
+
* | `sheetId` | `string \| undefined` | Sheet to create on (default: first sheet; ignored on update) |
|
|
296
|
+
*/
|
|
297
|
+
export declare const PluginPresentationShapesUpsertArgs: z.ZodObject<{
|
|
298
|
+
key: z.ZodString;
|
|
299
|
+
shape: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
300
|
+
type: z.ZodLiteral<"text">;
|
|
301
|
+
text: z.ZodString;
|
|
302
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
303
|
+
x: z.ZodNumber;
|
|
304
|
+
y: z.ZodNumber;
|
|
305
|
+
}, z.core.$strip>>;
|
|
306
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
307
|
+
m: "m";
|
|
308
|
+
s: "s";
|
|
309
|
+
l: "l";
|
|
310
|
+
xl: "xl";
|
|
311
|
+
}>>;
|
|
312
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
313
|
+
black: "black";
|
|
314
|
+
grey: "grey";
|
|
315
|
+
"light-violet": "light-violet";
|
|
316
|
+
violet: "violet";
|
|
317
|
+
blue: "blue";
|
|
318
|
+
"light-blue": "light-blue";
|
|
319
|
+
yellow: "yellow";
|
|
320
|
+
orange: "orange";
|
|
321
|
+
green: "green";
|
|
322
|
+
"light-green": "light-green";
|
|
323
|
+
"light-red": "light-red";
|
|
324
|
+
red: "red";
|
|
325
|
+
white: "white";
|
|
326
|
+
}>>;
|
|
327
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
328
|
+
type: z.ZodLiteral<"note">;
|
|
329
|
+
text: z.ZodString;
|
|
330
|
+
position: z.ZodOptional<z.ZodObject<{
|
|
331
|
+
x: z.ZodNumber;
|
|
332
|
+
y: z.ZodNumber;
|
|
333
|
+
}, z.core.$strip>>;
|
|
334
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
335
|
+
black: "black";
|
|
336
|
+
grey: "grey";
|
|
337
|
+
"light-violet": "light-violet";
|
|
338
|
+
violet: "violet";
|
|
339
|
+
blue: "blue";
|
|
340
|
+
"light-blue": "light-blue";
|
|
341
|
+
yellow: "yellow";
|
|
342
|
+
orange: "orange";
|
|
343
|
+
green: "green";
|
|
344
|
+
"light-green": "light-green";
|
|
345
|
+
"light-red": "light-red";
|
|
346
|
+
red: "red";
|
|
347
|
+
white: "white";
|
|
348
|
+
}>>;
|
|
349
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
350
|
+
m: "m";
|
|
351
|
+
s: "s";
|
|
352
|
+
l: "l";
|
|
353
|
+
xl: "xl";
|
|
354
|
+
}>>;
|
|
355
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
356
|
+
type: z.ZodLiteral<"arrow">;
|
|
357
|
+
start: z.ZodObject<{
|
|
358
|
+
x: z.ZodNumber;
|
|
359
|
+
y: z.ZodNumber;
|
|
360
|
+
}, z.core.$strip>;
|
|
361
|
+
end: z.ZodObject<{
|
|
362
|
+
x: z.ZodNumber;
|
|
363
|
+
y: z.ZodNumber;
|
|
364
|
+
}, z.core.$strip>;
|
|
365
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
366
|
+
black: "black";
|
|
367
|
+
grey: "grey";
|
|
368
|
+
"light-violet": "light-violet";
|
|
369
|
+
violet: "violet";
|
|
370
|
+
blue: "blue";
|
|
371
|
+
"light-blue": "light-blue";
|
|
372
|
+
yellow: "yellow";
|
|
373
|
+
orange: "orange";
|
|
374
|
+
green: "green";
|
|
375
|
+
"light-green": "light-green";
|
|
376
|
+
"light-red": "light-red";
|
|
377
|
+
red: "red";
|
|
378
|
+
white: "white";
|
|
379
|
+
}>>;
|
|
380
|
+
size: z.ZodOptional<z.ZodEnum<{
|
|
381
|
+
m: "m";
|
|
382
|
+
s: "s";
|
|
383
|
+
l: "l";
|
|
384
|
+
xl: "xl";
|
|
385
|
+
}>>;
|
|
386
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
387
|
+
type: z.ZodLiteral<"geo">;
|
|
388
|
+
kind: z.ZodEnum<{
|
|
389
|
+
rectangle: "rectangle";
|
|
390
|
+
ellipse: "ellipse";
|
|
391
|
+
triangle: "triangle";
|
|
392
|
+
diamond: "diamond";
|
|
393
|
+
hexagon: "hexagon";
|
|
394
|
+
oval: "oval";
|
|
395
|
+
rhombus: "rhombus";
|
|
396
|
+
star: "star";
|
|
397
|
+
cloud: "cloud";
|
|
398
|
+
heart: "heart";
|
|
399
|
+
"x-box": "x-box";
|
|
400
|
+
"check-box": "check-box";
|
|
401
|
+
"arrow-left": "arrow-left";
|
|
402
|
+
"arrow-up": "arrow-up";
|
|
403
|
+
"arrow-right": "arrow-right";
|
|
404
|
+
"arrow-down": "arrow-down";
|
|
405
|
+
}>;
|
|
406
|
+
bounds: z.ZodObject<{
|
|
407
|
+
x: z.ZodNumber;
|
|
408
|
+
y: z.ZodNumber;
|
|
409
|
+
w: z.ZodNumber;
|
|
410
|
+
h: z.ZodNumber;
|
|
411
|
+
}, z.core.$strip>;
|
|
412
|
+
color: z.ZodOptional<z.ZodEnum<{
|
|
413
|
+
black: "black";
|
|
414
|
+
grey: "grey";
|
|
415
|
+
"light-violet": "light-violet";
|
|
416
|
+
violet: "violet";
|
|
417
|
+
blue: "blue";
|
|
418
|
+
"light-blue": "light-blue";
|
|
419
|
+
yellow: "yellow";
|
|
420
|
+
orange: "orange";
|
|
421
|
+
green: "green";
|
|
422
|
+
"light-green": "light-green";
|
|
423
|
+
"light-red": "light-red";
|
|
424
|
+
red: "red";
|
|
425
|
+
white: "white";
|
|
426
|
+
}>>;
|
|
427
|
+
fill: z.ZodOptional<z.ZodEnum<{
|
|
428
|
+
pattern: "pattern";
|
|
429
|
+
none: "none";
|
|
430
|
+
semi: "semi";
|
|
431
|
+
solid: "solid";
|
|
432
|
+
}>>;
|
|
433
|
+
}, z.core.$strip>], "type">;
|
|
434
|
+
sheetId: z.ZodOptional<z.ZodString>;
|
|
435
|
+
}, z.core.$strip>;
|
|
436
|
+
export type PluginPresentationShapesUpsertArgs = z.infer<typeof PluginPresentationShapesUpsertArgs>;
|
|
437
|
+
/**
|
|
438
|
+
* Result of {@linkcode PluginPresentationShapesApi.upsert}.
|
|
439
|
+
*
|
|
440
|
+
* | Property | Type | Description |
|
|
441
|
+
* |---|---|---|
|
|
442
|
+
* | `shapeId` | `string` | Stable id of the canvas shape for the key |
|
|
443
|
+
* | `created` | `boolean` | `true` if the shape was created, `false` if updated |
|
|
444
|
+
*/
|
|
445
|
+
export declare const PluginPresentationShapesUpsertResult: z.ZodObject<{
|
|
446
|
+
shapeId: z.ZodString;
|
|
447
|
+
created: z.ZodBoolean;
|
|
448
|
+
}, z.core.$strip>;
|
|
449
|
+
export type PluginPresentationShapesUpsertResult = z.infer<typeof PluginPresentationShapesUpsertResult>;
|
|
450
|
+
/**
|
|
451
|
+
* Arguments for {@linkcode PluginPresentationShapesApi.remove}.
|
|
452
|
+
*
|
|
453
|
+
* | Property | Type | Description |
|
|
454
|
+
* |---|---|---|
|
|
455
|
+
* | `key` | `string` | The key the shape was upserted under (non-empty) |
|
|
456
|
+
*/
|
|
457
|
+
export declare const PluginPresentationShapesRemoveArgs: z.ZodObject<{
|
|
458
|
+
key: z.ZodString;
|
|
459
|
+
}, z.core.$strip>;
|
|
460
|
+
export type PluginPresentationShapesRemoveArgs = z.infer<typeof PluginPresentationShapesRemoveArgs>;
|
|
461
|
+
/**
|
|
462
|
+
* Result of {@linkcode PluginPresentationShapesApi.list}.
|
|
463
|
+
*
|
|
464
|
+
* | Property | Type | Description |
|
|
465
|
+
* |---|---|---|
|
|
466
|
+
* | `shapes` | `{ key: string; shapeId: string; type: `{@linkcode PluginPresentationShapeType}` }[]` | One entry per live plugin-owned shape |
|
|
467
|
+
*/
|
|
468
|
+
export declare const PluginPresentationShapesListResult: z.ZodObject<{
|
|
469
|
+
shapes: z.ZodArray<z.ZodObject<{
|
|
470
|
+
key: z.ZodString;
|
|
471
|
+
shapeId: z.ZodString;
|
|
472
|
+
type: z.ZodEnum<{
|
|
473
|
+
text: "text";
|
|
474
|
+
note: "note";
|
|
475
|
+
arrow: "arrow";
|
|
476
|
+
geo: "geo";
|
|
477
|
+
}>;
|
|
478
|
+
}, z.core.$strip>>;
|
|
479
|
+
}, z.core.$strip>;
|
|
480
|
+
export type PluginPresentationShapesListResult = z.infer<typeof PluginPresentationShapesListResult>;
|
|
481
|
+
//# sourceMappingURL=shapes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shapes.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/shapes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAQ7C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,8BAAsB,2BAA2B;;IAG/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;aACa,MAAM,CACpB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,2BAA2B,EAClC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,GAC7B,eAAe,CAAC,oCAAoC,CAAC;IAExD;;;;;;;;;;;;;;;;;;;OAmBG;aACa,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC;IAE7D;;;;;;;;;;;;;;;;;OAiBG;aACa,SAAS,IAAI,eAAe,CAAC,MAAM,CAAC;IAEpD;;;;;;;;;;;;;;;;;;;OAmBG;aACa,IAAI,IAAI,eAAe,CAAC,kCAAkC,CAAC;CAC5E;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAkCtC,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,2BAA2B,CACnC,CAAA;AAED,mHAAmH;AACnH,eAAO,MAAM,2BAA2B;;;;;EAKtC,CAAA;AACF,MAAM,MAAM,2BAA2B,GAAG,CAAC,CAAC,KAAK,CAC/C,OAAO,2BAA2B,CACnC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAI7C,CAAA;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,kCAAkC,CAC1C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,oCAAoC;;;iBAG/C,CAAA;AACF,MAAM,MAAM,oCAAoC,GAAG,CAAC,CAAC,KAAK,CACxD,OAAO,oCAAoC,CAC5C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC;;iBAE7C,CAAA;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,kCAAkC,CAC1C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;iBAQ7C,CAAA;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,kCAAkC,CAC1C,CAAA"}
|