@snaptrude/plugin-core 0.0.0-dev-20260708130115 → 0.0.0-dev-20260827135706

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (261) hide show
  1. package/CHANGELOG.md +152 -1
  2. package/api-manifest.json +3620 -276
  3. package/dist/api/analysis/daylight.d.ts +603 -0
  4. package/dist/api/analysis/daylight.d.ts.map +1 -0
  5. package/dist/api/analysis/heatmaps.d.ts +658 -0
  6. package/dist/api/analysis/heatmaps.d.ts.map +1 -0
  7. package/dist/api/analysis/illuminance.d.ts +145 -0
  8. package/dist/api/analysis/illuminance.d.ts.map +1 -0
  9. package/dist/api/analysis/index.d.ts +59 -0
  10. package/dist/api/analysis/index.d.ts.map +1 -0
  11. package/dist/api/analysis/shadows.d.ts +165 -0
  12. package/dist/api/analysis/shadows.d.ts.map +1 -0
  13. package/dist/api/analysis/solar.d.ts +249 -0
  14. package/dist/api/analysis/solar.d.ts.map +1 -0
  15. package/dist/api/analysis/sunlightHours.d.ts +208 -0
  16. package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
  17. package/dist/api/analysis/sunpath.d.ts +80 -0
  18. package/dist/api/analysis/sunpath.d.ts.map +1 -0
  19. package/dist/api/analysis/weather.d.ts +193 -0
  20. package/dist/api/analysis/weather.d.ts.map +1 -0
  21. package/dist/api/core/camera/index.d.ts +261 -0
  22. package/dist/api/core/camera/index.d.ts.map +1 -0
  23. package/dist/api/core/comment/index.d.ts +105 -2
  24. package/dist/api/core/comment/index.d.ts.map +1 -1
  25. package/dist/api/core/geom/create/index.d.ts +840 -14
  26. package/dist/api/core/geom/create/index.d.ts.map +1 -1
  27. package/dist/api/core/geom/delete/index.d.ts +8 -2
  28. package/dist/api/core/geom/delete/index.d.ts.map +1 -1
  29. package/dist/api/core/geom/query/arc.d.ts +5 -5
  30. package/dist/api/core/geom/query/brep.d.ts +130 -18
  31. package/dist/api/core/geom/query/brep.d.ts.map +1 -1
  32. package/dist/api/core/geom/query/circle.d.ts +18 -18
  33. package/dist/api/core/geom/query/contour.d.ts +20 -20
  34. package/dist/api/core/geom/query/curve.d.ts +49 -49
  35. package/dist/api/core/geom/query/edge.d.ts +5 -5
  36. package/dist/api/core/geom/query/face.d.ts +16 -16
  37. package/dist/api/core/geom/query/halfedge.d.ts +8 -8
  38. package/dist/api/core/geom/query/profile.d.ts +19 -19
  39. package/dist/api/core/geom/query/vertex.d.ts +8 -8
  40. package/dist/api/core/geom/update/contour.d.ts +14 -14
  41. package/dist/api/core/geom/update/curve.d.ts +7 -7
  42. package/dist/api/core/geom/update/profile.d.ts +16 -16
  43. package/dist/api/core/handles/index.d.ts +210 -0
  44. package/dist/api/core/handles/index.d.ts.map +1 -0
  45. package/dist/api/core/index.d.ts +34 -0
  46. package/dist/api/core/index.d.ts.map +1 -1
  47. package/dist/api/core/io/export/index.d.ts +134 -0
  48. package/dist/api/core/io/export/index.d.ts.map +1 -0
  49. package/dist/api/core/io/import/index.d.ts +453 -0
  50. package/dist/api/core/io/import/index.d.ts.map +1 -0
  51. package/dist/api/core/io/index.d.ts +40 -0
  52. package/dist/api/core/io/index.d.ts.map +1 -0
  53. package/dist/api/core/io/job/index.d.ts +139 -0
  54. package/dist/api/core/io/job/index.d.ts.map +1 -0
  55. package/dist/api/core/io/query/index.d.ts +74 -0
  56. package/dist/api/core/io/query/index.d.ts.map +1 -0
  57. package/dist/api/core/io/terrain/index.d.ts +341 -0
  58. package/dist/api/core/io/terrain/index.d.ts.map +1 -0
  59. package/dist/api/core/io/underlay/index.d.ts +805 -0
  60. package/dist/api/core/io/underlay/index.d.ts.map +1 -0
  61. package/dist/api/core/layers.d.ts +7 -7
  62. package/dist/api/core/mode/index.d.ts +99 -0
  63. package/dist/api/core/mode/index.d.ts.map +1 -0
  64. package/dist/api/core/project/index.d.ts +68 -1
  65. package/dist/api/core/project/index.d.ts.map +1 -1
  66. package/dist/api/core/proposals/index.d.ts +531 -0
  67. package/dist/api/core/proposals/index.d.ts.map +1 -0
  68. package/dist/api/core/storeys/index.d.ts +265 -0
  69. package/dist/api/core/storeys/index.d.ts.map +1 -0
  70. package/dist/api/core/tags.d.ts +24 -0
  71. package/dist/api/core/tags.d.ts.map +1 -1
  72. package/dist/api/core/user.d.ts +44 -0
  73. package/dist/api/core/user.d.ts.map +1 -0
  74. package/dist/api/core/zoom/index.d.ts +4 -0
  75. package/dist/api/core/zoom/index.d.ts.map +1 -1
  76. package/dist/api/design/boolean/index.d.ts +4 -4
  77. package/dist/api/design/create/index.d.ts +568 -45
  78. package/dist/api/design/create/index.d.ts.map +1 -1
  79. package/dist/api/design/delete/index.d.ts +3 -0
  80. package/dist/api/design/delete/index.d.ts.map +1 -1
  81. package/dist/api/design/doors/index.d.ts +195 -0
  82. package/dist/api/design/doors/index.d.ts.map +1 -1
  83. package/dist/api/design/edit/index.d.ts +1 -1
  84. package/dist/api/design/erase/index.d.ts +2 -2
  85. package/dist/api/design/family.d.ts +349 -0
  86. package/dist/api/design/family.d.ts.map +1 -0
  87. package/dist/api/design/furniture/index.d.ts +181 -8
  88. package/dist/api/design/furniture/index.d.ts.map +1 -1
  89. package/dist/api/design/index.d.ts +98 -0
  90. package/dist/api/design/index.d.ts.map +1 -1
  91. package/dist/api/design/lock.d.ts +26 -0
  92. package/dist/api/design/lock.d.ts.map +1 -1
  93. package/dist/api/design/materials/index.d.ts +270 -16
  94. package/dist/api/design/materials/index.d.ts.map +1 -1
  95. package/dist/api/design/query/geometry/index.d.ts +112 -0
  96. package/dist/api/design/query/geometry/index.d.ts.map +1 -1
  97. package/dist/api/design/query/index.d.ts +282 -11
  98. package/dist/api/design/query/index.d.ts.map +1 -1
  99. package/dist/api/design/query/referenceLines.d.ts +45 -0
  100. package/dist/api/design/query/referenceLines.d.ts.map +1 -0
  101. package/dist/api/design/query/spaces.d.ts +181 -8
  102. package/dist/api/design/query/spaces.d.ts.map +1 -1
  103. package/dist/api/design/selection/index.d.ts +144 -0
  104. package/dist/api/design/selection/index.d.ts.map +1 -1
  105. package/dist/api/design/transform/index.d.ts +172 -10
  106. package/dist/api/design/transform/index.d.ts.map +1 -1
  107. package/dist/api/design/types/index.d.ts +181 -0
  108. package/dist/api/design/types/index.d.ts.map +1 -0
  109. package/dist/api/design/update/index.d.ts +553 -2
  110. package/dist/api/design/update/index.d.ts.map +1 -1
  111. package/dist/api/design/visibility.d.ts +126 -0
  112. package/dist/api/design/visibility.d.ts.map +1 -0
  113. package/dist/api/design/windows/index.d.ts +113 -2
  114. package/dist/api/design/windows/index.d.ts.map +1 -1
  115. package/dist/api/entity/buildableEnvelope.d.ts +4 -0
  116. package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
  117. package/dist/api/entity/referenceLine.d.ts +10 -2
  118. package/dist/api/entity/referenceLine.d.ts.map +1 -1
  119. package/dist/api/entity/space.d.ts +21 -21
  120. package/dist/api/entity/story.d.ts +242 -15
  121. package/dist/api/entity/story.d.ts.map +1 -1
  122. package/dist/api/index.d.ts +10 -0
  123. package/dist/api/index.d.ts.map +1 -1
  124. package/dist/api/presentation/aiInspiration.d.ts +25 -25
  125. package/dist/api/presentation/annotate.d.ts +467 -0
  126. package/dist/api/presentation/annotate.d.ts.map +1 -0
  127. package/dist/api/presentation/diagrams.d.ts +111 -8
  128. package/dist/api/presentation/diagrams.d.ts.map +1 -1
  129. package/dist/api/presentation/export.d.ts +108 -0
  130. package/dist/api/presentation/export.d.ts.map +1 -0
  131. package/dist/api/presentation/import.d.ts +55 -4
  132. package/dist/api/presentation/import.d.ts.map +1 -1
  133. package/dist/api/presentation/index.d.ts +58 -1
  134. package/dist/api/presentation/index.d.ts.map +1 -1
  135. package/dist/api/presentation/placedViews.d.ts +1139 -0
  136. package/dist/api/presentation/placedViews.d.ts.map +1 -0
  137. package/dist/api/presentation/shapes.d.ts +481 -0
  138. package/dist/api/presentation/shapes.d.ts.map +1 -0
  139. package/dist/api/presentation/sheets.d.ts +452 -13
  140. package/dist/api/presentation/sheets.d.ts.map +1 -1
  141. package/dist/api/presentation/slideshow.d.ts +125 -0
  142. package/dist/api/presentation/slideshow.d.ts.map +1 -0
  143. package/dist/api/presentation/tables.d.ts +81 -0
  144. package/dist/api/presentation/tables.d.ts.map +1 -0
  145. package/dist/api/presentation/views.d.ts +367 -7
  146. package/dist/api/presentation/views.d.ts.map +1 -1
  147. package/dist/api/program/areas.d.ts +102 -12
  148. package/dist/api/program/areas.d.ts.map +1 -1
  149. package/dist/api/program/cores.d.ts +3 -99
  150. package/dist/api/program/cores.d.ts.map +1 -1
  151. package/dist/api/program/index.d.ts +7 -15
  152. package/dist/api/program/index.d.ts.map +1 -1
  153. package/dist/api/program/layout.d.ts +346 -11
  154. package/dist/api/program/layout.d.ts.map +1 -1
  155. package/dist/api/program/site.d.ts +469 -13
  156. package/dist/api/program/site.d.ts.map +1 -1
  157. package/dist/api/program/spreadsheet.d.ts +365 -41
  158. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  159. package/dist/api/workspace/index.d.ts +505 -0
  160. package/dist/api/workspace/index.d.ts.map +1 -0
  161. package/dist/errors/codes.d.ts +34 -0
  162. package/dist/errors/codes.d.ts.map +1 -0
  163. package/dist/errors/envelope.d.ts +56 -0
  164. package/dist/errors/envelope.d.ts.map +1 -0
  165. package/dist/errors/index.d.ts +6 -0
  166. package/dist/errors/index.d.ts.map +1 -0
  167. package/dist/errors/plugin-error.d.ts +69 -0
  168. package/dist/errors/plugin-error.d.ts.map +1 -0
  169. package/dist/handles.d.ts +97 -25
  170. package/dist/handles.d.ts.map +1 -1
  171. package/dist/host-utils.d.ts +4 -0
  172. package/dist/host-utils.d.ts.map +1 -1
  173. package/dist/index.cjs +4582 -1422
  174. package/dist/index.cjs.map +1 -1
  175. package/dist/index.d.ts +1 -0
  176. package/dist/index.d.ts.map +1 -1
  177. package/dist/index.js +4171 -1411
  178. package/dist/index.js.map +1 -1
  179. package/package.json +4 -2
  180. package/scripts/generate-manifest.mjs +45 -0
  181. package/scripts/generate-manifest.test.mjs +103 -4
  182. package/src/api/analysis/daylight.ts +470 -0
  183. package/src/api/analysis/heatmaps.ts +683 -0
  184. package/src/api/analysis/illuminance.ts +155 -0
  185. package/src/api/analysis/index.ts +61 -0
  186. package/src/api/analysis/shadows.ts +183 -0
  187. package/src/api/analysis/solar.ts +237 -0
  188. package/src/api/analysis/sunlightHours.ts +211 -0
  189. package/src/api/analysis/sunpath.ts +83 -0
  190. package/src/api/analysis/weather.ts +179 -0
  191. package/src/api/core/camera/index.ts +268 -0
  192. package/src/api/core/comment/index.ts +120 -2
  193. package/src/api/core/geom/create/index.ts +912 -1
  194. package/src/api/core/geom/delete/index.ts +6 -0
  195. package/src/api/core/geom/query/brep.ts +119 -0
  196. package/src/api/core/handles/index.ts +233 -0
  197. package/src/api/core/index.ts +34 -0
  198. package/src/api/core/io/export/index.ts +126 -0
  199. package/src/api/core/io/import/index.ts +496 -0
  200. package/src/api/core/io/index.ts +42 -0
  201. package/src/api/core/io/job/index.ts +140 -0
  202. package/src/api/core/io/query/index.ts +71 -0
  203. package/src/api/core/io/terrain/index.ts +360 -0
  204. package/src/api/core/io/underlay/index.ts +705 -0
  205. package/src/api/core/mode/index.ts +96 -0
  206. package/src/api/core/project/index.ts +62 -1
  207. package/src/api/core/proposals/index.ts +569 -0
  208. package/src/api/core/storeys/index.ts +294 -0
  209. package/src/api/core/tags.ts +27 -0
  210. package/src/api/core/user.ts +46 -0
  211. package/src/api/core/zoom/index.ts +4 -0
  212. package/src/api/design/create/index.ts +670 -30
  213. package/src/api/design/delete/index.ts +3 -0
  214. package/src/api/design/doors/index.ts +208 -0
  215. package/src/api/design/erase/index.ts +1 -1
  216. package/src/api/design/family.ts +388 -0
  217. package/src/api/design/furniture/index.ts +197 -8
  218. package/src/api/design/index.ts +102 -0
  219. package/src/api/design/lock.ts +27 -0
  220. package/src/api/design/materials/index.ts +334 -27
  221. package/src/api/design/query/geometry/index.ts +125 -3
  222. package/src/api/design/query/index.ts +217 -7
  223. package/src/api/design/query/referenceLines.ts +52 -0
  224. package/src/api/design/query/spaces.ts +143 -0
  225. package/src/api/design/selection/index.ts +129 -0
  226. package/src/api/design/transform/index.ts +170 -9
  227. package/src/api/design/types/index.ts +156 -0
  228. package/src/api/design/update/index.ts +631 -3
  229. package/src/api/design/visibility.ts +143 -0
  230. package/src/api/design/windows/index.ts +128 -2
  231. package/src/api/entity/buildableEnvelope.ts +4 -0
  232. package/src/api/entity/referenceLine.ts +8 -0
  233. package/src/api/entity/story.ts +259 -15
  234. package/src/api/index.ts +10 -0
  235. package/src/api/presentation/annotate.ts +385 -0
  236. package/src/api/presentation/diagrams.ts +118 -8
  237. package/src/api/presentation/export.ts +108 -0
  238. package/src/api/presentation/import.ts +51 -4
  239. package/src/api/presentation/index.ts +66 -1
  240. package/src/api/presentation/placedViews.ts +1120 -0
  241. package/src/api/presentation/shapes.ts +274 -0
  242. package/src/api/presentation/sheets.ts +400 -13
  243. package/src/api/presentation/slideshow.ts +134 -0
  244. package/src/api/presentation/tables.ts +84 -0
  245. package/src/api/presentation/views.ts +376 -8
  246. package/src/api/program/areas.ts +88 -15
  247. package/src/api/program/cores.ts +3 -91
  248. package/src/api/program/index.ts +7 -15
  249. package/src/api/program/layout.ts +365 -11
  250. package/src/api/program/site.ts +435 -13
  251. package/src/api/program/spreadsheet.ts +376 -35
  252. package/src/api/workspace/index.ts +563 -0
  253. package/src/errors/codes.ts +136 -0
  254. package/src/errors/envelope.ts +75 -0
  255. package/src/errors/index.ts +21 -0
  256. package/src/errors/plugin-error.ts +134 -0
  257. package/src/handles.ts +123 -13
  258. package/src/host-utils.ts +4 -0
  259. package/src/index.ts +1 -0
  260. package/test/errors.test.mjs +184 -0
  261. package/tsconfig.json +7 -2
