@snaptrude/plugin-core 0.7.1 → 0.8.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 (130) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/api-manifest.full.json +6442 -0
  3. package/api-manifest.json +2029 -128
  4. package/dist/api/core/camera/index.d.ts +208 -0
  5. package/dist/api/core/camera/index.d.ts.map +1 -0
  6. package/dist/api/core/comment/index.d.ts +105 -2
  7. package/dist/api/core/comment/index.d.ts.map +1 -1
  8. package/dist/api/core/geom/create/index.d.ts +13 -13
  9. package/dist/api/core/geom/delete/index.d.ts +8 -2
  10. package/dist/api/core/geom/delete/index.d.ts.map +1 -1
  11. package/dist/api/core/geom/query/arc.d.ts +5 -5
  12. package/dist/api/core/geom/query/brep.d.ts +18 -18
  13. package/dist/api/core/geom/query/circle.d.ts +18 -18
  14. package/dist/api/core/geom/query/contour.d.ts +20 -20
  15. package/dist/api/core/geom/query/curve.d.ts +49 -49
  16. package/dist/api/core/geom/query/edge.d.ts +5 -5
  17. package/dist/api/core/geom/query/face.d.ts +16 -16
  18. package/dist/api/core/geom/query/halfedge.d.ts +8 -8
  19. package/dist/api/core/geom/query/profile.d.ts +19 -19
  20. package/dist/api/core/geom/query/vertex.d.ts +8 -8
  21. package/dist/api/core/geom/update/contour.d.ts +14 -14
  22. package/dist/api/core/geom/update/curve.d.ts +7 -7
  23. package/dist/api/core/geom/update/profile.d.ts +16 -16
  24. package/dist/api/core/handles/index.d.ts +210 -0
  25. package/dist/api/core/handles/index.d.ts.map +1 -0
  26. package/dist/api/core/index.d.ts +15 -0
  27. package/dist/api/core/index.d.ts.map +1 -1
  28. package/dist/api/core/io/export/index.d.ts +132 -0
  29. package/dist/api/core/io/export/index.d.ts.map +1 -0
  30. package/dist/api/core/io/import/index.d.ts +1 -1
  31. package/dist/api/core/io/index.d.ts +5 -0
  32. package/dist/api/core/io/index.d.ts.map +1 -1
  33. package/dist/api/core/layers.d.ts +7 -7
  34. package/dist/api/core/proposals/index.d.ts +65 -9
  35. package/dist/api/core/proposals/index.d.ts.map +1 -1
  36. package/dist/api/core/user.d.ts +44 -0
  37. package/dist/api/core/user.d.ts.map +1 -0
  38. package/dist/api/design/boolean/index.d.ts +4 -4
  39. package/dist/api/design/create/index.d.ts +139 -44
  40. package/dist/api/design/create/index.d.ts.map +1 -1
  41. package/dist/api/design/doors/index.d.ts +36 -0
  42. package/dist/api/design/doors/index.d.ts.map +1 -1
  43. package/dist/api/design/edit/index.d.ts +1 -1
  44. package/dist/api/design/erase/index.d.ts +2 -2
  45. package/dist/api/design/furniture/index.d.ts +114 -3
  46. package/dist/api/design/furniture/index.d.ts.map +1 -1
  47. package/dist/api/design/index.d.ts +10 -0
  48. package/dist/api/design/index.d.ts.map +1 -1
  49. package/dist/api/design/materials/index.d.ts +111 -14
  50. package/dist/api/design/materials/index.d.ts.map +1 -1
  51. package/dist/api/design/query/index.d.ts +31 -1
  52. package/dist/api/design/query/index.d.ts.map +1 -1
  53. package/dist/api/design/query/spaces.d.ts +5 -5
  54. package/dist/api/design/transform/index.d.ts +83 -14
  55. package/dist/api/design/transform/index.d.ts.map +1 -1
  56. package/dist/api/design/types/index.d.ts +181 -0
  57. package/dist/api/design/types/index.d.ts.map +1 -0
  58. package/dist/api/design/update/index.d.ts +335 -2
  59. package/dist/api/design/update/index.d.ts.map +1 -1
  60. package/dist/api/design/visibility.d.ts +98 -0
  61. package/dist/api/design/visibility.d.ts.map +1 -0
  62. package/dist/api/entity/referenceLine.d.ts +2 -2
  63. package/dist/api/entity/space.d.ts +19 -19
  64. package/dist/api/entity/story.d.ts +128 -15
  65. package/dist/api/entity/story.d.ts.map +1 -1
  66. package/dist/api/presentation/annotate.d.ts +448 -0
  67. package/dist/api/presentation/annotate.d.ts.map +1 -0
  68. package/dist/api/presentation/diagrams.d.ts +49 -8
  69. package/dist/api/presentation/diagrams.d.ts.map +1 -1
  70. package/dist/api/presentation/export.d.ts +104 -0
  71. package/dist/api/presentation/export.d.ts.map +1 -0
  72. package/dist/api/presentation/index.d.ts +38 -0
  73. package/dist/api/presentation/index.d.ts.map +1 -1
  74. package/dist/api/presentation/sheets.d.ts +410 -13
  75. package/dist/api/presentation/sheets.d.ts.map +1 -1
  76. package/dist/api/presentation/views.d.ts +165 -10
  77. package/dist/api/presentation/views.d.ts.map +1 -1
  78. package/dist/api/program/areas.d.ts +63 -3
  79. package/dist/api/program/areas.d.ts.map +1 -1
  80. package/dist/api/program/cores.d.ts +3 -99
  81. package/dist/api/program/cores.d.ts.map +1 -1
  82. package/dist/api/program/index.d.ts +2 -2
  83. package/dist/api/program/index.d.ts.map +1 -1
  84. package/dist/api/program/layout.d.ts +172 -12
  85. package/dist/api/program/layout.d.ts.map +1 -1
  86. package/dist/api/program/site.d.ts +11 -8
  87. package/dist/api/program/site.d.ts.map +1 -1
  88. package/dist/api/program/spreadsheet.d.ts +105 -13
  89. package/dist/api/program/spreadsheet.d.ts.map +1 -1
  90. package/dist/handles.d.ts +64 -25
  91. package/dist/handles.d.ts.map +1 -1
  92. package/dist/index.cjs +2316 -1644
  93. package/dist/index.cjs.map +1 -1
  94. package/dist/index.js +2224 -1639
  95. package/dist/index.js.map +1 -1
  96. package/package.json +1 -1
  97. package/src/api/core/camera/index.ts +212 -0
  98. package/src/api/core/comment/index.ts +120 -2
  99. package/src/api/core/geom/delete/index.ts +6 -0
  100. package/src/api/core/handles/index.ts +233 -0
  101. package/src/api/core/index.ts +15 -0
  102. package/src/api/core/io/export/index.ts +124 -0
  103. package/src/api/core/io/index.ts +5 -0
  104. package/src/api/core/proposals/index.ts +71 -11
  105. package/src/api/core/user.ts +46 -0
  106. package/src/api/design/create/index.ts +166 -36
  107. package/src/api/design/doors/index.ts +40 -0
  108. package/src/api/design/furniture/index.ts +127 -3
  109. package/src/api/design/index.ts +10 -0
  110. package/src/api/design/materials/index.ts +157 -30
  111. package/src/api/design/query/index.ts +33 -7
  112. package/src/api/design/transform/index.ts +89 -12
  113. package/src/api/design/types/index.ts +156 -0
  114. package/src/api/design/update/index.ts +402 -6
  115. package/src/api/design/visibility.ts +109 -0
  116. package/src/api/entity/story.ts +141 -15
  117. package/src/api/presentation/annotate.ts +360 -0
  118. package/src/api/presentation/diagrams.ts +53 -8
  119. package/src/api/presentation/export.ts +104 -0
  120. package/src/api/presentation/index.ts +46 -0
  121. package/src/api/presentation/sheets.ts +346 -13
  122. package/src/api/presentation/views.ts +164 -12
  123. package/src/api/program/areas.ts +57 -6
  124. package/src/api/program/cores.ts +3 -91
  125. package/src/api/program/index.ts +2 -2
  126. package/src/api/program/layout.ts +182 -12
  127. package/src/api/program/site.ts +11 -8
  128. package/src/api/program/spreadsheet.ts +125 -29
  129. package/src/handles.ts +77 -13
  130. package/tsconfig.json +7 -2
