@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.
Files changed (193) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/api-manifest.full.json +7703 -0
  3. package/api-manifest.json +2946 -259
  4. package/dist/api/analysis/daylight.d.ts +603 -0
  5. package/dist/api/analysis/daylight.d.ts.map +1 -0
  6. package/dist/api/analysis/heatmaps.d.ts +438 -14
  7. package/dist/api/analysis/heatmaps.d.ts.map +1 -1
  8. package/dist/api/analysis/index.d.ts +15 -0
  9. package/dist/api/analysis/index.d.ts.map +1 -1
  10. package/dist/api/analysis/solar.d.ts +249 -0
  11. package/dist/api/analysis/solar.d.ts.map +1 -0
  12. package/dist/api/analysis/weather.d.ts +193 -0
  13. package/dist/api/analysis/weather.d.ts.map +1 -0
  14. package/dist/api/core/camera/index.d.ts +245 -0
  15. package/dist/api/core/camera/index.d.ts.map +1 -0
  16. package/dist/api/core/comment/index.d.ts +105 -2
  17. package/dist/api/core/comment/index.d.ts.map +1 -1
  18. package/dist/api/core/geom/create/index.d.ts +331 -14
  19. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  20. package/dist/api/core/geom/delete/index.d.ts +8 -2
  21. package/dist/api/core/geom/delete/index.d.ts.map +1 -1
  22. package/dist/api/core/geom/query/arc.d.ts +5 -5
  23. package/dist/api/core/geom/query/brep.d.ts +18 -18
  24. package/dist/api/core/geom/query/circle.d.ts +18 -18
  25. package/dist/api/core/geom/query/contour.d.ts +20 -20
  26. package/dist/api/core/geom/query/curve.d.ts +49 -49
  27. package/dist/api/core/geom/query/edge.d.ts +5 -5
  28. package/dist/api/core/geom/query/face.d.ts +16 -16
  29. package/dist/api/core/geom/query/halfedge.d.ts +8 -8
  30. package/dist/api/core/geom/query/profile.d.ts +19 -19
  31. package/dist/api/core/geom/query/vertex.d.ts +8 -8
  32. package/dist/api/core/geom/update/contour.d.ts +14 -14
  33. package/dist/api/core/geom/update/curve.d.ts +7 -7
  34. package/dist/api/core/geom/update/profile.d.ts +16 -16
  35. package/dist/api/core/handles/index.d.ts +210 -0
  36. package/dist/api/core/handles/index.d.ts.map +1 -0
  37. package/dist/api/core/index.d.ts +24 -0
  38. package/dist/api/core/index.d.ts.map +1 -1
  39. package/dist/api/core/io/export/index.d.ts +134 -0
  40. package/dist/api/core/io/export/index.d.ts.map +1 -0
  41. package/dist/api/core/io/import/index.d.ts +62 -1
  42. package/dist/api/core/io/import/index.d.ts.map +1 -1
  43. package/dist/api/core/io/index.d.ts +5 -0
  44. package/dist/api/core/io/index.d.ts.map +1 -1
  45. package/dist/api/core/layers.d.ts +7 -7
  46. package/dist/api/core/mode/index.d.ts +99 -0
  47. package/dist/api/core/mode/index.d.ts.map +1 -0
  48. package/dist/api/core/proposals/index.d.ts +65 -9
  49. package/dist/api/core/proposals/index.d.ts.map +1 -1
  50. package/dist/api/core/storeys/index.d.ts +251 -0
  51. package/dist/api/core/storeys/index.d.ts.map +1 -0
  52. package/dist/api/core/tags.d.ts +24 -0
  53. package/dist/api/core/tags.d.ts.map +1 -1
  54. package/dist/api/core/user.d.ts +44 -0
  55. package/dist/api/core/user.d.ts.map +1 -0
  56. package/dist/api/core/zoom/index.d.ts +4 -0
  57. package/dist/api/core/zoom/index.d.ts.map +1 -1
  58. package/dist/api/design/boolean/index.d.ts +4 -4
  59. package/dist/api/design/create/index.d.ts +253 -47
  60. package/dist/api/design/create/index.d.ts.map +1 -1
  61. package/dist/api/design/delete/index.d.ts +3 -0
  62. package/dist/api/design/delete/index.d.ts.map +1 -1
  63. package/dist/api/design/doors/index.d.ts +36 -0
  64. package/dist/api/design/doors/index.d.ts.map +1 -1
  65. package/dist/api/design/edit/index.d.ts +1 -1
  66. package/dist/api/design/erase/index.d.ts +2 -2
  67. package/dist/api/design/furniture/index.d.ts +114 -3
  68. package/dist/api/design/furniture/index.d.ts.map +1 -1
  69. package/dist/api/design/index.d.ts +10 -0
  70. package/dist/api/design/index.d.ts.map +1 -1
  71. package/dist/api/design/materials/index.d.ts +111 -14
  72. package/dist/api/design/materials/index.d.ts.map +1 -1
  73. package/dist/api/design/query/geometry/index.d.ts +112 -0
  74. package/dist/api/design/query/geometry/index.d.ts.map +1 -1
  75. package/dist/api/design/query/index.d.ts +35 -1
  76. package/dist/api/design/query/index.d.ts.map +1 -1
  77. package/dist/api/design/query/referenceLines.d.ts +45 -0
  78. package/dist/api/design/query/referenceLines.d.ts.map +1 -0
  79. package/dist/api/design/query/spaces.d.ts +178 -5
  80. package/dist/api/design/query/spaces.d.ts.map +1 -1
  81. package/dist/api/design/transform/index.d.ts +95 -14
  82. package/dist/api/design/transform/index.d.ts.map +1 -1
  83. package/dist/api/design/types/index.d.ts +181 -0
  84. package/dist/api/design/types/index.d.ts.map +1 -0
  85. package/dist/api/design/update/index.d.ts +385 -2
  86. package/dist/api/design/update/index.d.ts.map +1 -1
  87. package/dist/api/design/visibility.d.ts +98 -0
  88. package/dist/api/design/visibility.d.ts.map +1 -0
  89. package/dist/api/entity/buildableEnvelope.d.ts +4 -0
  90. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
  91. package/dist/api/entity/referenceLine.d.ts +10 -2
  92. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  93. package/dist/api/entity/space.d.ts +19 -19
  94. package/dist/api/entity/story.d.ts +148 -15
  95. package/dist/api/entity/story.d.ts.map +1 -1
  96. package/dist/api/index.d.ts +5 -0
  97. package/dist/api/index.d.ts.map +1 -1
  98. package/dist/api/presentation/annotate.d.ts +448 -0
  99. package/dist/api/presentation/annotate.d.ts.map +1 -0
  100. package/dist/api/presentation/diagrams.d.ts +49 -8
  101. package/dist/api/presentation/diagrams.d.ts.map +1 -1
  102. package/dist/api/presentation/export.d.ts +108 -0
  103. package/dist/api/presentation/export.d.ts.map +1 -0
  104. package/dist/api/presentation/import.d.ts +6 -0
  105. package/dist/api/presentation/import.d.ts.map +1 -1
  106. package/dist/api/presentation/index.d.ts +47 -0
  107. package/dist/api/presentation/index.d.ts.map +1 -1
  108. package/dist/api/presentation/placedViews.d.ts +370 -0
  109. package/dist/api/presentation/placedViews.d.ts.map +1 -0
  110. package/dist/api/presentation/shapes.d.ts +481 -0
  111. package/dist/api/presentation/shapes.d.ts.map +1 -0
  112. package/dist/api/presentation/sheets.d.ts +410 -13
  113. package/dist/api/presentation/sheets.d.ts.map +1 -1
  114. package/dist/api/presentation/views.d.ts +165 -10
  115. package/dist/api/presentation/views.d.ts.map +1 -1
  116. package/dist/api/program/areas.d.ts +63 -3
  117. package/dist/api/program/areas.d.ts.map +1 -1
  118. package/dist/api/program/cores.d.ts +3 -99
  119. package/dist/api/program/cores.d.ts.map +1 -1
  120. package/dist/api/program/index.d.ts +2 -2
  121. package/dist/api/program/index.d.ts.map +1 -1
  122. package/dist/api/program/layout.d.ts +172 -12
  123. package/dist/api/program/layout.d.ts.map +1 -1
  124. package/dist/api/program/site.d.ts +105 -8
  125. package/dist/api/program/site.d.ts.map +1 -1
  126. package/dist/api/program/spreadsheet.d.ts +365 -41
  127. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  128. package/dist/api/workspace/index.d.ts +460 -0
  129. package/dist/api/workspace/index.d.ts.map +1 -0
  130. package/dist/handles.d.ts +64 -25
  131. package/dist/handles.d.ts.map +1 -1
  132. package/dist/index.cjs +3210 -1671
  133. package/dist/index.cjs.map +1 -1
  134. package/dist/index.js +3008 -1666
  135. package/dist/index.js.map +1 -1
  136. package/package.json +3 -2
  137. package/scripts/generate-manifest.mjs +45 -0
  138. package/src/api/analysis/daylight.ts +470 -0
  139. package/src/api/analysis/heatmaps.ts +444 -17
  140. package/src/api/analysis/index.ts +15 -0
  141. package/src/api/analysis/solar.ts +237 -0
  142. package/src/api/analysis/weather.ts +179 -0
  143. package/src/api/core/camera/index.ts +251 -0
  144. package/src/api/core/comment/index.ts +120 -2
  145. package/src/api/core/geom/create/index.ts +344 -1
  146. package/src/api/core/geom/delete/index.ts +6 -0
  147. package/src/api/core/handles/index.ts +233 -0
  148. package/src/api/core/index.ts +24 -0
  149. package/src/api/core/io/export/index.ts +126 -0
  150. package/src/api/core/io/import/index.ts +64 -0
  151. package/src/api/core/io/index.ts +5 -0
  152. package/src/api/core/mode/index.ts +96 -0
  153. package/src/api/core/proposals/index.ts +71 -11
  154. package/src/api/core/storeys/index.ts +279 -0
  155. package/src/api/core/tags.ts +27 -0
  156. package/src/api/core/user.ts +46 -0
  157. package/src/api/core/zoom/index.ts +4 -0
  158. package/src/api/design/create/index.ts +303 -36
  159. package/src/api/design/delete/index.ts +3 -0
  160. package/src/api/design/doors/index.ts +40 -0
  161. package/src/api/design/furniture/index.ts +127 -3
  162. package/src/api/design/index.ts +10 -0
  163. package/src/api/design/materials/index.ts +157 -30
  164. package/src/api/design/query/geometry/index.ts +125 -3
  165. package/src/api/design/query/index.ts +37 -7
  166. package/src/api/design/query/referenceLines.ts +52 -0
  167. package/src/api/design/query/spaces.ts +143 -0
  168. package/src/api/design/transform/index.ts +101 -12
  169. package/src/api/design/types/index.ts +156 -0
  170. package/src/api/design/update/index.ts +467 -6
  171. package/src/api/design/visibility.ts +109 -0
  172. package/src/api/entity/buildableEnvelope.ts +4 -0
  173. package/src/api/entity/referenceLine.ts +8 -0
  174. package/src/api/entity/story.ts +161 -15
  175. package/src/api/index.ts +5 -0
  176. package/src/api/presentation/annotate.ts +360 -0
  177. package/src/api/presentation/diagrams.ts +53 -8
  178. package/src/api/presentation/export.ts +108 -0
  179. package/src/api/presentation/import.ts +6 -0
  180. package/src/api/presentation/index.ts +55 -0
  181. package/src/api/presentation/placedViews.ts +363 -0
  182. package/src/api/presentation/shapes.ts +274 -0
  183. package/src/api/presentation/sheets.ts +346 -13
  184. package/src/api/presentation/views.ts +164 -12
  185. package/src/api/program/areas.ts +57 -6
  186. package/src/api/program/cores.ts +3 -91
  187. package/src/api/program/index.ts +2 -2
  188. package/src/api/program/layout.ts +182 -12
  189. package/src/api/program/site.ts +106 -8
  190. package/src/api/program/spreadsheet.ts +376 -35
  191. package/src/api/workspace/index.ts +516 -0
  192. package/src/handles.ts +77 -13
  193. package/tsconfig.json +7 -2