@@ -0,0 +1,108 @@
1
+ import * as z from "zod";
2
+ /**
3
+ * Presentation export — render the Present-mode layout sheets to a downloadable
4
+ * file (PDF / PNG / JPG) and hand the plugin the bytes as base64.
5
+ *
6
+ * This wraps the same pipeline the Present-mode **Export** dialog drives:
7
+ * each sheet is serialized to an SVG, then either composed into a PDF
8
+ * (svg2pdf/jspdf) or rasterized to a PNG/JPG. Nothing is written to disk
9
+ * host-side — the plugin receives the encoded bytes and decides what to do
10
+ * with them (save, upload, preview).
11
+ *
12
+ * Requires **Present mode to be open** (the documentation editor); the call
13
+ * throws `PRECONDITION_FAILED` when it is not.
14
+ *
15
+ * The result is always a uniform `{ files }` array (see
16
+ * {@linkcode PluginPresentationExportResult}):
17
+ * - `pdf` with `combine` (the default) → a single multi-page file.
18
+ * - `pdf` with `combine: false`, or any `png`/`jpg` → one file per sheet.
19
+ *
20
+ * Accessed via `snaptrude.presentation.export`.
21
+ *
22
+ * For a different export intent, see `core.io.export.model` (the 3D model as a
23
+ * GLB/OBJ/FBX/3DS file) and `program.spreadsheet.export` (the area-program /
24
+ * takeoff workbook as XLSX/PDF/CSV).
25
+ *
26
+ * The schemas and result types live here; the callable method is declared on
27
+ * {@linkcode PluginPresentationApi.export}.
28
+ */
29
+ /** Output file format: a vector `pdf`, or a rasterized `png` / `jpg`. */
30
+ export declare const PluginPresentationExportFormat: z.ZodEnum<{
31
+ pdf: "pdf";
32
+ png: "png";
33
+ jpg: "jpg";
34
+ }>;
35
+ export type PluginPresentationExportFormat = z.infer<typeof PluginPresentationExportFormat>;
36
+ /**
37
+ * Target pixel dimensions for a rasterized (`png`/`jpg`) export. Ignored for
38
+ * `pdf`, which stays vector and takes its size from the sheet.
39
+ *
40
+ * | Property | Type | Description |
41
+ * |---|---|---|
42
+ * | `width` | `number` | Output width in pixels |
43
+ * | `height` | `number` | Output height in pixels |
44
+ */
45
+ export declare const PluginPresentationExportResolution: z.ZodObject<{
46
+ width: z.ZodNumber;
47
+ height: z.ZodNumber;
48
+ }, z.core.$strip>;
49
+ export type PluginPresentationExportResolution = z.infer<typeof PluginPresentationExportResolution>;
50
+ /**
51
+ * Arguments for {@linkcode PluginPresentationApi.export}.
52
+ *
53
+ * | Property | Type | Description |
54
+ * |---|---|---|
55
+ * | `format` | `"pdf" \| "png" \| "jpg"` | Output format |
56
+ * | `sheetIds` | `string[] \| undefined` | Sheets to export (all sheets when omitted) |
57
+ * | `combine` | `boolean \| undefined` | PDF only: one multi-page file (default `true`) vs one file per sheet |
58
+ * | `resolution` | {@linkcode PluginPresentationExportResolution}` \| undefined` | Raster target size (`png`/`jpg` only) |
59
+ * | `fileName` | `string \| undefined` | Base file name (without extension) |
60
+ */
61
+ export declare const PluginPresentationExportArgs: z.ZodObject<{
62
+ format: z.ZodEnum<{
63
+ pdf: "pdf";
64
+ png: "png";
65
+ jpg: "jpg";
66
+ }>;
67
+ sheetIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
68
+ combine: z.ZodOptional<z.ZodBoolean>;
69
+ resolution: z.ZodOptional<z.ZodObject<{
70
+ width: z.ZodNumber;
71
+ height: z.ZodNumber;
72
+ }, z.core.$strip>>;
73
+ fileName: z.ZodOptional<z.ZodString>;
74
+ }, z.core.$strip>;
75
+ export type PluginPresentationExportArgs = z.infer<typeof PluginPresentationExportArgs>;
76
+ /**
77
+ * A single exported file.
78
+ *
79
+ * | Property | Type | Description |
80
+ * |---|---|---|
81
+ * | `fileName` | `string` | File name including extension |
82
+ * | `mimeType` | `string` | MIME type (`application/pdf`, `image/png`, `image/jpeg`) |
83
+ * | `dataBase64` | `string` | The file bytes, base64-encoded (no data-URL prefix) |
84
+ */
85
+ export declare const PluginPresentationExportFile: z.ZodObject<{
86
+ fileName: z.ZodString;
87
+ mimeType: z.ZodString;
88
+ dataBase64: z.ZodString;
89
+ }, z.core.$strip>;
90
+ export type PluginPresentationExportFile = z.infer<typeof PluginPresentationExportFile>;
91
+ /**
92
+ * Result of {@linkcode PluginPresentationApi.export} — always a `files` array.
93
+ * A combined PDF yields one entry; per-sheet exports yield one entry each, in
94
+ * sheet order.
95
+ *
96
+ * | Property | Type | Description |
97
+ * |---|---|---|
98
+ * | `files` | {@linkcode PluginPresentationExportFile}`[]` | The exported files |
99
+ */
100
+ export declare const PluginPresentationExportResult: z.ZodObject<{
101
+ files: z.ZodArray<z.ZodObject<{
102
+ fileName: z.ZodString;
103
+ mimeType: z.ZodString;
104
+ dataBase64: z.ZodString;
105
+ }, z.core.$strip>>;
106
+ }, z.core.$strip>;
107
+ export type PluginPresentationExportResult = z.infer<typeof PluginPresentationExportResult>;
108
+ //# sourceMappingURL=export.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,yEAAyE;AACzE,eAAO,MAAM,8BAA8B;;;;EAAgC,CAAA;AAC3E,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,8BAA8B,CACtC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,kCAAkC;;;iBAG7C,CAAA;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,kCAAkC,CAC1C,CAAA;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;iBAMvC,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B;;;;iBAIvC,CAAA;AACF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B;;;;;;iBAEzC,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,8BAA8B,CACtC,CAAA"}
@@ -3,9 +3,10 @@ import { PluginApiReturn } from "../../types";
3
3
  /**
4
4
  * Presentation import — bring external reference assets onto the Present canvas.
5
5
  *
6
- * `import.image` places a reference image and `import.pdf` places a PDF (each
7
- * page vectorized to SVG) onto the current Present sheet, returning the created
8
- * canvas shape ids. Requires Present mode to be open.
6
+ * `import.image` places a reference image, `import.pdf` places a PDF (each
7
+ * page vectorized to SVG), and `import.svg` places a validated SVG onto
8
+ * the current Present sheet, returning the created canvas shape ids. Requires
9
+ * Present mode to be open.
9
10
  *
10
11
  * The host engine takes a browser `File`, which a plugin worker cannot supply,
11
12
  * so these accept a `url`/`dataUrl` that the host adapts into a `File`.
@@ -17,6 +18,9 @@ export declare abstract class PluginPresentationImportApi {
17
18
  /**
18
19
  * Import a reference image onto the current Present sheet.
19
20
  *
21
+ * To place the image as a **scene** underlay to trace over — on a storey,
22
+ * not the Present canvas — use `core.io.import.image` instead.
23
+ *
20
24
  * @param source - The asset to import: exactly one of `url` or `dataUrl`.
21
25
  * @param options - Optional `position` — where to place the image on the
22
26
  * sheet.
@@ -51,6 +55,9 @@ export declare abstract class PluginPresentationImportApi {
51
55
  *
52
56
  * Each page is converted to vector SVG and placed as a canvas shape.
53
57
  *
58
+ * To bring the PDF into the **scene** as a traceable underlay — on a storey,
59
+ * not the Present canvas — use `core.io.import.pdf` instead.
60
+ *
54
61
  * @param source - The asset to import: exactly one of `url` or `dataUrl`.
55
62
  * @param options - Optional `position` — where to place the pages on the
56
63
  * sheet.
@@ -79,10 +86,54 @@ export declare abstract class PluginPresentationImportApi {
79
86
  y: number;
80
87
  };
81
88
  }): PluginApiReturn<PluginPresentationImportResult>;
89
+ /**
90
+ * Import an SVG onto the current Present sheet as a vector asset.
91
+ *
92
+ * An SVG-validating variant of {@linkcode PluginPresentationImportApi.image}:
93
+ * `import.image` already passes SVG sources through, but this method first
94
+ * validates that the source really is an SVG and forces the vector mime
95
+ * type. Throws if the source is not an SVG.
96
+ *
97
+ * **Rendering is vector up to a complexity cap.** Simple SVGs (up to ~1500
98
+ * SVG element nodes and ~2 MB) render true-vector and stay crisp at every
99
+ * zoom. Beyond that cap the shared canvas renderer **intentionally falls
100
+ * back to a 1920px raster** to protect canvas performance, so very complex
101
+ * SVGs can look rasterized when zoomed in. The stored asset is the original
102
+ * SVG either way; only the on-canvas rendering falls back.
103
+ *
104
+ * @param source - The SVG to import: exactly one of `url` or `dataUrl`.
105
+ * @param options - Optional `position` — where to place the SVG on the sheet.
106
+ * @returns A {@linkcode PluginPresentationImportResult} with the created
107
+ * `shapeIds`.
108
+ * @throws If Present mode is not open, the source is not an SVG, or it cannot
109
+ * be loaded.
110
+ *
111
+ * @examplePrompt Import this SVG diagram onto the present canvas
112
+ * @examplePrompt Add a vector logo to my presentation board
113
+ * @examplePrompt Place this SVG floor plan on the current sheet as vectors
114
+ * @examplePrompt Bring a crisp vector graphic into Present mode
115
+ *
116
+ * # Example
117
+ * ```ts
118
+ * const { shapeIds } = await snaptrude.presentation.import.svg({
119
+ * url: "https://example.com/diagram.svg",
120
+ * })
121
+ * ```
122
+ */
123
+ abstract svg(source: {
124
+ url?: string;
125
+ dataUrl?: string;
126
+ }, options?: {
127
+ position?: {
128
+ x: number;
129
+ y: number;
130
+ };
131
+ }): PluginApiReturn<PluginPresentationImportResult>;
82
132
  }