@@ -1,22 +1,52 @@
1
1
  import * as z from "zod";
2
2
  import { PluginApiReturn } from "../../types";
3
3
  /**
4
- * Presentation diagrams — place diagram images onto sheets.
4
+ * Presentation diagrams — generate program diagrams from the model, and place
5
+ * diagram images onto sheets.
5
6
  *
6
- * {@linkcode PluginPresentationDiagramsApi.place} drops diagram images (by
7
- * URL) onto a sheet and returns the created canvas shape ids (requires Present
8
- * mode to be open). Adjacency data itself is read and computed via
7
+ * {@linkcode PluginPresentationDiagramsApi.generateProgram} runs the Present-mode
8
+ * **Program** action: it reads the project's spaces and departments and creates
9
+ * new layout sheets holding the generated diagram graphics.
10
+ * {@linkcode PluginPresentationDiagramsApi.place} drops ready diagram images (by
11
+ * URL) onto an existing sheet and returns the created canvas shape ids. Both
12
+ * require Present mode to be open. Adjacency data itself is read and computed via
9
13
  * `program.adjacency` (see {@linkcode PluginProgramAdjacencyApi}).
10
14
  *
11
- * A future one-step spec-based `place` which would render a diagram spec
12
- * and place it in a single call — awaits a public generator from the
13
- * documentation engine; until that generator exists, `place` takes ready
14
- * image `urls` (we do not ship a spec-based `place` that would only throw).
15
+ * There is intentionally no `generateAdjacency`: the host's adjacency generator
16
+ * runs its sheet-creation task fire-and-forget internally, so a single call
17
+ * cannot return the sheets it creates. Use the Present-mode Adjacency menu for
18
+ * those, then `place` a pre-rendered adjacency image if you need it via the API.
15
19
  *
16
20
  * Accessed via `snaptrude.presentation.diagrams`.
17
21
  */