@@ -8,8 +8,11 @@ import { PluginApiReturn } from "../../types"
8
8
  * These methods require **Present mode to be open** (the documentation editor) —
9
9
  * reads return `[]`/`null` and writes throw when it is not.
10
10
  *
11
- * `list`/`get` are reads; `create` adds a sheet and `place` drops a saved view
12
- * onto a sheet (returning the id of the created canvas shape).
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.
13
16
  *
14
17
  * Accessed via `snaptrude.presentation.sheets`.
15
18
  */
@@ -56,56 +59,278 @@ export abstract class PluginPresentationSheetsApi {
56
59
  /**
57
60
  * Create a new layout sheet.
58
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
+ *
59
68
  * Requires Present mode to be open.
60
69
  *
61
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).
62
74
  * @returns The newly created {@linkcode PluginPresentationSheet}.
63
75
  * @throws If Present mode is not open.
64
76
  *
65
77
  * @examplePrompt Create a new sheet called Cover
66
- * @examplePrompt Add a layout sheet
67
- * @examplePrompt Make a new presentation sheet named Floor Plans
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
68
81
  *
69
82
  * # Example
70
83
  * ```ts
71
- * const sheet = await snaptrude.presentation.sheets.create("Cover")
84
+ * const sheet = await snaptrude.presentation.sheets.create("Cover", {
85
+ * size: "ISO_A3",
86
+ * orientation: "landscape",
87
+ * })
72
88
  * ```
73
89
  */
74
90
  public abstract create(
75
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,
76
127
  ): PluginApiReturn<PluginPresentationSheet>
77
128
 
78
129
  /**
79
130
  * Place a saved view onto a sheet.
80
131
  *
81
- * Drops the given view onto the sheet at an optional position and returns the
82
- * id of the created canvas shape. Requires Present mode to be open.
132
+ * Drops the given view onto the sheet through the **native view drop** the
133
+ * placed shape is a live linked view (the same shape the Present views panel's
134
+ * drag-drop creates), re-rendered from the current model, so
135
+ * {@linkcode PluginPresentationSheetsApi.updatePlacedView} refreshes it later.
136
+ * 2D and site-plan views are placed at an architectural scale: the closest
137
+ * standard scale by default (the native auto-fit), or the explicit `scale`
138
+ * when given — one of the standard values the placed view's Scale dropdown
139
+ * offers for the project's unit system (metric `10, 20, 50, 100, 150, 200,
140
+ * 250, 500, 1000`; imperial e.g. `48` for 1/4″ = 1′, `96` for 1/8″ = 1′,
141
+ * `120` for 1″ = 10′). 3D views have no scale — passing `scale` for one
142
+ * throws. Requires Present mode to be open.
83
143
  *
84
144
  * @param sheetId - The id of the sheet to place onto.
85
145
  * @param viewId - The id of the saved view to place.
86
146
  * @param options - Optional `position` ({@linkcode PluginSheetPosition}) —
87
- * where to place it (a default is used when omitted).
147
+ * where to place it (sheet centre when omitted) — and `scale` — a standard
148
+ * scale value for the project's unit system (2D/site-plan views only;
149
+ * auto-fit when omitted).
88
150
  * @returns A {@linkcode PluginPresentationSheetsPlaceResult} with the created
89
151
  * `shapeId`.
90
- * @throws If Present mode is not open, or the sheet/view id is invalid.
152
+ * @throws If Present mode is not open, the sheet/view id is invalid, `scale`
153
+ * is not a standard value for the project's unit system, or `scale` is
154
+ * passed for a 3D view.
91
155
  *
92
156
  * @examplePrompt Place the floor plan on Sheet 1
93
157
  * @examplePrompt Add this 3D view to the cover sheet
94
158
  * @examplePrompt Drop the site plan onto the layout sheet at 100, 200
95
- * @examplePrompt Put the Ground Floor view on sheet_1
159
+ * @examplePrompt Put the Ground Floor view on sheet_1 at 1:100 scale
160
+ * @examplePrompt Place the plan on the cover sheet at quarter-inch scale
96
161
  *
97
162
  * # Example
98
163
  * ```ts
99
- * const { shapeId } = await snaptrude.presentation.sheets.place("sheet_1", "view_123")
164
+ * const { shapeId } = await snaptrude.presentation.sheets.place("sheet_1", "view_123", {
165
+ * scale: 100, // 1:100 (metric project)
166
+ * })
100
167
  * ```
101
168
  */
102
169
  public abstract place(
103
170
  sheetId: string,
104
171
  viewId: string,
105
- options?: { position?: PluginSheetPosition },
172
+ options?: { position?: PluginSheetPosition; scale?: number },
106
173
  ): PluginApiReturn<PluginPresentationSheetsPlaceResult>
174
+
175
+ /**
176
+ * Rename a layout sheet.
177
+ *
178
+ * Sets the sheet's display name — the same label the sheets panel shows and
179
+ * that `list`/`get` read back. Requires Present mode to be open.
180
+ *
181
+ * @param sheetId - The id of the sheet to rename.
182
+ * @param name - The new display name (non-empty after trimming).
183
+ * @returns The updated {@linkcode PluginPresentationSheet}.
184
+ * @throws If Present mode is not open, or the sheet id is invalid.
185
+ *
186
+ * @examplePrompt Rename sheet_1 to Cover
187
+ * @examplePrompt Call the first sheet Ground Floor
188
+ * @examplePrompt Change this sheet's name to Site Plan
189
+ *
190
+ * # Example
191
+ * ```ts
192
+ * const sheet = await snaptrude.presentation.sheets.rename("sheet_1", "Cover")
193
+ * ```
194
+ */
195
+ public abstract rename(
196
+ sheetId: string,
197
+ name: string,
198
+ ): PluginApiReturn<PluginPresentationSheet>
199
+
200
+ /**
201
+ * Delete a layout sheet.
202
+ *
203
+ * Removes the sheet (and its placed content) from the presentation and
204
+ * renumbers the remaining sheets. Requires Present mode to be open. Auto-diagram
205
+ * sheets cannot be deleted through the API — remove those from the Present UI.
206
+ *
207
+ * @param sheetId - The id of the sheet to delete.
208
+ * @returns The id of the deleted sheet
209
+ * (a {@linkcode PluginPresentationSheetsDeleteResult}).
210
+ * @throws If Present mode is not open, the sheet id is invalid, or the sheet is
211
+ * an auto-diagram sheet.
212
+ *
213
+ * @examplePrompt Delete sheet_2
214
+ * @examplePrompt Remove the Cover sheet
215
+ * @examplePrompt Get rid of the last layout sheet
216
+ *
217
+ * # Example
218
+ * ```ts
219
+ * const { id } = await snaptrude.presentation.sheets.delete("sheet_2")
220
+ * ```
221
+ */
222
+ public abstract delete(
223
+ sheetId: string,
224
+ ): PluginApiReturn<PluginPresentationSheetsDeleteResult>
225
+
226
+ /**
227
+ * Move a sheet to a new position in the sheet order.
228
+ *
229
+ * Reorders the sheet to the given zero-based `index` (as the sheets panel does
230
+ * when a sheet is dragged) and renumbers the rest. `index` is clamped to the
231
+ * valid range. Requires Present mode to be open.
232
+ *
233
+ * @param sheetId - The id of the sheet to move.
234
+ * @param index - Zero-based target position in the sheet order.
235
+ * @returns The sheets in their new order
236
+ * (a {@linkcode PluginPresentationSheetsListResult}).
237
+ * @throws If Present mode is not open, or the sheet id is invalid.
238
+ *
239
+ * @examplePrompt Move sheet_3 to the front
240
+ * @examplePrompt Make the Cover sheet the first sheet
241
+ * @examplePrompt Reorder this sheet to position 2
242
+ *
243
+ * # Example
244
+ * ```ts
245
+ * const { sheets } = await snaptrude.presentation.sheets.reorder("sheet_3", 0)
246
+ * ```
247
+ */
248
+ public abstract reorder(
249
+ sheetId: string,
250
+ index: number,
251
+ ): PluginApiReturn<PluginPresentationSheetsListResult>
252
+
253
+ /**
254
+ * Make a sheet the active sheet.
255
+ *
256
+ * Selects the sheet in the sheets panel and navigates the Present canvas to it
257
+ * (the same as clicking it in the panel). Requires Present mode to be open.
258
+ *
259
+ * @param sheetId - The id of the sheet to activate.
260
+ * @returns The now-active {@linkcode PluginPresentationSheet}.
261
+ * @throws If Present mode is not open, or the sheet id is invalid.
262
+ *
263
+ * @examplePrompt Go to sheet_1
264
+ * @examplePrompt Open the Cover sheet
265
+ * @examplePrompt Switch to the Site Plan sheet
266
+ *
267
+ * # Example
268
+ * ```ts
269
+ * await snaptrude.presentation.sheets.setActive("sheet_1")
270
+ * ```
271
+ */
272
+ public abstract setActive(
273
+ sheetId: string,
274
+ ): PluginApiReturn<PluginPresentationSheet>
275
+
276
+ /**
277
+ * Refresh placed views to the current model state.
278
+ *
279
+ * Re-renders the presentation's placed **views** — the live linked view shapes —
280
+ * from the current model (the "Update views" action). Views placed with
281
+ * {@linkcode PluginPresentationSheetsApi.place} are live view shapes too, so
282
+ * they refresh along with panel-dropped ones. Pass `sheetId` to refresh only
283
+ * the views on that sheet, or omit it to refresh every placed view. Requires
284
+ * Present mode to be open.
285
+ *
286
+ * @param options - Optional `sheetId` — restrict the refresh to one sheet's
287
+ * placed views (all placed views when omitted).
288
+ * @returns The ids of the placed view shapes submitted for refresh
289
+ * (a {@linkcode PluginPresentationSheetsUpdatePlacedViewResult}).
290
+ * @throws If Present mode is not open, or `sheetId` is given but invalid.
291
+ *
292
+ * @examplePrompt Update all the placed views to the latest model
293
+ * @examplePrompt Refresh the views on sheet_1
294
+ * @examplePrompt Re-render the placed views after my edits
295
+ *
296
+ * # Example
297
+ * ```ts
298
+ * const { shapeIds } = await snaptrude.presentation.sheets.updatePlacedView()
299
+ * ```
300
+ */
301
+ public abstract updatePlacedView(options?: {
302
+ sheetId?: string
303
+ }): PluginApiReturn<PluginPresentationSheetsUpdatePlacedViewResult>
107
304
  }