83
133
  /**
84
134
  * Arguments for {@linkcode PluginPresentationImportApi.image} /
85
- * {@linkcode PluginPresentationImportApi.pdf}. Provide exactly one source.
135
+ * {@linkcode PluginPresentationImportApi.pdf} /
136
+ * {@linkcode PluginPresentationImportApi.svg}. Provide exactly one source.
86
137
  *
87
138
  * | Property | Type | Description |
88
139
  * |---|---|---|
@@ -1 +1 @@
1
- {"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;GAWG;AACH,8BAAsB,2BAA2B;;IAG/C;;;;;;;;;;;;;;;;;;;;;;OAsBG;aACa,KAAK,CACnB,MAAM,EAAE;QAAE,GAAG,CAAC,E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C,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAChD,eAAe,CAAC,8BAA8B,CAAC;IAElD;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;aACa,GAAG,CACjB,MAAM,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAC1C,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAChD,eAAe,CAAC,8BAA8B,CAAC;IAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;aACa,GAAG,CACjB,MAAM,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,EAC1C,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAChD,eAAe,CAAC,8BAA8B,CAAC;CACnD;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B;;;;;;;iBAQrC,CAAA;AACJ,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAChD,OAAO,4BAA4B,CACpC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B;;iBAEzC,CAAA;AACF,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,8BAA8B,CACtC,CAAA"}
@@ -1,8 +1,15 @@
1
+ import { PluginApiReturn } from "../../types";
1
2
  import { PluginPresentationViewsApi } from "./views";
2
3
  import { PluginPresentationAIInspirationApi } from "./aiInspiration";
3
4
  import { PluginPresentationSheetsApi } from "./sheets";
5
+ import { PluginPresentationPlacedViewsApi } from "./placedViews";
4
6
  import { PluginPresentationDiagramsApi } from "./diagrams";
7
+ import { PluginPresentationAnnotateApi } from "./annotate";
8
+ import { PluginPresentationShapesApi } from "./shapes";
9
+ import { PluginPresentationTablesApi } from "./tables";
10
+ import { PluginPresentationSlideshowApi } from "./slideshow";
5
11
  import { PluginPresentationImportApi } from "./import";
12
+ import { PluginPresentationExportResult, type PluginPresentationExportFormat, type PluginPresentationExportResolution } from "./export";
6
13
  /**
7
14
  * Presentation APIs — prepare and assemble presentations.
8
15
  *
@@ -15,7 +22,10 @@ import { PluginPresentationImportApi } from "./import";
15
22
  *
16
23
  * - {@linkcode PluginPresentationApi.views} — Saved 2D/3D views (list, get, capture, activate, create)
17
24
  * - {@linkcode PluginPresentationApi.sheets} — Layout sheets (list, get, create, place views)
18
- * - {@linkcode PluginPresentationApi.diagrams} — Place program/adjacency/site diagram images on sheets
25
+ * - {@linkcode PluginPresentationApi.placedViews} — Views already placed on the canvas (move, scale, crop)
26
+ * - {@linkcode PluginPresentationApi.diagrams} — Generate program/site diagram sheets, place diagram images
27
+ * - {@linkcode PluginPresentationApi.tables} — Place data tables on sheets
28
+ * - {@linkcode PluginPresentationApi.slideshow} — Run the Present-mode slideshow
19
29
  * - {@linkcode PluginPresentationApi.import} — Import reference images/PDFs onto the canvas
20
30
  * - {@linkcode PluginPresentationApi.aiInspiration} — Present-mode AI image/video generation
21
31
  *
@@ -26,8 +36,18 @@ export declare abstract class PluginPresentationApi {
26
36
  abstract views: PluginPresentationViewsApi;
27
37
  /** Layout sheets — list/get/create and place views (Present mode). See {@linkcode PluginPresentationSheetsApi}. */
