@snaptrude/plugin-core 0.9.17 → 0.9.18-edgesetbacks-20261021.1

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.
Files changed (219) hide show
  1. package/AGENTS.md +231 -231
  2. package/CHANGELOG.md +408 -408
  3. package/CLAUDE.md +11 -11
  4. package/api-manifest.json +1428 -712
  5. package/dist/api/analysis/daylight.d.ts +5 -5
  6. package/dist/api/analysis/solar.d.ts +2 -2
  7. package/dist/api/core/camera/index.d.ts +29 -0
  8. package/dist/api/core/camera/index.d.ts.map +1 -1
  9. package/dist/api/core/geom/create/index.d.ts +7 -1
  10. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  11. package/dist/api/core/geom/update/contour.d.ts +8 -2
  12. package/dist/api/core/geom/update/contour.d.ts.map +1 -1
  13. package/dist/api/core/storeys/index.d.ts +5 -2
  14. package/dist/api/core/storeys/index.d.ts.map +1 -1
  15. package/dist/api/core/zoom/index.d.ts +13 -0
  16. package/dist/api/core/zoom/index.d.ts.map +1 -1
  17. package/dist/api/design/bim.d.ts +299 -0
  18. package/dist/api/design/bim.d.ts.map +1 -0
  19. package/dist/api/design/boolean/index.d.ts +2 -0
  20. package/dist/api/design/boolean/index.d.ts.map +1 -1
  21. package/dist/api/design/catalog.d.ts +320 -0
  22. package/dist/api/design/catalog.d.ts.map +1 -0
  23. package/dist/api/design/create/bulk-items.d.ts +65 -25
  24. package/dist/api/design/create/bulk-items.d.ts.map +1 -1
  25. package/dist/api/design/create/index.d.ts +299 -100
  26. package/dist/api/design/create/index.d.ts.map +1 -1
  27. package/dist/api/design/create/opening-fields.d.ts +13 -12
  28. package/dist/api/design/create/opening-fields.d.ts.map +1 -1
  29. package/dist/api/design/delete/index.d.ts +1 -0
  30. package/dist/api/design/delete/index.d.ts.map +1 -1
  31. package/dist/api/design/doors/index.d.ts +18 -24
  32. package/dist/api/design/doors/index.d.ts.map +1 -1
  33. package/dist/api/design/family.d.ts +813 -35
  34. package/dist/api/design/family.d.ts.map +1 -1
  35. package/dist/api/design/index.d.ts +16 -0
  36. package/dist/api/design/index.d.ts.map +1 -1
  37. package/dist/api/design/networks.d.ts +1703 -0
  38. package/dist/api/design/networks.d.ts.map +1 -0
  39. package/dist/api/design/query/grids.d.ts +2 -2
  40. package/dist/api/design/query/index.d.ts +42 -32
  41. package/dist/api/design/query/index.d.ts.map +1 -1
  42. package/dist/api/design/selection/index.d.ts +10 -10
  43. package/dist/api/design/types/index.d.ts +40 -24
  44. package/dist/api/design/types/index.d.ts.map +1 -1
  45. package/dist/api/design/update/index.d.ts +111 -6
  46. package/dist/api/design/update/index.d.ts.map +1 -1
  47. package/dist/api/design/windows/index.d.ts +8 -8
  48. package/dist/api/design/windows/index.d.ts.map +1 -1
  49. package/dist/api/entity/buildableEnvelope.d.ts +84 -2
  50. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
  51. package/dist/api/presentation/aiInspiration.d.ts +10 -10
  52. package/dist/api/presentation/annotate.d.ts +38 -22
  53. package/dist/api/presentation/annotate.d.ts.map +1 -1
  54. package/dist/api/presentation/drawingContract.d.ts +32 -0
  55. package/dist/api/presentation/drawingContract.d.ts.map +1 -0
  56. package/dist/api/presentation/drawings.d.ts +3523 -0
  57. package/dist/api/presentation/drawings.d.ts.map +1 -0
  58. package/dist/api/presentation/export.d.ts +23 -5
  59. package/dist/api/presentation/export.d.ts.map +1 -1
  60. package/dist/api/presentation/index.d.ts +32 -12
  61. package/dist/api/presentation/index.d.ts.map +1 -1
  62. package/dist/api/presentation/placedViews.d.ts +106 -6
  63. package/dist/api/presentation/placedViews.d.ts.map +1 -1
  64. package/dist/api/presentation/shapes.d.ts +2 -2
  65. package/dist/api/presentation/sheets.d.ts +175 -19
  66. package/dist/api/presentation/sheets.d.ts.map +1 -1
  67. package/dist/api/presentation/viewPresets.d.ts +222 -0
  68. package/dist/api/presentation/viewPresets.d.ts.map +1 -0
  69. package/dist/api/presentation/views.d.ts +141 -8
  70. package/dist/api/presentation/views.d.ts.map +1 -1
  71. package/dist/api/presentation/walkthroughs.d.ts +6 -6
  72. package/dist/errors/codes.d.ts +3 -1
  73. package/dist/errors/codes.d.ts.map +1 -1
  74. package/dist/index.cjs +3831 -2444
  75. package/dist/index.cjs.map +1 -1
  76. package/dist/index.js +3705 -2444
  77. package/dist/index.js.map +1 -1
  78. package/package.json +1 -1
  79. package/scripts/check-dist-fresh.mjs +22 -22
  80. package/scripts/generate-manifest.mjs +243 -238
  81. package/scripts/generate-manifest.test.mjs +303 -303
  82. package/src/api/analysis/daylight.ts +470 -470
  83. package/src/api/analysis/heatmaps.ts +683 -683
  84. package/src/api/analysis/illuminance.ts +155 -155
  85. package/src/api/analysis/index.ts +61 -61
  86. package/src/api/analysis/shadows.ts +183 -183
  87. package/src/api/analysis/solar.ts +237 -237
  88. package/src/api/analysis/sunlightHours.ts +211 -211
  89. package/src/api/analysis/sunpath.ts +83 -83
  90. package/src/api/analysis/weather.ts +179 -179
  91. package/src/api/core/buildings.ts +485 -485
  92. package/src/api/core/camera/index.ts +696 -667
  93. package/src/api/core/comment/index.ts +376 -376
  94. package/src/api/core/geom/create/index.ts +2139 -2133
  95. package/src/api/core/geom/delete/index.ts +84 -84
  96. package/src/api/core/geom/index.ts +35 -35
  97. package/src/api/core/geom/query/arc.ts +169 -169
  98. package/src/api/core/geom/query/brep.ts +621 -621
  99. package/src/api/core/geom/query/circle.ts +404 -404
  100. package/src/api/core/geom/query/contour.ts +540 -540
  101. package/src/api/core/geom/query/curve.ts +1102 -1102
  102. package/src/api/core/geom/query/edge.ts +130 -130
  103. package/src/api/core/geom/query/face.ts +508 -508
  104. package/src/api/core/geom/query/halfedge.ts +210 -210
  105. package/src/api/core/geom/query/index.ts +63 -63
  106. package/src/api/core/geom/query/profile.ts +473 -473
  107. package/src/api/core/geom/query/vertex.ts +205 -205
  108. package/src/api/core/geom/update/contour.ts +323 -317
  109. package/src/api/core/geom/update/curve.ts +209 -209
  110. package/src/api/core/geom/update/index.ts +29 -29
  111. package/src/api/core/geom/update/profile.ts +379 -379
  112. package/src/api/core/groups.ts +521 -521
  113. package/src/api/core/handles/index.ts +234 -234
  114. package/src/api/core/history/index.ts +84 -84
  115. package/src/api/core/index.ts +99 -99
  116. package/src/api/core/io/export/index.ts +126 -126
  117. package/src/api/core/io/import/index.ts +504 -504
  118. package/src/api/core/io/index.ts +42 -42
  119. package/src/api/core/io/job/index.ts +140 -140
  120. package/src/api/core/io/query/index.ts +71 -71
  121. package/src/api/core/io/terrain/index.ts +360 -360
  122. package/src/api/core/io/underlay/index.ts +705 -705
  123. package/src/api/core/layers.ts +540 -540
  124. package/src/api/core/math/index.ts +20 -20
  125. package/src/api/core/math/quat.ts +172 -172
  126. package/src/api/core/math/vec3.ts +179 -179
  127. package/src/api/core/mode/index.ts +108 -108
  128. package/src/api/core/project/index.ts +479 -479
  129. package/src/api/core/proposals/index.ts +570 -570
  130. package/src/api/core/storeys/index.ts +311 -308
  131. package/src/api/core/storeys/layers.ts +339 -339
  132. package/src/api/core/tags.ts +911 -911
  133. package/src/api/core/units/index.ts +164 -164
  134. package/src/api/core/user.ts +46 -46
  135. package/src/api/core/zoom/index.ts +64 -51
  136. package/src/api/design/bim.ts +210 -0
  137. package/src/api/design/boolean/index.ts +181 -179
  138. package/src/api/design/catalog.ts +203 -0
  139. package/src/api/design/create/bulk-items.ts +294 -254
  140. package/src/api/design/create/grids.ts +137 -137
  141. package/src/api/design/create/index.ts +2178 -1980
  142. package/src/api/design/create/opening-fields.ts +40 -37
  143. package/src/api/design/delete/index.ts +75 -74
  144. package/src/api/design/dimensions.ts +453 -453
  145. package/src/api/design/doors/index.ts +516 -500
  146. package/src/api/design/edit/index.ts +54 -54
  147. package/src/api/design/erase/index.ts +151 -151
  148. package/src/api/design/family.ts +1342 -704
  149. package/src/api/design/furniture/index.ts +319 -319
  150. package/src/api/design/grids.ts +237 -237
  151. package/src/api/design/index.ts +304 -274
  152. package/src/api/design/lock.ts +69 -69
  153. package/src/api/design/materials/index.ts +608 -608
  154. package/src/api/design/networks.ts +607 -0
  155. package/src/api/design/query/geometry/index.ts +319 -319
  156. package/src/api/design/query/grids.ts +197 -197
  157. package/src/api/design/query/index.ts +1236 -1226
  158. package/src/api/design/query/referenceLines.ts +52 -52
  159. package/src/api/design/query/spaces.ts +275 -275
  160. package/src/api/design/selection/index.ts +273 -273
  161. package/src/api/design/shared.ts +40 -40
  162. package/src/api/design/transform/index.ts +254 -254
  163. package/src/api/design/types/index.ts +163 -156
  164. package/src/api/design/update/index.ts +1096 -983
  165. package/src/api/design/visibility.ts +143 -143
  166. package/src/api/design/windows/index.ts +351 -333
  167. package/src/api/entity/buildableEnvelope.ts +397 -322
  168. package/src/api/entity/index.ts +30 -30
  169. package/src/api/entity/referenceLine.ts +235 -235
  170. package/src/api/entity/space.ts +612 -612
  171. package/src/api/entity/story.ts +517 -517
  172. package/src/api/index.ts +47 -47
  173. package/src/api/presentation/aiInspiration.ts +1116 -1116
  174. package/src/api/presentation/annotate.ts +417 -385
  175. package/src/api/presentation/camera.ts +289 -289
  176. package/src/api/presentation/diagrams.ts +194 -194
  177. package/src/api/presentation/drawingContract.ts +70 -0
  178. package/src/api/presentation/drawings.ts +1179 -0
  179. package/src/api/presentation/export.ts +134 -108
  180. package/src/api/presentation/import.ts +159 -159
  181. package/src/api/presentation/index.ts +160 -135
  182. package/src/api/presentation/placedViews.ts +1211 -1120
  183. package/src/api/presentation/sections.ts +420 -420
  184. package/src/api/presentation/shapes.ts +274 -274
  185. package/src/api/presentation/sheets.ts +746 -585
  186. package/src/api/presentation/slideshow.ts +134 -134
  187. package/src/api/presentation/tables.ts +84 -84
  188. package/src/api/presentation/viewPresets.ts +241 -0
  189. package/src/api/presentation/views.ts +742 -673
  190. package/src/api/presentation/walkthroughs.ts +1201 -1201
  191. package/src/api/program/adjacency.ts +164 -164
  192. package/src/api/program/areas.ts +408 -408
  193. package/src/api/program/classification.ts +138 -138
  194. package/src/api/program/cores.ts +83 -83
  195. package/src/api/program/departments.ts +517 -517
  196. package/src/api/program/index.ts +73 -73
  197. package/src/api/program/labels.ts +332 -332
  198. package/src/api/program/layout.ts +422 -422
  199. package/src/api/program/metadata.ts +364 -364
  200. package/src/api/program/metrics.ts +120 -120
  201. package/src/api/program/site.ts +748 -748
  202. package/src/api/program/spreadsheet.ts +2698 -2698
  203. package/src/api/workspace/index.ts +612 -612
  204. package/src/errors/codes.ts +143 -136
  205. package/src/errors/envelope.ts +75 -75
  206. package/src/errors/index.ts +21 -21
  207. package/src/errors/plugin-error.ts +134 -134
  208. package/src/handles.ts +297 -297
  209. package/src/host-utils.ts +67 -67
  210. package/src/index.ts +7 -7
  211. package/src/massParameters.ops.ts +246 -246
  212. package/src/massParameters.ts +427 -427
  213. package/src/types.ts +16 -16
  214. package/test/drawingContract.test.mjs +288 -0
  215. package/test/errors.test.mjs +185 -184
  216. package/test/massParameters.test.mjs +952 -952
  217. package/test/presentationViewSettings.test.mjs +85 -0
  218. package/tsconfig.json +22 -22
  219. package/tsup.config.ts +12 -12