108
305
 
306
+ /**
307
+ * Standard paper-size presets for layout sheets — identical to the sheet
308
+ * header's size dropdown in Present mode.
309
+ */
310
+ export const PluginSheetSize = z.enum([
311
+ "ANSI_A",
312
+ "ANSI_B",
313
+ "ANSI_C",
314
+ "ANSI_D",
315
+ "ANSI_E",
316
+ "ARCH_A",
317
+ "ARCH_B",
318
+ "ARCH_C",
319
+ "ARCH_D",
320
+ "ARCH_E",
321
+ "ARCH_E1",
322
+ "ISO_A4",
323
+ "ISO_A3",
324
+ "ISO_A2",
325
+ "ISO_A1",
326
+ "ISO_A0",
327
+ ])
328
+ export type PluginSheetSize = z.infer<typeof PluginSheetSize>
329
+
330
+ /** Sheet orientation. */
331
+ export const PluginSheetOrientation = z.enum(["landscape", "portrait"])
332
+ export type PluginSheetOrientation = z.infer<typeof PluginSheetOrientation>
333
+
109
334
  /**
110
335
  * A layout sheet in the presentation.
111
336
  *
@@ -113,10 +338,14 @@ export abstract class PluginPresentationSheetsApi {
113
338
  * |---|---|---|
114
339
  * | `id` | `string` | Unique sheet id |
115
340
  * | `name` | `string` | Display name |
341
+ * | `size` | {@linkcode PluginSheetSize}` \| null` | Paper preset (`null` for a legacy sheet without one) |
342
+ * | `orientation` | {@linkcode PluginSheetOrientation}` \| null` | Orientation (`null` for a legacy sheet) |
116
343
  */