18
22
  export declare abstract class PluginPresentationDiagramsApi {
19
23
  constructor();
24
+ /**
25
+ * Generate the program (space + department) diagrams for the current model,
26
+ * creating new layout sheets.
27
+ *
28
+ * Runs the same auto-generation as the Present-mode **Program** action: reads
29
+ * the project's spaces and departments, lays them out to scale, and creates one
30
+ * or more new sheets holding the generated diagram graphics. Unlike
31
+ * {@linkcode PluginPresentationDiagramsApi.place} (which pastes ready image URLs
32
+ * onto an existing sheet), this generates the graphics from the model and
33
+ * creates its own sheets. Requires Present mode to be open.
34
+ *
35
+ * @returns A {@linkcode PluginPresentationDiagramsGenerateResult} with the
36
+ * `sheetIds` of the sheets created.
37
+ * @throws If Present mode is not open, or the model has no spaces/departments to
38
+ * generate from.
39
+ *
40
+ * @examplePrompt Generate the program diagrams for this project
41
+ * @examplePrompt Auto-generate the space and department diagram sheets
42
+ * @examplePrompt Create the program layout sheets from the model
43
+ *
44
+ * # Example
45
+ * ```ts
46
+ * const { sheetIds } = await snaptrude.presentation.diagrams.generateProgram()
47
+ * ```
48
+ */
49
+ abstract generateProgram(): PluginApiReturn<PluginPresentationDiagramsGenerateResult>;
20
50
  /**
21
51
  * Place diagram images onto a sheet.
22
52
  *
@@ -78,4 +108,15 @@ export declare const PluginPresentationDiagramsPlaceResult: z.ZodObject<{
78
108
  shapeIds: z.ZodArray<z.ZodString>;
79
109
  }, z.core.$strip>;
80
110
  export type PluginPresentationDiagramsPlaceResult = z.infer<typeof PluginPresentationDiagramsPlaceResult>;
111
+ /**
112
+ * Result of {@linkcode PluginPresentationDiagramsApi.generateProgram}.
113
+ *
114
+ * | Property | Type | Description |
115
+ * |---|---|---|
116
+ * | `sheetIds` | `string[]` | Ids of the sheets created by the generator |
117
+ */
118
+ export declare const PluginPresentationDiagramsGenerateResult: z.ZodObject<{
119
+ sheetIds: z.ZodArray<z.ZodString>;
120
+ }, z.core.$strip>;
121
+ export type PluginPresentationDiagramsGenerateResult = z.infer<typeof PluginPresentationDiagramsGenerateResult>;
81
122
  //# sourceMappingURL=diagrams.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"diagrams.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/diagrams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;GAcG;AACH,8BAAsB,6BAA6B;;IAGjD;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,KAAK,CACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAChD,eAAe,CAAC,qCAAqC,CAAC;CAC1D;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,mCAAmC;;;;;;;iBAI9C,CAAA;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC;;iBAEhD,CAAA;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,qCAAqC,CAC7C,CAAA"}
1
+ {"version":3,"file":"diagrams.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/diagrams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;;;;;GAkBG;AACH,8BAAsB,6BAA6B;;IAGjD;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,eAAe,IAAI,eAAe,CAAC,wCAAwC,CAAC;IAE5F;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,KAAK,CACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAAC,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,GAChD,eAAe,CAAC,qCAAqC,CAAC;CAC1D;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,mCAAmC;;;;;;;iBAI9C,CAAA;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qCAAqC;;iBAEhD,CAAA;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,qCAAqC,CAC7C,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wCAAwC;;iBAEnD,CAAA;AACF,MAAM,MAAM,wCAAwC,GAAG,CAAC,CAAC,KAAK,CAC5D,OAAO,wCAAwC,CAChD,CAAA"}
@@ -0,0 +1,104 @@
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
+ * The schemas and result types live here; the callable method is declared on
23
+ * {@linkcode PluginPresentationApi.export}.
24
+ */
25
+ /** Output file format: a vector `pdf`, or a rasterized `png` / `jpg`. */
26
+ export declare const PluginPresentationExportFormat: z.ZodEnum<{
27
+ pdf: "pdf";
28
+ png: "png";
29
+ jpg: "jpg";
30
+ }>;
31
+ export type PluginPresentationExportFormat = z.infer<typeof PluginPresentationExportFormat>;
32
+ /**
33
+ * Target pixel dimensions for a rasterized (`png`/`jpg`) export. Ignored for
34
+ * `pdf`, which stays vector and takes its size from the sheet.
35
+ *
36
+ * | Property | Type | Description |
37
+ * |---|---|---|
38
+ * | `width` | `number` | Output width in pixels |
39
+ * | `height` | `number` | Output height in pixels |
40
+ */
41
+ export declare const PluginPresentationExportResolution: z.ZodObject<{
42
+ width: z.ZodNumber;
43
+ height: z.ZodNumber;
44
+ }, z.core.$strip>;
45
+ export type PluginPresentationExportResolution = z.infer<typeof PluginPresentationExportResolution>;
46
+ /**
47
+ * Arguments for {@linkcode PluginPresentationApi.export}.
48
+ *
49
+ * | Property | Type | Description |
50
+ * |---|---|---|
51
+ * | `format` | `"pdf" \| "png" \| "jpg"` | Output format |
52
+ * | `sheetIds` | `string[] \| undefined` | Sheets to export (all sheets when omitted) |
53
+ * | `combine` | `boolean \| undefined` | PDF only: one multi-page file (default `true`) vs one file per sheet |
54
+ * | `resolution` | {@linkcode PluginPresentationExportResolution}` \| undefined` | Raster target size (`png`/`jpg` only) |
55
+ * | `fileName` | `string \| undefined` | Base file name (without extension) |
56
+ */
57
+ export declare const PluginPresentationExportArgs: z.ZodObject<{
58
+ format: z.ZodEnum<{
59
+ pdf: "pdf";
60
+ png: "png";
61
+ jpg: "jpg";
62
+ }>;
63
+ sheetIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ combine: z.ZodOptional<z.ZodBoolean>;
65
+ resolution: z.ZodOptional<z.ZodObject<{
66
+ width: z.ZodNumber;
67
+ height: z.ZodNumber;
68
+ }, z.core.$strip>>;
69
+ fileName: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>;
71
+ export type PluginPresentationExportArgs = z.infer<typeof PluginPresentationExportArgs>;
72
+ /**
73
+ * A single exported file.
74
+ *
75
+ * | Property | Type | Description |
76
+ * |---|---|---|
77
+ * | `fileName` | `string` | File name including extension |
78
+ * | `mimeType` | `string` | MIME type (`application/pdf`, `image/png`, `image/jpeg`) |
79
+ * | `dataBase64` | `string` | The file bytes, base64-encoded (no data-URL prefix) |
80
+ */
81
+ export declare const PluginPresentationExportFile: z.ZodObject<{
82
+ fileName: z.ZodString;
83
+ mimeType: z.ZodString;
84
+ dataBase64: z.ZodString;
85
+ }, z.core.$strip>;
86
+ export type PluginPresentationExportFile = z.infer<typeof PluginPresentationExportFile>;
87
+ /**
88
+ * Result of {@linkcode PluginPresentationApi.export} — always a `files` array.
89
+ * A combined PDF yields one entry; per-sheet exports yield one entry each, in
90
+ * sheet order.
91
+ *
92
+ * | Property | Type | Description |
93
+ * |---|---|---|
94
+ * | `files` | {@linkcode PluginPresentationExportFile}`[]` | The exported files |
95
+ */
96
+ export declare const PluginPresentationExportResult: z.ZodObject<{
97
+ files: z.ZodArray<z.ZodObject<{
98
+ fileName: z.ZodString;
99
+ mimeType: z.ZodString;
100
+ dataBase64: z.ZodString;
101
+ }, z.core.$strip>>;
102
+ }, z.core.$strip>;
103
+ export type PluginPresentationExportResult = z.infer<typeof PluginPresentationExportResult>;
104
+ //# 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;;;;;;;;;;;;;;;;;;;;;;GAsBG;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"}
@@ -1,8 +1,11 @@
1
+ import { PluginApiReturn } from "../../types";
1
2
  import { PluginPresentationViewsApi } from "./views";
2
3
  import { PluginPresentationAIInspirationApi } from "./aiInspiration";
3
4
  import { PluginPresentationSheetsApi } from "./sheets";
4
5
  import { PluginPresentationDiagramsApi } from "./diagrams";
6
+ import { PluginPresentationAnnotateApi } from "./annotate";
5
7
  import { PluginPresentationImportApi } from "./import";
8
+ import { PluginPresentationExportResult, type PluginPresentationExportFormat, type PluginPresentationExportResolution } from "./export";
6
9
  /**
7
10
  * Presentation APIs — prepare and assemble presentations.
8
11
  *
@@ -28,6 +31,8 @@ export declare abstract class PluginPresentationApi {
28
31
  abstract sheets: PluginPresentationSheetsApi;
29
32
  /** Program/adjacency/site diagrams — place images on sheets. See {@linkcode PluginPresentationDiagramsApi}. */
30
33
  abstract diagrams: PluginPresentationDiagramsApi;
34
+ /** Annotations on Present-mode sheets — text/arrows/notes/geo shapes. See {@linkcode PluginPresentationAnnotateApi}. */
35
+ abstract annotate: PluginPresentationAnnotateApi;
31
36
  /** Import reference images/PDFs onto the Present canvas. See {@linkcode PluginPresentationImportApi}. */
32
37
  abstract import: PluginPresentationImportApi;
33
38
  /**
@@ -35,11 +40,44 @@ export declare abstract class PluginPresentationApi {
35
40
  * {@linkcode PluginPresentationAIInspirationApi}.
36
41
  */
37
42
  abstract aiInspiration: PluginPresentationAIInspirationApi;
43
+ /**
44
+ * Export the presentation's layout sheets to a downloadable file (PDF / PNG /
45
+ * JPG) and return the encoded bytes as base64. Wraps the Present-mode Export
46
+ * dialog pipeline headlessly. Requires Present mode to be open.
47
+ *
48
+ * @param format - Output format: `"pdf"`, `"png"`, or `"jpg"`.
49
+ * @param options - Optional `sheetIds` (all sheets when omitted), `combine`
50
+ * (PDF only — one multi-page file vs one per sheet, default `true`),
51
+ * `resolution` (raster target size for `png`/`jpg`), and `fileName`.
52
+ * @returns A {@linkcode PluginPresentationExportResult} — always a `files`
53
+ * array (one entry for a combined PDF, one per sheet otherwise).
54
+ * @throws If Present mode is not open, a `sheetId` is unknown, or a sheet
55
+ * fails to serialize/encode.
56
+ *
57
+ * @examplePrompt Export the presentation as a PDF
58
+ * @examplePrompt Download all sheets as a single PDF
59
+ * @examplePrompt Export sheet 1 as a PNG
60
+ * @examplePrompt Save the presentation sheets as JPG images
61
+ * @examplePrompt Export these sheets to PDF at high resolution
62
+ *
63
+ * # Example
64
+ * ```ts
65
+ * const { files } = await snaptrude.presentation.export("pdf")
66
+ * ```
67
+ */
68
+ abstract export(format: PluginPresentationExportFormat, options?: {
69
+ sheetIds?: string[];
70
+ combine?: boolean;
71
+ resolution?: PluginPresentationExportResolution;
72
+ fileName?: string;
73
+ }): PluginApiReturn<PluginPresentationExportResult>;
38
74
  constructor();
39
75
  }
40
76
  export * from "./views";
41
77
  export * from "./sheets";
42
78
  export * from "./diagrams";
79
+ export * from "./annotate";
43
80
  export * from "./import";
44
81
  export * from "./aiInspiration";
82
+ export * from "./export";
45
83
  //# 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,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,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,6BAA6B,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EACL,8BAA8B,EAC9B,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACxC,MAAM,UAAU,CAAA;AAEjB;;;;;;;;;;;;;;;;;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,wHAAwH;IACxH,SAAgB,QAAQ,EAAE,6BAA6B,CAAA;IACvD,yGAAyG;IACzG,SAAgB,MAAM,EAAE,2BAA2B,CAAA;IACnD;;;OAGG;IACH,SAAgB,aAAa,EAAE,kCAAkC,CAAA;IAEjE;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;aACa,MAAM,CACpB,MAAM,EAAE,8BAA8B,EACtC,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;QACnB,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,UAAU,CAAC,EAAE,kCAAkC,CAAA;QAC/C,QAAQ,CAAC,EAAE,MAAM,CAAA;KAClB,GACA,eAAe,CAAC,8BAA8B,CAAC;;CAGnD;AAED,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA"}