@@ -1,585 +1,746 @@
1
- import * as z from "zod"
2
- import { PluginApiReturn } from "../../types"
3
-
4
- /**
5
- * Presentation sheets — the layout sheets a presentation is assembled on.
6
- *
7
- * A **sheet** is a page in Present mode that views and diagrams are placed onto.
8
- * These methods require **Present mode to be open** (the documentation editor) —
9
- * reads return `[]`/`null` and writes throw when it is not.
10
- *
11
- * `list`/`get` are reads; the rest mutate and require Present mode to be open:
12
- * `create` adds a sheet, `place` drops a saved view onto a sheet as a live
13
- * linked view shape, `rename` relabels a sheet, `delete` removes one, `reorder`
14
- * moves one in the sheet order, `setActive` navigates to one, and
15
- * `updatePlacedView` re-renders placed views to the current model.
16
- *
17
- * Accessed via `snaptrude.presentation.sheets`.
18
- */
19
- export abstract class PluginPresentationSheetsApi {
20
- constructor() {}
21
-
22
- /**
23
- * List the layout sheets in the presentation.
24
- *
25
- * @returns A {@linkcode PluginPresentationSheetsListResult} with a `sheets`
26
- * array (empty when Present mode is closed or there are no sheets).
27
- *
28
- * @examplePrompt List all the sheets
29
- * @examplePrompt How many layout sheets are there?
30
- * @examplePrompt Show me the presentation sheets
31
- * @examplePrompt What sheets can I place views on?
32
- *
33
- * # Example
34
- * ```ts
35
- * const { sheets } = await snaptrude.presentation.sheets.list()
36
- * ```
37
- */
38
- public abstract list(): PluginApiReturn<PluginPresentationSheetsListResult>
39
-
40
- /**
41
- * Get a single sheet by id.
42
- *
43
- * @param sheetId - The id of the sheet to read.
44
- * @returns The matching {@linkcode PluginPresentationSheet}, or `null`.
45
- *
46
- * @examplePrompt Get the sheet with id sheet_1
47
- * @examplePrompt Find the sheet called Cover
48
- * @examplePrompt Look up a layout sheet by id
49
- *
50
- * # Example
51
- * ```ts
52
- * const sheet = await snaptrude.presentation.sheets.get("sheet_1")
53
- * ```
54
- */
55
- public abstract get(
56
- sheetId: string,
57
- ): PluginApiReturn<PluginPresentationSheetsGetResult>
58
-
59
- /**
60
- * Create a new layout sheet.
61
- *
62
- * Optionally sets the paper size and orientation — the same presets as the
63
- * sheet header's size dropdown (ANSI A–E, Arch A–E1, ISO A4–A0). When `size`
64
- * is omitted the sheet inherits the editor session's last-used size
65
- * (initially ANSI B) in landscape, so pass `size` explicitly whenever the
66
- * output format matters.
67
- *
68
- * Requires Present mode to be open.
69
- *
70
- * @param name - Display name for the new sheet (optional).
71
- * @param options - Optional `size` ({@linkcode PluginSheetSize} paper preset)
72
- * and `orientation` ({@linkcode PluginSheetOrientation}; `"landscape"` when
73
- * omitted).
74
- * @returns The newly created {@linkcode PluginPresentationSheet}.
75
- * @throws If Present mode is not open.
76
- *
77
- * @examplePrompt Create a new sheet called Cover
78
- * @examplePrompt Add an A3 landscape layout sheet
79
- * @examplePrompt Make a new ANSI D presentation sheet named Floor Plans
80
- * @examplePrompt Create a portrait A4 sheet
81
- *
82
- * # Example
83
- * ```ts
84
- * const sheet = await snaptrude.presentation.sheets.create("Cover", {
85
- * size: "ISO_A3",
86
- * orientation: "landscape",
87
- * })
88
- * ```
89
- */
90
- public abstract create(
91
- name?: string,
92
- options?: { size?: PluginSheetSize; orientation?: PluginSheetOrientation },
93
- ): PluginApiReturn<PluginPresentationSheet>
94
-
95
- /**
96
- * Set a sheet's paper size and/or orientation.
97
- *
98
- * Applies one of the standard paper presets — exactly what the sheet header's
99
- * size dropdown and orientation toggle do. Content that no longer fits inside
100
- * the resized sheet is moved out onto the canvas (matching the native
101
- * behavior). Undoable. Does not change the user's remembered default size for
102
- * new sheets.
103
- *
104
- * Requires Present mode to be open.
105
- *
106
- * @param sheetId - The id of the sheet to resize.
107
- * @param size - The paper preset ({@linkcode PluginSheetSize}).
108
- * @param orientation - Optional {@linkcode PluginSheetOrientation}; keeps the
109
- * sheet's current orientation when omitted.
110
- * @returns The updated {@linkcode PluginPresentationSheet}.
111
- * @throws If Present mode is not open, or the sheet id is invalid.
112
- *
113
- * @examplePrompt Resize sheet_1 to A1
114
- * @examplePrompt Make the cover sheet ANSI B portrait
115
- * @examplePrompt Change this sheet to Arch D landscape
116
- * @examplePrompt Set the sheet size to A3
117
- *
118
- * # Example
119
- * ```ts
120
- * const sheet = await snaptrude.presentation.sheets.setSize("sheet_1", "ISO_A1", "portrait")
121
- * ```
122
- */
123
- public abstract setSize(
124
- sheetId: string,
125
- size: PluginSheetSize,
126
- orientation?: PluginSheetOrientation,
127
- ): PluginApiReturn<PluginPresentationSheet>
128
-
129
- /**
130
- * Set a sheet's print margin.
131
- *
132
- * Applies one of the canonical margin presets — exactly what the sheet
133
- * header's margin dropdown does. `margin` is unit-agnostic: `0 | 0.25 |
134
- * 0.5 | 0.75 | 1`, displayed as None / 1/4″ / 1/2″ / 3/4″ / 1″ on imperial
135
- * projects and None / 5mm / 10mm / 15mm / 20mm on metric ones. One undo
136
- * step. Requires Present mode to be open.
137
- *
138
- * @param sheetId - The id of the sheet.
139
- * @param margin - The margin preset ({@linkcode PluginSheetMargin}).
140
- * @returns The updated {@linkcode PluginPresentationSheet}.
141
- * @throws If Present mode is not open, or the sheet id is invalid.
142
- *
143
- * @examplePrompt Set the sheet margin to half an inch
144
- * @examplePrompt Remove the margins on sheet_1
145
- * @examplePrompt Give the cover sheet a 10mm margin
146
- *
147
- * # Example
148
- * ```ts
149
- * const sheet = await snaptrude.presentation.sheets.setMargin("sheet_1", 0.5)
150
- * ```
151
- */
152
- public abstract setMargin(
153
- sheetId: string,
154
- margin: PluginSheetMargin,
155
- ): PluginApiReturn<PluginPresentationSheet>
156
-
157
- /**
158
- * Place a saved view onto a sheet.
159
- *
160
- * Drops the given view onto the sheet through the **native view drop** — the
161
- * placed shape is a live linked view (the same shape the Present views panel's
162
- * drag-drop creates), re-rendered from the current model, so
163
- * {@linkcode PluginPresentationSheetsApi.updatePlacedView} refreshes it later.
164
- * 2D and site-plan views are placed at an architectural scale: the closest
165
- * standard scale by default (the native auto-fit), or the explicit `scale`
166
- * when given — one of the standard values the placed view's Scale dropdown
167
- * offers for the project's unit system (metric `10, 20, 50, 100, 150, 200,
168
- * 250, 500, 1000`; imperial e.g. `48` for 1/4″ = 1′, `96` for 1/8″ = 1′,
169
- * `120` for 1″ = 10′). 3D views have no scale — passing `scale` for one
170
- * throws. Requires Present mode to be open.
171
- *
172
- * @param sheetId - The id of the sheet to place onto.
173
- * @param viewId - The id of the saved view to place.
174
- * @param options - Optional `position` ({@linkcode PluginSheetPosition}) —
175
- * where to place it (sheet centre when omitted) — and `scale` — a standard
176
- * scale value for the project's unit system (2D/site-plan views only;
177
- * auto-fit when omitted).
178
- * @returns A {@linkcode PluginPresentationSheetsPlaceResult} with the created
179
- * `shapeId`.
180
- * @throws If Present mode is not open, the sheet/view id is invalid, `scale`
181
- * is not a standard value for the project's unit system, or `scale` is
182
- * passed for a 3D view.
183
- *
184
- * @examplePrompt Place the floor plan on Sheet 1
185
- * @examplePrompt Add this 3D view to the cover sheet
186
- * @examplePrompt Drop the site plan onto the layout sheet at 100, 200
187
- * @examplePrompt Put the Ground Floor view on sheet_1 at 1:100 scale
188
- * @examplePrompt Place the plan on the cover sheet at quarter-inch scale
189
- *
190
- * # Example
191
- * ```ts
192
- * const { shapeId } = await snaptrude.presentation.sheets.place("sheet_1", "view_123", {
193
- * scale: 100, // 1:100 (metric project)
194
- * })
195
- * ```
196
- */
197
- public abstract place(
198
- sheetId: string,
199
- viewId: string,
200
- options?: { position?: PluginSheetPosition; scale?: number },
201
- ): PluginApiReturn<PluginPresentationSheetsPlaceResult>
202
-
203
- /**
204
- * Rename a layout sheet.
205
- *
206
- * Sets the sheet's display name — the same label the sheets panel shows and
207
- * that `list`/`get` read back. Requires Present mode to be open.
208
- *
209
- * @param sheetId - The id of the sheet to rename.
210
- * @param name - The new display name (non-empty after trimming).
211
- * @returns The updated {@linkcode PluginPresentationSheet}.
212
- * @throws If Present mode is not open, or the sheet id is invalid.
213
- *
214
- * @examplePrompt Rename sheet_1 to Cover
215
- * @examplePrompt Call the first sheet Ground Floor
216
- * @examplePrompt Change this sheet's name to Site Plan
217
- *
218
- * # Example
219
- * ```ts
220
- * const sheet = await snaptrude.presentation.sheets.rename("sheet_1", "Cover")
221
- * ```
222
- */
223
- public abstract rename(
224
- sheetId: string,
225
- name: string,
226
- ): PluginApiReturn<PluginPresentationSheet>
227
-
228
- /**
229
- * Delete a layout sheet.
230
- *
231
- * Removes the sheet (and its placed content) from the presentation and
232
- * renumbers the remaining sheets. Requires Present mode to be open. Auto-diagram
233
- * sheets cannot be deleted through the API — remove those from the Present UI.
234
- *
235
- * @param sheetId - The id of the sheet to delete.
236
- * @returns The id of the deleted sheet
237
- * (a {@linkcode PluginPresentationSheetsDeleteResult}).
238
- * @throws If Present mode is not open, the sheet id is invalid, or the sheet is
239
- * an auto-diagram sheet.
240
- *
241
- * @examplePrompt Delete sheet_2
242
- * @examplePrompt Remove the Cover sheet
243
- * @examplePrompt Get rid of the last layout sheet
244
- *
245
- * # Example
246
- * ```ts
247
- * const { id } = await snaptrude.presentation.sheets.delete("sheet_2")
248
- * ```
249
- */
250
- public abstract delete(
251
- sheetId: string,
252
- ): PluginApiReturn<PluginPresentationSheetsDeleteResult>
253
-
254
- /**
255
- * Move a sheet to a new position in the sheet order.
256
- *
257
- * Reorders the sheet to the given zero-based `index` (as the sheets panel does
258
- * when a sheet is dragged) and renumbers the rest. `index` is clamped to the
259
- * valid range. Requires Present mode to be open.
260
- *
261
- * @param sheetId - The id of the sheet to move.
262
- * @param index - Zero-based target position in the sheet order.
263
- * @returns The sheets in their new order
264
- * (a {@linkcode PluginPresentationSheetsListResult}).
265
- * @throws If Present mode is not open, or the sheet id is invalid.
266
- *
267
- * @examplePrompt Move sheet_3 to the front
268
- * @examplePrompt Make the Cover sheet the first sheet
269
- * @examplePrompt Reorder this sheet to position 2
270
- *
271
- * # Example
272
- * ```ts
273
- * const { sheets } = await snaptrude.presentation.sheets.reorder("sheet_3", 0)
274
- * ```
275
- */
276
- public abstract reorder(
277
- sheetId: string,
278
- index: number,
279
- ): PluginApiReturn<PluginPresentationSheetsListResult>
280
-
281
- /**
282
- * Make a sheet the active sheet.
283
- *
284
- * Selects the sheet in the sheets panel and navigates the Present canvas to it
285
- * (the same as clicking it in the panel). Requires Present mode to be open.
286
- *
287
- * @param sheetId - The id of the sheet to activate.
288
- * @returns The now-active {@linkcode PluginPresentationSheet}.
289
- * @throws If Present mode is not open, or the sheet id is invalid.
290
- *
291
- * @examplePrompt Go to sheet_1
292
- * @examplePrompt Open the Cover sheet
293
- * @examplePrompt Switch to the Site Plan sheet
294
- *
295
- * # Example
296
- * ```ts
297
- * await snaptrude.presentation.sheets.setActive("sheet_1")
298
- * ```
299
- */
300
- public abstract setActive(
301
- sheetId: string,
302
- ): PluginApiReturn<PluginPresentationSheet>
303
-
304
- /**
305
- * Refresh placed views to the current model state.
306
- *
307
- * Re-renders the presentation's placed **views** — the live linked view shapes —
308
- * from the current model (the "Update views" action). Views placed with
309
- * {@linkcode PluginPresentationSheetsApi.place} are live view shapes too, so
310
- * they refresh along with panel-dropped ones. Pass `sheetId` to refresh only
311
- * the views on that sheet, or omit it to refresh every placed view. Requires
312
- * Present mode to be open.
313
- *
314
- * @param options - Optional `sheetId` — restrict the refresh to one sheet's
315
- * placed views (all placed views when omitted).
316
- * @returns The ids of the placed view shapes submitted for refresh
317
- * (a {@linkcode PluginPresentationSheetsUpdatePlacedViewResult}).
318
- * @throws If Present mode is not open, or `sheetId` is given but invalid.
319
- *
320
- * @examplePrompt Update all the placed views to the latest model
321
- * @examplePrompt Refresh the views on sheet_1
322
- * @examplePrompt Re-render the placed views after my edits
323
- *
324
- * # Example
325
- * ```ts
326
- * const { shapeIds } = await snaptrude.presentation.sheets.updatePlacedView()
327
- * ```
328
- */
329
- public abstract updatePlacedView(options?: {
330
- sheetId?: string
331
- }): PluginApiReturn<PluginPresentationSheetsUpdatePlacedViewResult>
332
- }
333
-
334
- /**
335
- * Standard paper-size presets for layout sheets — identical to the sheet
336
- * header's size dropdown in Present mode.
337
- */
338
- export const PluginSheetSize = z.enum([
339
- "ANSI_A",
340
- "ANSI_B",
341
- "ANSI_C",
342
- "ANSI_D",
343
- "ANSI_E",
344
- "ARCH_A",
345
- "ARCH_B",
346
- "ARCH_C",
347
- "ARCH_D",
348
- "ARCH_E",
349
- "ARCH_E1",
350
- "ISO_A4",
351
- "ISO_A3",
352
- "ISO_A2",
353
- "ISO_A1",
354
- "ISO_A0",
355
- ])
356
- export type PluginSheetSize = z.infer<typeof PluginSheetSize>
357
-
358
- /** Sheet orientation. */
359
- export const PluginSheetOrientation = z.enum(["landscape", "portrait"])
360
- export type PluginSheetOrientation = z.infer<typeof PluginSheetOrientation>
361
-
362
- /**
363
- * Canonical sheet margin presets — unit-agnostic values matching the sheet
364
- * header's margin dropdown: `0` (None), `0.25`, `0.5`, `0.75`, `1`.
365
- * Displayed as None / 1/4″ / 1/2″ / 3/4″ / 1″ on imperial projects and
366
- * None / 5mm / 10mm / 15mm / 20mm on metric ones.
367
- */
368
- export const PluginSheetMargin = z.union([
369
- z.literal(0),
370
- z.literal(0.25),
371
- z.literal(0.5),
372
- z.literal(0.75),
373
- z.literal(1),
374
- ])
375
- export type PluginSheetMargin = z.infer<typeof PluginSheetMargin>
376
-
377
- /**
378
- * A layout sheet in the presentation.
379
- *
380
- * | Property | Type | Description |
381
- * |---|---|---|
382
- * | `id` | `string` | Unique sheet id |
383
- * | `name` | `string` | Display name |
384
- * | `size` | {@linkcode PluginSheetSize}` \| null` | Paper preset (`null` for a legacy sheet without one) |
385
- * | `orientation` | {@linkcode PluginSheetOrientation}` \| null` | Orientation (`null` for a legacy sheet) |
386
- * | `margin` | {@linkcode PluginSheetMargin}` \| null` | Margin preset (`null` when absent/unrecognized) |
387
- */
388
- export const PluginPresentationSheet = z.object({
389
- id: z.string(),
390
- name: z.string(),
391
- size: PluginSheetSize.nullable(),
392
- orientation: PluginSheetOrientation.nullable(),
393
- margin: PluginSheetMargin.nullable(),
394
- })
395
- export type PluginPresentationSheet = z.infer<typeof PluginPresentationSheet>
396
-
397
- /**
398
- * A position on a sheet/canvas (sheet coordinates).
399
- *
400
- * | Property | Type | Description |
401
- * |---|---|---|
402
- * | `x` | `number` | X coordinate |
403
- * | `y` | `number` | Y coordinate |
404
- */
405
- export const PluginSheetPosition = z.object({
406
- x: z.number(),
407
- y: z.number(),
408
- })
409
- export type PluginSheetPosition = z.infer<typeof PluginSheetPosition>
410
-
411
- /** Result of {@linkcode PluginPresentationSheetsApi.list}. */
412
- export const PluginPresentationSheetsListResult = z.object({
413
- sheets: z.array(PluginPresentationSheet),
414
- })
415
- export type PluginPresentationSheetsListResult = z.infer<
416
- typeof PluginPresentationSheetsListResult
417
- >
418
-
419
- /** Arguments for {@linkcode PluginPresentationSheetsApi.get}. */
420
- export const PluginPresentationSheetsGetArgs = z.object({
421
- id: z.string(),
422
- })
423
- export type PluginPresentationSheetsGetArgs = z.infer<
424
- typeof PluginPresentationSheetsGetArgs
425
- >
426
-
427
- /** Result of {@linkcode PluginPresentationSheetsApi.get} — the sheet, or `null`. */
428
- export const PluginPresentationSheetsGetResult =
429
- PluginPresentationSheet.nullable()
430
- export type PluginPresentationSheetsGetResult = z.infer<
431
- typeof PluginPresentationSheetsGetResult
432
- >
433
-
434
- /** Arguments for {@linkcode PluginPresentationSheetsApi.create}. */
435
- export const PluginPresentationSheetsCreateArgs = z.object({
436
- name: z.string().optional(),
437
- size: PluginSheetSize.optional(),
438
- orientation: PluginSheetOrientation.optional(),
439
- })
440
- export type PluginPresentationSheetsCreateArgs = z.infer<
441
- typeof PluginPresentationSheetsCreateArgs
442
- >
443
-
444
- /** Arguments for {@linkcode PluginPresentationSheetsApi.setSize}. */
445
- export const PluginPresentationSheetsSetSizeArgs = z.object({
446
- sheetId: z.string(),
447
- size: PluginSheetSize,
448
- orientation: PluginSheetOrientation.optional(),
449
- })
450
- export type PluginPresentationSheetsSetSizeArgs = z.infer<
451
- typeof PluginPresentationSheetsSetSizeArgs
452
- >
453
-
454
- /** Arguments for {@linkcode PluginPresentationSheetsApi.setMargin}. */
455
- export const PluginPresentationSheetsSetMarginArgs = z.object({
456
- sheetId: z.string(),
457
- margin: PluginSheetMargin,
458
- })
459
- export type PluginPresentationSheetsSetMarginArgs = z.infer<
460
- typeof PluginPresentationSheetsSetMarginArgs
461
- >
462
-
463
- /**
464
- * Arguments for {@linkcode PluginPresentationSheetsApi.place}.
465
- *
466
- * | Property | Type | Description |
467
- * |---|---|---|
468
- * | `sheetId` | `string` | The sheet to place onto |
469
- * | `viewId` | `string` | The saved view to place |
470
- * | `position` | {@linkcode PluginSheetPosition}` \| undefined` | Where to place it (sheet centre when omitted) |
471
- * | `scale` | `number \| undefined` | Standard scale value for the project's unit system (2D/site-plan views only; auto-fit to the closest standard scale when omitted) |
472
- */
473
- export const PluginPresentationSheetsPlaceArgs = z.object({
474
- sheetId: z.string(),
475
- viewId: z.string(),
476
- position: PluginSheetPosition.optional(),
477
- scale: z.number().positive().optional(),
478
- })
479
- export type PluginPresentationSheetsPlaceArgs = z.infer<
480
- typeof PluginPresentationSheetsPlaceArgs
481
- >
482
-
483
- /**
484
- * Result of {@linkcode PluginPresentationSheetsApi.place}.
485
- *
486
- * | Property | Type | Description |
487
- * |---|---|---|
488
- * | `shapeId` | `string` | Id of the created canvas shape |
489
- */
490
- export const PluginPresentationSheetsPlaceResult = z.object({
491
- shapeId: z.string(),
492
- })
493
- export type PluginPresentationSheetsPlaceResult = z.infer<
494
- typeof PluginPresentationSheetsPlaceResult
495
- >
496
-
497
- /**
498
- * Arguments for {@linkcode PluginPresentationSheetsApi.rename}.
499
- *
500
- * | Property | Type | Description |
501
- * |---|---|---|
502
- * | `sheetId` | `string` | The sheet to rename |
503
- * | `name` | `string` | New display name (non-empty after trimming) |
504
- */
505
- export const PluginPresentationSheetsRenameArgs = z.object({
506
- sheetId: z.string(),
507
- name: z.string().trim().min(1),
508
- })
509
- export type PluginPresentationSheetsRenameArgs = z.infer<
510
- typeof PluginPresentationSheetsRenameArgs
511
- >
512
-
513
- /** Arguments for {@linkcode PluginPresentationSheetsApi.delete}. */
514
- export const PluginPresentationSheetsDeleteArgs = z.object({
515
- sheetId: z.string(),
516
- })
517
- export type PluginPresentationSheetsDeleteArgs = z.infer<
518
- typeof PluginPresentationSheetsDeleteArgs
519
- >
520
-
521
- /**
522
- * Result of {@linkcode PluginPresentationSheetsApi.delete}.
523
- *
524
- * | Property | Type | Description |
525
- * |---|---|---|
526
- * | `id` | `string` | Id of the deleted sheet |
527
- */
528
- export const PluginPresentationSheetsDeleteResult = z.object({
529
- id: z.string(),
530
- })
531
- export type PluginPresentationSheetsDeleteResult = z.infer<
532
- typeof PluginPresentationSheetsDeleteResult
533
- >
534
-
535
- /**
536
- * Arguments for {@linkcode PluginPresentationSheetsApi.reorder}.
537
- *
538
- * | Property | Type | Description |
539
- * |---|---|---|
540
- * | `sheetId` | `string` | The sheet to move |
541
- * | `index` | `number` | Zero-based target position (clamped to range) |
542
- */
543
- export const PluginPresentationSheetsReorderArgs = z.object({
544
- sheetId: z.string(),
545
- index: z.number().int().min(0),
546
- })
547
- export type PluginPresentationSheetsReorderArgs = z.infer<
548
- typeof PluginPresentationSheetsReorderArgs
549
- >
550
-
551
- /** Arguments for {@linkcode PluginPresentationSheetsApi.setActive}. */
552
- export const PluginPresentationSheetsSetActiveArgs = z.object({
553
- sheetId: z.string(),
554
- })
555
- export type PluginPresentationSheetsSetActiveArgs = z.infer<
556
- typeof PluginPresentationSheetsSetActiveArgs
557
- >
558
-
559
- /**
560
- * Arguments for {@linkcode PluginPresentationSheetsApi.updatePlacedView}.
561
- *
562
- * | Property | Type | Description |
563
- * |---|---|---|
564
- * | `sheetId` | `string`? | Restrict the refresh to one sheet's placed views |
565
- */
566
- export const PluginPresentationSheetsUpdatePlacedViewArgs = z.object({
567
- sheetId: z.string().optional(),
568
- })
569
- export type PluginPresentationSheetsUpdatePlacedViewArgs = z.infer<
570
- typeof PluginPresentationSheetsUpdatePlacedViewArgs
571
- >
572
-
573
- /**
574
- * Result of {@linkcode PluginPresentationSheetsApi.updatePlacedView}.
575
- *
576
- * | Property | Type | Description |
577
- * |---|---|---|
578
- * | `shapeIds` | `string[]` | Ids of the placed view shapes submitted for refresh |
579
- */
580
- export const PluginPresentationSheetsUpdatePlacedViewResult = z.object({
581
- shapeIds: z.array(z.string()),
582
- })
583
- export type PluginPresentationSheetsUpdatePlacedViewResult = z.infer<
584
- typeof PluginPresentationSheetsUpdatePlacedViewResult
585
- >
1
+ import * as z from "zod"
2
+ import { PluginApiReturn } from "../../types"
3
+ import { PluginStandardDrawingScale } from "./drawingContract"
4
+
5
+ /**
6
+ * Presentation sheets — the layout sheets a presentation is assembled on.
7
+ *
8
+ * A **sheet** is a page in Present mode that views and diagrams are placed onto.
9
+ * These methods require **Present mode to be open** (the documentation editor) —
10
+ * reads return `[]`/`null` and writes throw when it is not.
11
+ *
12
+ * `list`/`get` are reads; the rest mutate and require Present mode to be open:
13
+ * `create` adds a sheet, `place` drops a saved view onto a sheet as a live
14
+ * linked view shape (fitted to that sheet), `placeDrawing` moves an existing
15
+ * drawing onto a sheet (scaled down to fit by default), `rename` relabels a
16
+ * sheet, `delete` removes one, `reorder` moves one in the sheet order,
17
+ * `setActive` navigates to one, and `updatePlacedView` re-renders placed views
18
+ * to the current model.
19
+ *
20
+ * `presentation.drawings.create` never puts a drawing on a sheet: it makes the
21
+ * drawing beside its source view on the canvas. To put a view on a sheet, call
22
+ * `place(sheetId, viewId)`; to move a drawing you already made, call
23
+ * `placeDrawing(sheetId, drawingId)`.
24
+ *
25
+ * Accessed via `snaptrude.presentation.sheets`.
26
+ */
27
+ export abstract class PluginPresentationSheetsApi {
28
+ constructor() {}
29
+
30
+ /**
31
+ * List the layout sheets in the presentation.
32
+ *
33
+ * @returns A {@linkcode PluginPresentationSheetsListResult} with a `sheets`
34
+ * array (empty when Present mode is closed or there are no sheets).
35
+ *
36
+ * @examplePrompt List all the sheets
37
+ * @examplePrompt How many layout sheets are there?
38
+ * @examplePrompt Show me the presentation sheets
39
+ * @examplePrompt What sheets can I place views on?
40
+ *
41
+ * # Example
42
+ * ```ts
43
+ * const { sheets } = await snaptrude.presentation.sheets.list()
44
+ * ```
45
+ */
46
+ public abstract list(): PluginApiReturn<PluginPresentationSheetsListResult>
47
+
48
+ /**
49
+ * Get a single sheet by id.
50
+ *
51
+ * @param sheetId - The id of the sheet to read.
52
+ * @returns The matching {@linkcode PluginPresentationSheet}, or `null`.
53
+ *
54
+ * @examplePrompt Get the sheet with id sheet_1
55
+ * @examplePrompt Find the sheet called Cover
56
+ * @examplePrompt Look up a layout sheet by id
57
+ *
58
+ * # Example
59
+ * ```ts
60
+ * const sheet = await snaptrude.presentation.sheets.get("sheet_1")
61
+ * ```
62
+ */
63
+ public abstract get(
64
+ sheetId: string,
65
+ ): PluginApiReturn<PluginPresentationSheetsGetResult>
66
+
67
+ /**
68
+ * Create a new layout sheet.
69
+ *
70
+ * Optionally sets the paper size and orientation — the same presets as the
71
+ * sheet header's size dropdown (ANSI A–E, Arch A–E1, ISO A4–A0). When `size`
72
+ * is omitted the sheet inherits the editor session's last-used size
73
+ * (initially ANSI B) in landscape, so pass `size` explicitly whenever the
74
+ * output format matters.
75
+ *
76
+ * Requires Present mode to be open.
77
+ *
78
+ * @param name - Display name for the new sheet (optional).
79
+ * @param options - Optional `size` ({@linkcode PluginSheetSize} paper preset)
80
+ * and `orientation` ({@linkcode PluginSheetOrientation}; `"landscape"` when
81
+ * omitted).
82
+ * @returns The newly created {@linkcode PluginPresentationSheet}.
83
+ * @throws If Present mode is not open.
84
+ *
85
+ * @examplePrompt Create a new sheet called Cover
86
+ * @examplePrompt Add an A3 landscape layout sheet
87
+ * @examplePrompt Make a new ANSI D presentation sheet named Floor Plans
88
+ * @examplePrompt Create a portrait A4 sheet
89
+ *
90
+ * # Example
91
+ * ```ts
92
+ * const sheet = await snaptrude.presentation.sheets.create("Cover", {
93
+ * size: "ISO_A3",
94
+ * orientation: "landscape",
95
+ * })
96
+ * ```
97
+ */
98
+ public abstract create(
99
+ name?: string,
100
+ options?: { size?: PluginSheetSize; orientation?: PluginSheetOrientation },
101
+ ): PluginApiReturn<PluginPresentationSheet>
102
+
103
+ /**
104
+ * Set a sheet's paper size and/or orientation.
105
+ *
106
+ * Applies one of the standard paper presets — exactly what the sheet header's
107
+ * size dropdown and orientation toggle do. Content that no longer fits inside
108
+ * the resized sheet is moved out onto the canvas (matching the native
109
+ * behavior). Undoable. Does not change the user's remembered default size for
110
+ * new sheets.
111
+ *
112
+ * Requires Present mode to be open.
113
+ *
114
+ * @param sheetId - The id of the sheet to resize.
115
+ * @param size - The paper preset ({@linkcode PluginSheetSize}).
116
+ * @param orientation - Optional {@linkcode PluginSheetOrientation}; keeps the
117
+ * sheet's current orientation when omitted.
118
+ * @returns The updated {@linkcode PluginPresentationSheet}.
119
+ * @throws If Present mode is not open, or the sheet id is invalid.
120
+ *
121
+ * @examplePrompt Resize sheet_1 to A1
122
+ * @examplePrompt Make the cover sheet ANSI B portrait
123
+ * @examplePrompt Change this sheet to Arch D landscape
124
+ * @examplePrompt Set the sheet size to A3
125
+ *
126
+ * # Example
127
+ * ```ts
128
+ * const sheet = await snaptrude.presentation.sheets.setSize("sheet_1", "ISO_A1", "portrait")
129
+ * ```
130
+ */
131
+ public abstract setSize(
132
+ sheetId: string,
133
+ size: PluginSheetSize,
134
+ orientation?: PluginSheetOrientation,
135
+ ): PluginApiReturn<PluginPresentationSheet>
136
+
137
+ /**
138
+ * Set a sheet's print margin.
139
+ *
140
+ * Applies one of the canonical margin presets — exactly what the sheet
141
+ * header's margin dropdown does. `margin` is unit-agnostic: `0 | 0.25 |
142
+ * 0.5 | 0.75 | 1`, displayed as None / 1/4″ / 1/2″ / 3/4″ / 1″ on imperial
143
+ * projects and None / 5mm / 10mm / 15mm / 20mm on metric ones. One undo
144
+ * step. Requires Present mode to be open.
145
+ *
146
+ * @param sheetId - The id of the sheet.
147
+ * @param margin - The margin preset ({@linkcode PluginSheetMargin}).
148
+ * @returns The updated {@linkcode PluginPresentationSheet}.
149
+ * @throws If Present mode is not open, or the sheet id is invalid.
150
+ *
151
+ * @examplePrompt Set the sheet margin to half an inch
152
+ * @examplePrompt Remove the margins on sheet_1
153
+ * @examplePrompt Give the cover sheet a 10mm margin
154
+ *
155
+ * # Example
156
+ * ```ts
157
+ * const sheet = await snaptrude.presentation.sheets.setMargin("sheet_1", 0.5)
158
+ * ```
159
+ */
160
+ public abstract setMargin(
161
+ sheetId: string,
162
+ margin: PluginSheetMargin,
163
+ ): PluginApiReturn<PluginPresentationSheet>
164
+
165
+ /**
166
+ * Place a saved view onto a sheet. This is the call that puts a view on a
167
+ * sheet (`presentation.drawings.create` makes a drawing beside its source
168
+ * view, not on a sheet). When `scale` is omitted the view is fitted to the
169
+ * target sheet: a 2D or site-plan view is placed at the largest
170
+ * standard scale at which it fits inside the target sheet's margin, and
171
+ * never at a larger scale than the normal view drop would pick; a 3D view
172
+ * has no scale, so it is shrunk evenly to fit instead. This is the same fit
173
+ * as `placeDrawing`. Omit `position` unless the user asked for a specific
174
+ * place.
175
+ * Without a `position` the drawing goes to the sheet centre when that is
176
+ * free, otherwise to the nearest free spot to the centre inside the margin,
177
+ * beside the drawings already there; when there is no free spot it is
178
+ * centred anyway and the result has `overlaps: true`. With a `position` it
179
+ * is placed as given, and the result has `overlaps: true` when it covers
180
+ * another drawing, but it is not moved. In both cases only other drawings
181
+ * count (placed views and their title blocks and labels): text, images and
182
+ * other shapes on the sheet are ignored. Each call fits one view to the
183
+ * whole sheet, so a second fitted view often has no free spot: when several
184
+ * views should share a sheet, pass a `scale` small enough for all of them;
185
+ * otherwise use `sheets.create` per view. When the result's `overlaps` is
186
+ * true, move the drawing or put it on its own sheet.
187
+ * An explicit `scale` is always kept, even when the drawing (title block
188
+ * included) does not fit inside the sheet's margin at that scale; the result
189
+ * then has `overflows: true`. When it is true, pass a smaller scale (larger
190
+ * denominator), omit `scale` to fit, or use a larger sheet.
191
+ * `scale` must be a standard architectural scale denominator (100 means 1:100)
192
+ * in the project's unit system; any other value is rejected. Metric: 10, 20, 50,
193
+ * 100, 150, 200, 250, 500, 1000. Imperial detail: 12, 16, 24, 32, 48, 64, 96, 128,
194
+ * 192, 384, 768, 1536 (1" = 1' to 1/128" = 1'; 48 is 1/4" = 1', 96 is 1/8" = 1').
195
+ * Imperial site: 120, 240, 360, 480, 600, 1200, 2400, 3600, 4800 (1" = 10' to
196
+ * 1" = 400'). Pick the LARGEST standard scale (smallest denominator) at which the
197
+ * view still fits its frame or sheet and its room labels stay readable: for a
198
+ * building floor plan that is usually 1:50 to 1:200 (1/4" = 1' to 1/16" = 1').
199
+ * Never use a site-sized scale (1:500 and up, 1/64" = 1' (768) and smaller,
200
+ * 1" = 20' (240) and up) for a single building plan unless the user asked for it.
201
+ *
202
+ * Drops the given view onto the sheet through the **native view drop** — the
203
+ * placed shape is a live linked view (the same shape the Present views panel's
204
+ * drag-drop creates), re-rendered from the current model, so
205
+ * {@linkcode PluginPresentationSheetsApi.updatePlacedView} refreshes it later.
206
+ * 2D and site-plan views are placed at an architectural scale: the fitted
207
+ * standard scale described above by default, or the explicit `scale` when
208
+ * given (one of the standard values above). 3D views have no scale; passing
209
+ * `scale` for one throws. Requires Present mode to be open.
210
+ *
211
+ * @param sheetId - The id of the sheet to place onto.
212
+ * @param viewId - The id of the saved view to place.
213
+ * @param options - Optional `position` ({@linkcode PluginSheetPosition}) —
214
+ * where to place it (when omitted, the sheet centre or the nearest free
215
+ * spot) — and `scale` — a standard scale value for the project's unit system (2D/site-plan views only;
216
+ * fitted to the target sheet when omitted).
217
+ * @returns A {@linkcode PluginPresentationSheetsPlaceResult} with the created
218
+ * `shapeId`, the `scale` used (`null` for a 3D view), whether the fit
219
+ * `rescaled` it, whether it `overlaps` another drawing on the sheet, and
220
+ * whether it `overflows` the sheet's margin at an explicit `scale`.
221
+ * (Hosts older than the fit return only `shapeId`.)
222
+ * @throws If Present mode is not open, the sheet/view id is invalid, `scale`
223
+ * is not a standard value for the project's unit system, or `scale` is
224
+ * passed for a 3D view. `PRECONDITION_FAILED` when the view does not fit
225
+ * the sheet even at the smallest standard scale, or the title block alone
226
+ * is larger than the sheet's drawable area (use a larger sheet); no
227
+ * drawing is left on the sheet.
228
+ *
229
+ * @examplePrompt Place the floor plan on Sheet 1
230
+ * @examplePrompt Add this 3D view to the cover sheet
231
+ * @examplePrompt Drop the site plan onto the layout sheet at 100, 200
232
+ * @examplePrompt Put the Ground Floor view on sheet_1 at 1:100 scale
233
+ * @examplePrompt Place the plan on the cover sheet at quarter-inch scale
234
+ * @examplePrompt Add a floor plan drawing of each storey to this sheet
235
+ *
236
+ * # Example
237
+ * ```ts
238
+ * const { shapeId } = await snaptrude.presentation.sheets.place("sheet_1", "view_123", {
239
+ * scale: 100, // 1:100 (metric project)
240
+ * })
241
+ * ```
242
+ */
243
+ public abstract place(
244
+ sheetId: string,
245
+ viewId: string,
246
+ options?: { position?: PluginSheetPosition; scale?: number },
247
+ ): PluginApiReturn<PluginPresentationSheetsPlaceResult>
248
+
249
+ /**
250
+ * Move an existing drawing onto a sheet without copying or regenerating it,
251
+ * scaled down to fit the sheet when it is too big. `presentation.drawings.create`
252
+ * leaves a drawing beside its source view, not on a sheet; this is the call
253
+ * that puts it on one. To place a saved view on a sheet in one call, use
254
+ * `sheets.place(sheetId, viewId)`, which fits it the same way.
255
+ * By default (`fit` true or omitted) a drawing larger than the sheet's
256
+ * drawable area (the sheet inside its margin) is moved to the LARGEST standard
257
+ * architectural scale at which it fits; a drawing that already fits keeps its
258
+ * scale, and a drawing is never scaled up. A 3D drawing has no architectural
259
+ * scale, so it is shrunk uniformly to fit instead. With `fit: false` the scale
260
+ * is kept and a drawing that does not fit is rejected with an error naming the
261
+ * drawing, the sheet and the scale, and saying to call `placeDrawing` without
262
+ * `fit: false` to fit it, or use a larger sheet. When even
263
+ * the smallest standard scale does not fit, the call is rejected with an error
264
+ * suggesting a larger sheet size.
265
+ * Without a `position` the drawing goes to the sheet centre when that is
266
+ * free, otherwise to the nearest free spot to the centre inside the margin,
267
+ * beside the drawings already there; when there is no free spot it is
268
+ * centred anyway and the result has `overlaps: true`. With a `position` it
269
+ * is placed as given, and the result has `overlaps: true` when it covers
270
+ * another drawing, but it is not moved. In both cases only other drawings
271
+ * count (placed views and their title blocks and labels): text, images and
272
+ * other shapes on the sheet are ignored. Each call fits one drawing to the
273
+ * whole sheet, so a second fitted drawing often has no free spot: when
274
+ * several drawings should share a sheet, give them scales small enough for
275
+ * all of them; otherwise use `sheets.create` per drawing.
276
+ * The position is sheet-local. The drawing's
277
+ * stable id remains unchanged; `shapeId` therefore identifies the moved
278
+ * drawing. The result reports the architectural scale the drawing has on the
279
+ * sheet and whether this call changed it; a host that reports it also says
280
+ * whether the drawing `overlaps` another drawing on the sheet (move it or
281
+ * put it on its own sheet when true).
282
+ *
283
+ * @param sheetId - The id of the destination sheet.
284
+ * @param drawingId - The id of an existing drawing deliverable.
285
+ * @param options - Optional sheet-local `position` (when omitted, the sheet centre or the nearest free spot)
286
+ * and `fit` (default `true`: scale a drawing that does not fit down to fit;
287
+ * `false`: keep its scale and reject a drawing that does not fit).
288
+ * @returns A {@linkcode PluginPresentationSheetsPlaceDrawingResult} with the
289
+ * drawing's `shapeId`, the `scale` used (`null` for a 3D drawing),
290
+ * `rescaled`, and optionally `overlaps`.
291
+ * @throws `PRECONDITION_FAILED` if Present mode is closed, the sheet is locked,
292
+ * the drawing does not fit with `fit: false`, or it does not fit even at the
293
+ * smallest standard scale; `HANDLE_INVALID` if either id is invalid or the
294
+ * shape is not a drawing.
295
+ *
296
+ * @examplePrompt Move this drawing onto the cover sheet
297
+ * @examplePrompt Place drawing_1 at the center of sheet_2
298
+ * @examplePrompt Put the level 2 plan drawing on the Level 2 Plan sheet
299
+ * @examplePrompt Add the floor plan drawings to this sheet
300
+ *
301
+ * # Example
302
+ * ```ts
303
+ * const { scale, rescaled } = await snaptrude.presentation.sheets.placeDrawing(
304
+ * sheet.id,
305
+ * drawing.id,
306
+ * )
307
+ * ```
308
+ */
309
+ public abstract placeDrawing(
310
+ sheetId: string,
311
+ drawingId: string,
312
+ options?: { position?: PluginSheetPosition; fit?: boolean },
313
+ ): PluginApiReturn<PluginPresentationSheetsPlaceDrawingResult>
314
+
315
+ /**
316
+ * Rename a layout sheet.
317
+ *
318
+ * Sets the sheet's display name — the same label the sheets panel shows and
319
+ * that `list`/`get` read back. Requires Present mode to be open.
320
+ *
321
+ * @param sheetId - The id of the sheet to rename.
322
+ * @param name - The new display name (non-empty after trimming).
323
+ * @returns The updated {@linkcode PluginPresentationSheet}.
324
+ * @throws If Present mode is not open, or the sheet id is invalid.
325
+ *
326
+ * @examplePrompt Rename sheet_1 to Cover
327
+ * @examplePrompt Call the first sheet Ground Floor
328
+ * @examplePrompt Change this sheet's name to Site Plan
329
+ *
330
+ * # Example
331
+ * ```ts
332
+ * const sheet = await snaptrude.presentation.sheets.rename("sheet_1", "Cover")
333
+ * ```
334
+ */
335
+ public abstract rename(
336
+ sheetId: string,
337
+ name: string,
338
+ ): PluginApiReturn<PluginPresentationSheet>
339
+
340
+ /**
341
+ * Delete a layout sheet.
342
+ *
343
+ * Removes the sheet (and its placed content) from the presentation and
344
+ * renumbers the remaining sheets. Requires Present mode to be open. Auto-diagram
345
+ * sheets cannot be deleted through the API — remove those from the Present UI.
346
+ *
347
+ * @param sheetId - The id of the sheet to delete.
348
+ * @returns The id of the deleted sheet
349
+ * (a {@linkcode PluginPresentationSheetsDeleteResult}).
350
+ * @throws If Present mode is not open, the sheet id is invalid, or the sheet is
351
+ * an auto-diagram sheet.
352
+ *
353
+ * @examplePrompt Delete sheet_2
354
+ * @examplePrompt Remove the Cover sheet
355
+ * @examplePrompt Get rid of the last layout sheet
356
+ *
357
+ * # Example
358
+ * ```ts
359
+ * const { id } = await snaptrude.presentation.sheets.delete("sheet_2")
360
+ * ```
361
+ */
362
+ public abstract delete(
363
+ sheetId: string,
364
+ ): PluginApiReturn<PluginPresentationSheetsDeleteResult>
365
+
366
+ /**
367
+ * Move a sheet to a new position in the sheet order.
368
+ *
369
+ * Reorders the sheet to the given zero-based `index` (as the sheets panel does
370
+ * when a sheet is dragged) and renumbers the rest. `index` is clamped to the
371
+ * valid range. Requires Present mode to be open.
372
+ *
373
+ * @param sheetId - The id of the sheet to move.
374
+ * @param index - Zero-based target position in the sheet order.
375
+ * @returns The sheets in their new order
376
+ * (a {@linkcode PluginPresentationSheetsListResult}).
377
+ * @throws If Present mode is not open, or the sheet id is invalid.
378
+ *
379
+ * @examplePrompt Move sheet_3 to the front
380
+ * @examplePrompt Make the Cover sheet the first sheet
381
+ * @examplePrompt Reorder this sheet to position 2
382
+ *
383
+ * # Example
384
+ * ```ts
385
+ * const { sheets } = await snaptrude.presentation.sheets.reorder("sheet_3", 0)
386
+ * ```
387
+ */
388
+ public abstract reorder(
389
+ sheetId: string,
390
+ index: number,
391
+ ): PluginApiReturn<PluginPresentationSheetsListResult>
392
+
393
+ /**
394
+ * Make a sheet the active sheet.
395
+ *
396
+ * Selects the sheet in the sheets panel and navigates the Present canvas to it
397
+ * (the same as clicking it in the panel). Requires Present mode to be open.
398
+ *
399
+ * @param sheetId - The id of the sheet to activate.
400
+ * @returns The now-active {@linkcode PluginPresentationSheet}.
401
+ * @throws If Present mode is not open, or the sheet id is invalid.
402
+ *
403
+ * @examplePrompt Go to sheet_1
404
+ * @examplePrompt Open the Cover sheet
405
+ * @examplePrompt Switch to the Site Plan sheet
406
+ *
407
+ * # Example
408
+ * ```ts
409
+ * await snaptrude.presentation.sheets.setActive("sheet_1")
410
+ * ```
411
+ */
412
+ public abstract setActive(
413
+ sheetId: string,
414
+ ): PluginApiReturn<PluginPresentationSheet>
415
+
416
+ /**
417
+ * Refresh placed views to the current model state.
418
+ *
419
+ * Re-renders the presentation's placed **views** — the live linked view shapes —
420
+ * from the current model (the "Update views" action). Views placed with
421
+ * {@linkcode PluginPresentationSheetsApi.place} are live view shapes too, so
422
+ * they refresh along with panel-dropped ones. Pass `sheetId` to refresh only
423
+ * the views on that sheet, or omit it to refresh every placed view. Requires
424
+ * Present mode to be open.
425
+ *
426
+ * @param options - Optional `sheetId` — restrict the refresh to one sheet's
427
+ * placed views (all placed views when omitted).
428
+ * @returns The ids of the placed view shapes submitted for refresh
429
+ * (a {@linkcode PluginPresentationSheetsUpdatePlacedViewResult}).
430
+ * @throws If Present mode is not open, or `sheetId` is given but invalid.
431
+ *
432
+ * @examplePrompt Update all the placed views to the latest model
433
+ * @examplePrompt Refresh the views on sheet_1
434
+ * @examplePrompt Re-render the placed views after my edits
435
+ *
436
+ * # Example
437
+ * ```ts
438
+ * const { shapeIds } = await snaptrude.presentation.sheets.updatePlacedView()
439
+ * ```
440
+ */
441
+ public abstract updatePlacedView(options?: {
442
+ sheetId?: string
443
+ }): PluginApiReturn<PluginPresentationSheetsUpdatePlacedViewResult>
444
+ }
445
+
446
+ /**
447
+ * Standard paper-size presets for layout sheets — identical to the sheet
448
+ * header's size dropdown in Present mode.
449
+ */
450
+ export const PluginSheetSize = z.enum([
451
+ "ANSI_A",
452
+ "ANSI_B",
453
+ "ANSI_C",
454
+ "ANSI_D",
455
+ "ANSI_E",
456
+ "ARCH_A",
457
+ "ARCH_B",
458
+ "ARCH_C",
459
+ "ARCH_D",
460
+ "ARCH_E",
461
+ "ARCH_E1",
462
+ "ISO_A4",
463
+ "ISO_A3",
464
+ "ISO_A2",
465
+ "ISO_A1",
466
+ "ISO_A0",
467
+ ])
468
+ export type PluginSheetSize = z.infer<typeof PluginSheetSize>
469
+
470
+ /** Sheet orientation. */
471
+ export const PluginSheetOrientation = z.enum(["landscape", "portrait"])
472
+ export type PluginSheetOrientation = z.infer<typeof PluginSheetOrientation>
473
+
474
+ /**
475
+ * Canonical sheet margin presets — unit-agnostic values matching the sheet
476
+ * header's margin dropdown: `0` (None), `0.25`, `0.5`, `0.75`, `1`.
477
+ * Displayed as None / 1/4″ / 1/2″ / 3/4″ / 1″ on imperial projects and
478
+ * None / 5mm / 10mm / 15mm / 20mm on metric ones.
479
+ */
480
+ export const PluginSheetMargin = z.union([
481
+ z.literal(0),
482
+ z.literal(0.25),
483
+ z.literal(0.5),
484
+ z.literal(0.75),
485
+ z.literal(1),
486
+ ])
487
+ export type PluginSheetMargin = z.infer<typeof PluginSheetMargin>
488
+
489
+ /**
490
+ * A layout sheet in the presentation.
491
+ *
492
+ * | Property | Type | Description |
493
+ * |---|---|---|
494
+ * | `id` | `string` | Unique sheet id |
495
+ * | `name` | `string` | Display name |
496
+ * | `size` | {@linkcode PluginSheetSize}` \| null` | Paper preset (`null` for a legacy sheet without one) |
497
+ * | `orientation` | {@linkcode PluginSheetOrientation}` \| null` | Orientation (`null` for a legacy sheet) |
498
+ * | `margin` | {@linkcode PluginSheetMargin}` \| null` | Margin preset (`null` when absent/unrecognized) |
499
+ */
500
+ export const PluginPresentationSheet = z.object({
501
+ id: z.string(),
502
+ name: z.string(),
503
+ size: PluginSheetSize.nullable(),
504
+ orientation: PluginSheetOrientation.nullable(),
505
+ margin: PluginSheetMargin.nullable(),
506
+ })
507
+ export type PluginPresentationSheet = z.infer<typeof PluginPresentationSheet>
508
+
509
+ /**
510
+ * A position on a sheet/canvas (sheet coordinates).
511
+ *
512
+ * | Property | Type | Description |
513
+ * |---|---|---|
514
+ * | `x` | `number` | X coordinate |
515
+ * | `y` | `number` | Y coordinate |
516
+ */
517
+ export const PluginSheetPosition = z.object({
518
+ x: z.number(),
519
+ y: z.number(),
520
+ })
521
+ export type PluginSheetPosition = z.infer<typeof PluginSheetPosition>
522
+
523
+ /** Result of {@linkcode PluginPresentationSheetsApi.list}. */
524
+ export const PluginPresentationSheetsListResult = z.object({
525
+ sheets: z.array(PluginPresentationSheet),
526
+ })
527
+ export type PluginPresentationSheetsListResult = z.infer<
528
+ typeof PluginPresentationSheetsListResult
529
+ >
530
+
531
+ /** Arguments for {@linkcode PluginPresentationSheetsApi.get}. */
532
+ export const PluginPresentationSheetsGetArgs = z.object({
533
+ id: z.string(),
534
+ })
535
+ export type PluginPresentationSheetsGetArgs = z.infer<
536
+ typeof PluginPresentationSheetsGetArgs
537
+ >
538
+
539
+ /** Result of {@linkcode PluginPresentationSheetsApi.get} — the sheet, or `null`. */
540
+ export const PluginPresentationSheetsGetResult =
541
+ PluginPresentationSheet.nullable()
542
+ export type PluginPresentationSheetsGetResult = z.infer<
543
+ typeof PluginPresentationSheetsGetResult
544
+ >
545
+
546
+ /** Arguments for {@linkcode PluginPresentationSheetsApi.create}. */
547
+ export const PluginPresentationSheetsCreateArgs = z.object({
548
+ name: z.string().optional(),
549
+ size: PluginSheetSize.optional(),
550
+ orientation: PluginSheetOrientation.optional(),
551
+ })
552
+ export type PluginPresentationSheetsCreateArgs = z.infer<
553
+ typeof PluginPresentationSheetsCreateArgs
554
+ >
555
+
556
+ /** Arguments for {@linkcode PluginPresentationSheetsApi.setSize}. */
557
+ export const PluginPresentationSheetsSetSizeArgs = z.object({
558
+ sheetId: z.string(),
559
+ size: PluginSheetSize,
560
+ orientation: PluginSheetOrientation.optional(),
561
+ })
562
+ export type PluginPresentationSheetsSetSizeArgs = z.infer<
563
+ typeof PluginPresentationSheetsSetSizeArgs
564
+ >
565
+
566
+ /** Arguments for {@linkcode PluginPresentationSheetsApi.setMargin}. */
567
+ export const PluginPresentationSheetsSetMarginArgs = z.object({
568
+ sheetId: z.string(),
569
+ margin: PluginSheetMargin,
570
+ })
571
+ export type PluginPresentationSheetsSetMarginArgs = z.infer<
572
+ typeof PluginPresentationSheetsSetMarginArgs
573
+ >
574
+
575
+ /**
576
+ * Arguments for {@linkcode PluginPresentationSheetsApi.place}.
577
+ *
578
+ * | Property | Type | Description |
579
+ * |---|---|---|
580
+ * | `sheetId` | `string` | The sheet to place onto |
581
+ * | `viewId` | `string` | The saved view to place |
582
+ * | `position` | {@linkcode PluginSheetPosition}` \| undefined` | Where to place it (when omitted, the sheet centre or the nearest free spot) |
583
+ * | `scale` | `number \| undefined` | Standard scale value for the project's unit system (2D/site-plan views only; when omitted, the largest standard scale that fits inside the target sheet's margin, never larger than the normal view drop's) |
584
+ */
585
+ export const PluginPresentationSheetsPlaceArgs = z.object({
586
+ sheetId: z.string(),
587
+ viewId: z.string(),
588
+ position: PluginSheetPosition.optional(),
589
+ scale: PluginStandardDrawingScale.optional(),
590
+ })
591
+ export type PluginPresentationSheetsPlaceArgs = z.infer<
592
+ typeof PluginPresentationSheetsPlaceArgs
593
+ >
594
+
595
+ /**
596
+ * Arguments for {@linkcode PluginPresentationSheetsApi.placeDrawing}.
597
+ *
598
+ * | Property | Type | Description |
599
+ * |---|---|---|
600
+ * | `sheetId` | `string` | The destination sheet |
601
+ * | `drawingId` | `string` | The existing drawing to move |
602
+ * | `position` | {@linkcode PluginSheetPosition}` \| undefined` | Sheet-local position (when omitted, the sheet centre or the nearest free spot) |
603
+ * | `fit` | `boolean \| undefined` | `true` (default) scales a drawing that does not fit down to fit; `false` keeps its scale and rejects a drawing that does not fit |
604
+ */
605
+ export const PluginPresentationSheetsPlaceDrawingArgs = z.object({
606
+ sheetId: z.string().min(1),
607
+ drawingId: z.string().min(1),
608
+ position: PluginSheetPosition.optional(),
609
+ fit: z.boolean().optional(),
610
+ })
611
+ export type PluginPresentationSheetsPlaceDrawingArgs = z.infer<
612
+ typeof PluginPresentationSheetsPlaceDrawingArgs
613
+ >
614
+
615
+ /**
616
+ * Result of {@linkcode PluginPresentationSheetsApi.place}. The host returns
617
+ * `scale` and `rescaled` (and `overlaps`, `overflows`); they are optional only
618
+ * because hosts that predate the fit report `shapeId` alone.
619
+ *
620
+ * | Property | Type | Description |
621
+ * |---|---|---|
622
+ * | `shapeId` | `string` | Id of the created canvas shape |
623
+ * | `scale` | `number \| null \| undefined` | Architectural scale denominator the view has on the sheet (`null` for a 3D view) |
624
+ * | `rescaled` | `boolean \| undefined` | Whether the fit changed the view's size from the normal view drop's |
625
+ * | `overlaps` | `boolean \| undefined` | Whether the placed drawing overlaps another drawing on the sheet (only drawings count, not text, images or other shapes) |
626
+ * | `overflows` | `boolean \| undefined` | `true` when the drawing, title block included, does not fit inside the sheet's margin at the explicit `scale` passed (the scale is kept); absent otherwise |
627
+ */
628
+ export const PluginPresentationSheetsPlaceResult = z.object({
629
+ shapeId: z.string(),
630
+ scale: z.number().finite().nullable().optional(),
631
+ rescaled: z.boolean().optional(),
632
+ overlaps: z.boolean().optional(),
633
+ overflows: z.boolean().optional(),
634
+ })
635
+ export type PluginPresentationSheetsPlaceResult = z.infer<
636
+ typeof PluginPresentationSheetsPlaceResult
637
+ >
638
+
639
+ /**
640
+ * Result of {@linkcode PluginPresentationSheetsApi.placeDrawing}.
641
+ *
642
+ * | Property | Type | Description |
643
+ * |---|---|---|
644
+ * | `shapeId` | `string` | Id of the moved drawing (the drawing id, unchanged) |
645
+ * | `scale` | `number \| null` | Architectural scale denominator the drawing has on the sheet (`null` for a 3D drawing) |
646
+ * | `rescaled` | `boolean` | Whether this call changed the drawing's size to fit the sheet |
647
+ * | `overlaps` | `boolean \| undefined` | Whether the drawing overlaps another drawing on the sheet (only drawings count, not text, images or other shapes) |
648
+ */
649
+ export const PluginPresentationSheetsPlaceDrawingResult =
650
+ PluginPresentationSheetsPlaceResult.omit({ overflows: true }).extend({
651
+ scale: z.number().finite().nullable(),
652
+ rescaled: z.boolean(),
653
+ })
654
+ export type PluginPresentationSheetsPlaceDrawingResult = z.infer<
655
+ typeof PluginPresentationSheetsPlaceDrawingResult
656
+ >
657
+
658
+ /**
659
+ * Arguments for {@linkcode PluginPresentationSheetsApi.rename}.
660
+ *
661
+ * | Property | Type | Description |
662
+ * |---|---|---|
663
+ * | `sheetId` | `string` | The sheet to rename |
664
+ * | `name` | `string` | New display name (non-empty after trimming) |
665
+ */
666
+ export const PluginPresentationSheetsRenameArgs = z.object({
667
+ sheetId: z.string(),
668
+ name: z.string().trim().min(1),
669
+ })
670
+ export type PluginPresentationSheetsRenameArgs = z.infer<
671
+ typeof PluginPresentationSheetsRenameArgs
672
+ >
673
+
674
+ /** Arguments for {@linkcode PluginPresentationSheetsApi.delete}. */
675
+ export const PluginPresentationSheetsDeleteArgs = z.object({
676
+ sheetId: z.string(),
677
+ })
678
+ export type PluginPresentationSheetsDeleteArgs = z.infer<
679
+ typeof PluginPresentationSheetsDeleteArgs
680
+ >
681
+
682
+ /**
683
+ * Result of {@linkcode PluginPresentationSheetsApi.delete}.
684
+ *
685
+ * | Property | Type | Description |
686
+ * |---|---|---|
687
+ * | `id` | `string` | Id of the deleted sheet |
688
+ */
689
+ export const PluginPresentationSheetsDeleteResult = z.object({
690
+ id: z.string(),
691
+ })
692
+ export type PluginPresentationSheetsDeleteResult = z.infer<
693
+ typeof PluginPresentationSheetsDeleteResult
694
+ >
695
+
696
+ /**
697
+ * Arguments for {@linkcode PluginPresentationSheetsApi.reorder}.
698
+ *
699
+ * | Property | Type | Description |
700
+ * |---|---|---|
701
+ * | `sheetId` | `string` | The sheet to move |
702
+ * | `index` | `number` | Zero-based target position (clamped to range) |
703
+ */
704
+ export const PluginPresentationSheetsReorderArgs = z.object({
705
+ sheetId: z.string(),
706
+ index: z.number().int().min(0),
707
+ })
708
+ export type PluginPresentationSheetsReorderArgs = z.infer<
709
+ typeof PluginPresentationSheetsReorderArgs
710
+ >
711
+
712
+ /** Arguments for {@linkcode PluginPresentationSheetsApi.setActive}. */
713
+ export const PluginPresentationSheetsSetActiveArgs = z.object({
714
+ sheetId: z.string(),
715
+ })
716
+ export type PluginPresentationSheetsSetActiveArgs = z.infer<
717
+ typeof PluginPresentationSheetsSetActiveArgs
718
+ >
719
+
720
+ /**
721
+ * Arguments for {@linkcode PluginPresentationSheetsApi.updatePlacedView}.
722
+ *
723
+ * | Property | Type | Description |
724
+ * |---|---|---|
725
+ * | `sheetId` | `string`? | Restrict the refresh to one sheet's placed views |
726
+ */
727
+ export const PluginPresentationSheetsUpdatePlacedViewArgs = z.object({
728
+ sheetId: z.string().optional(),
729
+ })
730
+ export type PluginPresentationSheetsUpdatePlacedViewArgs = z.infer<
731
+ typeof PluginPresentationSheetsUpdatePlacedViewArgs
732
+ >
733
+
734
+ /**
735
+ * Result of {@linkcode PluginPresentationSheetsApi.updatePlacedView}.
736
+ *
737
+ * | Property | Type | Description |
738
+ * |---|---|---|
739
+ * | `shapeIds` | `string[]` | Ids of the placed view shapes submitted for refresh |
740
+ */
741
+ export const PluginPresentationSheetsUpdatePlacedViewResult = z.object({
742
+ shapeIds: z.array(z.string()),
743
+ })
744
+ export type PluginPresentationSheetsUpdatePlacedViewResult = z.infer<
745
+ typeof PluginPresentationSheetsUpdatePlacedViewResult
746
+ >