117
344
  export const PluginPresentationSheet = z.object({
118
345
  id: z.string(),
119
346
  name: z.string(),
347
+ size: PluginSheetSize.nullable(),
348
+ orientation: PluginSheetOrientation.nullable(),
120
349
  })
121
350
  export type PluginPresentationSheet = z.infer<typeof PluginPresentationSheet>
122
351
 
@@ -160,11 +389,23 @@ export type PluginPresentationSheetsGetResult = z.infer<
160
389
  /** Arguments for {@linkcode PluginPresentationSheetsApi.create}. */
161
390
  export const PluginPresentationSheetsCreateArgs = z.object({
162
391
  name: z.string().optional(),
392
+ size: PluginSheetSize.optional(),
393
+ orientation: PluginSheetOrientation.optional(),
163
394
  })
164
395
  export type PluginPresentationSheetsCreateArgs = z.infer<
165
396
  typeof PluginPresentationSheetsCreateArgs
166
397
  >
167
398
 
399
+ /** Arguments for {@linkcode PluginPresentationSheetsApi.setSize}. */
400
+ export const PluginPresentationSheetsSetSizeArgs = z.object({
401
+ sheetId: z.string(),
402
+ size: PluginSheetSize,
403
+ orientation: PluginSheetOrientation.optional(),
404
+ })
405
+ export type PluginPresentationSheetsSetSizeArgs = z.infer<
406
+ typeof PluginPresentationSheetsSetSizeArgs
407
+ >
408
+
168
409
  /**
169
410
  * Arguments for {@linkcode PluginPresentationSheetsApi.place}.
170
411
  *
@@ -172,12 +413,14 @@ export type PluginPresentationSheetsCreateArgs = z.infer<
172
413
  * |---|---|---|
173
414
  * | `sheetId` | `string` | The sheet to place onto |
174
415
  * | `viewId` | `string` | The saved view to place |
175
- * | `position` | {@linkcode PluginSheetPosition}` \| undefined` | Where to place it (a default is used when omitted) |
416
+ * | `position` | {@linkcode PluginSheetPosition}` \| undefined` | Where to place it (sheet centre when omitted) |
417
+ * | `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) |
176
418
  */