28
38
  abstract sheets: PluginPresentationSheetsApi;
39
+ /** Placed views — layout of the view shapes on the canvas: move/scale/setScale/setCrop (Present mode). See {@linkcode PluginPresentationPlacedViewsApi}. */
40
+ abstract placedViews: PluginPresentationPlacedViewsApi;
29
41
  /** Program/adjacency/site diagrams — place images on sheets. See {@linkcode PluginPresentationDiagramsApi}. */
30
42
  abstract diagrams: PluginPresentationDiagramsApi;
43
+ /** Annotations on Present-mode sheets — text/arrows/notes/geo shapes. See {@linkcode PluginPresentationAnnotateApi}. */
44
+ abstract annotate: PluginPresentationAnnotateApi;
45
+ /** Plugin-owned keyed shapes — upsert/remove/list so reruns update instead of duplicating. See {@linkcode PluginPresentationShapesApi}. */
46
+ abstract shapes: PluginPresentationShapesApi;
47
+ /** Data tables on Present sheets — place string rows as a table shape. See {@linkcode PluginPresentationTablesApi}. */
48
+ abstract tables: PluginPresentationTablesApi;
49
+ /** The Present-mode slideshow — start/stop/getState. See {@linkcode PluginPresentationSlideshowApi}. */
50
+ abstract slideshow: PluginPresentationSlideshowApi;
31
51
  /** Import reference images/PDFs onto the Present canvas. See {@linkcode PluginPresentationImportApi}. */