177
419
  export const PluginPresentationSheetsPlaceArgs = z.object({
178
420
  sheetId: z.string(),
179
421
  viewId: z.string(),
180
422
  position: PluginSheetPosition.optional(),
423
+ scale: z.number().positive().optional(),
181
424
  })
182
425
  export type PluginPresentationSheetsPlaceArgs = z.infer<
183
426
  typeof PluginPresentationSheetsPlaceArgs
@@ -196,3 +439,93 @@ export const PluginPresentationSheetsPlaceResult = z.object({
196
439
  export type PluginPresentationSheetsPlaceResult = z.infer<
197
440
  typeof PluginPresentationSheetsPlaceResult
198
441
  >
442
+
443
+ /**
444
+ * Arguments for {@linkcode PluginPresentationSheetsApi.rename}.
445
+ *
446
+ * | Property | Type | Description |
447
+ * |---|---|---|
448
+ * | `sheetId` | `string` | The sheet to rename |
449
+ * | `name` | `string` | New display name (non-empty after trimming) |
450
+ */
451
+ export const PluginPresentationSheetsRenameArgs = z.object({
452
+ sheetId: z.string(),
453
+ name: z.string().trim().min(1),
454
+ })
455
+ export type PluginPresentationSheetsRenameArgs = z.infer<
456
+ typeof PluginPresentationSheetsRenameArgs
457
+ >
458
+
459
+ /** Arguments for {@linkcode PluginPresentationSheetsApi.delete}. */
460
+ export const PluginPresentationSheetsDeleteArgs = z.object({
461
+ sheetId: z.string(),
462
+ })
463
+ export type PluginPresentationSheetsDeleteArgs = z.infer<
464
+ typeof PluginPresentationSheetsDeleteArgs
465
+ >
466
+
467
+ /**
468
+ * Result of {@linkcode PluginPresentationSheetsApi.delete}.
469
+ *
470
+ * | Property | Type | Description |
471
+ * |---|---|---|
472
+ * | `id` | `string` | Id of the deleted sheet |
473
+ */
474
+ export const PluginPresentationSheetsDeleteResult = z.object({
475
+ id: z.string(),
476
+ })
477
+ export type PluginPresentationSheetsDeleteResult = z.infer<
478
+ typeof PluginPresentationSheetsDeleteResult
479
+ >
480
+
481
+ /**
482
+ * Arguments for {@linkcode PluginPresentationSheetsApi.reorder}.
483
+ *
484
+ * | Property | Type | Description |
485
+ * |---|---|---|
486
+ * | `sheetId` | `string` | The sheet to move |
487
+ * | `index` | `number` | Zero-based target position (clamped to range) |
488
+ */
489
+ export const PluginPresentationSheetsReorderArgs = z.object({
490
+ sheetId: z.string(),
491
+ index: z.number().int().min(0),
492
+ })
493
+ export type PluginPresentationSheetsReorderArgs = z.infer<
494
+ typeof PluginPresentationSheetsReorderArgs
495
+ >
496
+
497
+ /** Arguments for {@linkcode PluginPresentationSheetsApi.setActive}. */
498
+ export const PluginPresentationSheetsSetActiveArgs = z.object({
499
+ sheetId: z.string(),
500
+ })
501
+ export type PluginPresentationSheetsSetActiveArgs = z.infer<
502
+ typeof PluginPresentationSheetsSetActiveArgs
503
+ >
504
+
505
+ /**
506
+ * Arguments for {@linkcode PluginPresentationSheetsApi.updatePlacedView}.
507
+ *
508
+ * | Property | Type | Description |
509
+ * |---|---|---|
510
+ * | `sheetId` | `string`? | Restrict the refresh to one sheet's placed views |
511
+ */
512
+ export const PluginPresentationSheetsUpdatePlacedViewArgs = z.object({
513
+ sheetId: z.string().optional(),
514
+ })
515
+ export type PluginPresentationSheetsUpdatePlacedViewArgs = z.infer<
516
+ typeof PluginPresentationSheetsUpdatePlacedViewArgs
517
+ >
518
+
519
+ /**
520
+ * Result of {@linkcode PluginPresentationSheetsApi.updatePlacedView}.
521
+ *
522
+ * | Property | Type | Description |
523
+ * |---|---|---|
524
+ * | `shapeIds` | `string[]` | Ids of the placed view shapes submitted for refresh |
525
+ */
526
+ export const PluginPresentationSheetsUpdatePlacedViewResult = z.object({
527
+ shapeIds: z.array(z.string()),
528
+ })
529
+ export type PluginPresentationSheetsUpdatePlacedViewResult = z.infer<
530
+ typeof PluginPresentationSheetsUpdatePlacedViewResult
531
+ >