32
52
  abstract import: PluginPresentationImportApi;
33
53
  /**
@@ -35,11 +55,48 @@ export declare abstract class PluginPresentationApi {
35
55
  * {@linkcode PluginPresentationAIInspirationApi}.
36
56
  */
37
57
  abstract aiInspiration: PluginPresentationAIInspirationApi;
58
+ /**
59
+ * Export the presentation's layout sheets to a downloadable file (PDF / PNG /
60
+ * JPG) and return the encoded bytes as base64. Wraps the Present-mode Export
61
+ * dialog pipeline headlessly. Requires Present mode to be open.
62
+ *
63
+ * @param format - Output format: `"pdf"`, `"png"`, or `"jpg"`.
64
+ * @param options - Optional `sheetIds` (all sheets when omitted), `combine`
65
+ * (PDF only — one multi-page file vs one per sheet, default `true`),
66
+ * `resolution` (raster target size for `png`/`jpg`), and `fileName`.
67
+ * @returns A {@linkcode PluginPresentationExportResult} — always a `files`
68
+ * array (one entry for a combined PDF, one per sheet otherwise).
69
+ * @throws If Present mode is not open, a `sheetId` is unknown, or a sheet
70
+ * fails to serialize/encode.
71
+ *
72
+ * @examplePrompt Export the presentation as a PDF
73
+ * @examplePrompt Download all sheets as a single PDF
74
+ * @examplePrompt Export sheet 1 as a PNG
75
+ * @examplePrompt Save the presentation sheets as JPG images
76
+ * @examplePrompt Export these sheets to PDF at high resolution
77
+ *
78
+ * # Example
79
+ * ```ts
80
+ * const { files } = await snaptrude.presentation.export("pdf")
81
+ * ```
82
+ */
83
+ abstract export(format: PluginPresentationExportFormat, options?: {
84
+ sheetIds?: string[];
85
+ combine?: boolean;
86
+ resolution?: PluginPresentationExportResolution;
87
+ fileName?: string;
88
+ }): PluginApiReturn<PluginPresentationExportResult>;
38
89
  constructor();
39
90
  }
40
91
  export * from "./views";
41
92
  export * from "./sheets";
93
+ export * from "./placedViews";
42
94
  export * from "./diagrams";
95
+ export * from "./annotate";
96
+ export * from "./shapes";
97
+ export * from "./tables";
98
+ export * from "./slideshow";
43
99
  export * from "./import";
44
100
  export * from "./aiInspiration";
101
+ export * from "./export";
45
102
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,EAAE,kCAAkC,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AAEtD;;;;;;;;;;;;;;;;;GAiBG;AACH,8BAAsB,qBAAqB;IACzC,qEAAqE;IACrE,SAAgB,KAAK,EAAE,0BAA0B,CAAA;IACjD,mHAAmH;IACnH,SAAgB,MAAM,EAAE,2BAA2B,CAAA;IACnD,+GAA+G;IAC/G,SAAgB,QAAQ,EAAE,6BAA6B,CAAA;IACvD,yGAAyG;IACzG,SAAgB,MAAM,EAAE,2BAA2B,CAAA;IACnD;;;OAGG;IACH,SAAgB,aAAa,EAAE,kCAAkC,CAAA;;CAGlE;AAED,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAA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