@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.
- package/CHANGELOG.md +152 -1
- package/api-manifest.json +3620 -276
- package/dist/api/analysis/daylight.d.ts +603 -0
- package/dist/api/analysis/daylight.d.ts.map +1 -0
- package/dist/api/analysis/heatmaps.d.ts +658 -0
- package/dist/api/analysis/heatmaps.d.ts.map +1 -0
- package/dist/api/analysis/illuminance.d.ts +145 -0
- package/dist/api/analysis/illuminance.d.ts.map +1 -0
- package/dist/api/analysis/index.d.ts +59 -0
- package/dist/api/analysis/index.d.ts.map +1 -0
- package/dist/api/analysis/shadows.d.ts +165 -0
- package/dist/api/analysis/shadows.d.ts.map +1 -0
- package/dist/api/analysis/solar.d.ts +249 -0
- package/dist/api/analysis/solar.d.ts.map +1 -0
- package/dist/api/analysis/sunlightHours.d.ts +208 -0
- package/dist/api/analysis/sunlightHours.d.ts.map +1 -0
- package/dist/api/analysis/sunpath.d.ts +80 -0
- package/dist/api/analysis/sunpath.d.ts.map +1 -0
- package/dist/api/analysis/weather.d.ts +193 -0
- package/dist/api/analysis/weather.d.ts.map +1 -0
- package/dist/api/core/camera/index.d.ts +261 -0
- package/dist/api/core/camera/index.d.ts.map +1 -0
- package/dist/api/core/comment/index.d.ts +105 -2
- package/dist/api/core/comment/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +840 -14
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/delete/index.d.ts +8 -2
- package/dist/api/core/geom/delete/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/arc.d.ts +5 -5
- package/dist/api/core/geom/query/brep.d.ts +130 -18
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/circle.d.ts +18 -18
- package/dist/api/core/geom/query/contour.d.ts +20 -20
- package/dist/api/core/geom/query/curve.d.ts +49 -49
- package/dist/api/core/geom/query/edge.d.ts +5 -5
- package/dist/api/core/geom/query/face.d.ts +16 -16
- package/dist/api/core/geom/query/halfedge.d.ts +8 -8
- package/dist/api/core/geom/query/profile.d.ts +19 -19
- package/dist/api/core/geom/query/vertex.d.ts +8 -8
- package/dist/api/core/geom/update/contour.d.ts +14 -14
- package/dist/api/core/geom/update/curve.d.ts +7 -7
- package/dist/api/core/geom/update/profile.d.ts +16 -16
- package/dist/api/core/handles/index.d.ts +210 -0
- package/dist/api/core/handles/index.d.ts.map +1 -0
- package/dist/api/core/index.d.ts +34 -0
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/export/index.d.ts +134 -0
- package/dist/api/core/io/export/index.d.ts.map +1 -0
- package/dist/api/core/io/import/index.d.ts +453 -0
- package/dist/api/core/io/import/index.d.ts.map +1 -0
- package/dist/api/core/io/index.d.ts +40 -0
- package/dist/api/core/io/index.d.ts.map +1 -0
- package/dist/api/core/io/job/index.d.ts +139 -0
- package/dist/api/core/io/job/index.d.ts.map +1 -0
- package/dist/api/core/io/query/index.d.ts +74 -0
- package/dist/api/core/io/query/index.d.ts.map +1 -0
- package/dist/api/core/io/terrain/index.d.ts +341 -0
- package/dist/api/core/io/terrain/index.d.ts.map +1 -0
- package/dist/api/core/io/underlay/index.d.ts +805 -0
- package/dist/api/core/io/underlay/index.d.ts.map +1 -0
- package/dist/api/core/layers.d.ts +7 -7
- package/dist/api/core/mode/index.d.ts +99 -0
- package/dist/api/core/mode/index.d.ts.map +1 -0
- package/dist/api/core/project/index.d.ts +68 -1
- package/dist/api/core/project/index.d.ts.map +1 -1
- package/dist/api/core/proposals/index.d.ts +531 -0
- package/dist/api/core/proposals/index.d.ts.map +1 -0
- package/dist/api/core/storeys/index.d.ts +265 -0
- package/dist/api/core/storeys/index.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +24 -0
- package/dist/api/core/tags.d.ts.map +1 -1
- package/dist/api/core/user.d.ts +44 -0
- package/dist/api/core/user.d.ts.map +1 -0
- package/dist/api/core/zoom/index.d.ts +4 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -1
- package/dist/api/design/boolean/index.d.ts +4 -4
- package/dist/api/design/create/index.d.ts +568 -45
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/delete/index.d.ts +3 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/doors/index.d.ts +195 -0
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/edit/index.d.ts +1 -1
- package/dist/api/design/erase/index.d.ts +2 -2
- package/dist/api/design/family.d.ts +349 -0
- package/dist/api/design/family.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +181 -8
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/index.d.ts +98 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/lock.d.ts +26 -0
- package/dist/api/design/lock.d.ts.map +1 -1
- package/dist/api/design/materials/index.d.ts +270 -16
- package/dist/api/design/materials/index.d.ts.map +1 -1
- package/dist/api/design/query/geometry/index.d.ts +112 -0
- package/dist/api/design/query/geometry/index.d.ts.map +1 -1
- package/dist/api/design/query/index.d.ts +282 -11
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/referenceLines.d.ts +45 -0
- package/dist/api/design/query/referenceLines.d.ts.map +1 -0
- package/dist/api/design/query/spaces.d.ts +181 -8
- package/dist/api/design/query/spaces.d.ts.map +1 -1
- package/dist/api/design/selection/index.d.ts +144 -0
- package/dist/api/design/selection/index.d.ts.map +1 -1
- package/dist/api/design/transform/index.d.ts +172 -10
- package/dist/api/design/transform/index.d.ts.map +1 -1
- package/dist/api/design/types/index.d.ts +181 -0
- package/dist/api/design/types/index.d.ts.map +1 -0
- package/dist/api/design/update/index.d.ts +553 -2
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/visibility.d.ts +126 -0
- package/dist/api/design/visibility.d.ts.map +1 -0
- package/dist/api/design/windows/index.d.ts +113 -2
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/entity/buildableEnvelope.d.ts +4 -0
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +10 -2
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +21 -21
- package/dist/api/entity/story.d.ts +242 -15
- package/dist/api/entity/story.d.ts.map +1 -1
- package/dist/api/index.d.ts +10 -0
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/presentation/aiInspiration.d.ts +25 -25
- package/dist/api/presentation/annotate.d.ts +467 -0
- package/dist/api/presentation/annotate.d.ts.map +1 -0
- package/dist/api/presentation/diagrams.d.ts +111 -8
- package/dist/api/presentation/diagrams.d.ts.map +1 -1
- package/dist/api/presentation/export.d.ts +108 -0
- package/dist/api/presentation/export.d.ts.map +1 -0
- package/dist/api/presentation/import.d.ts +55 -4
- package/dist/api/presentation/import.d.ts.map +1 -1
- package/dist/api/presentation/index.d.ts +58 -1
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +1139 -0
- package/dist/api/presentation/placedViews.d.ts.map +1 -0
- package/dist/api/presentation/shapes.d.ts +481 -0
- package/dist/api/presentation/shapes.d.ts.map +1 -0
- package/dist/api/presentation/sheets.d.ts +452 -13
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/slideshow.d.ts +125 -0
- package/dist/api/presentation/slideshow.d.ts.map +1 -0
- package/dist/api/presentation/tables.d.ts +81 -0
- package/dist/api/presentation/tables.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +367 -7
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/program/areas.d.ts +102 -12
- package/dist/api/program/areas.d.ts.map +1 -1
- package/dist/api/program/cores.d.ts +3 -99
- package/dist/api/program/cores.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +7 -15
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/layout.d.ts +346 -11
- package/dist/api/program/layout.d.ts.map +1 -1
- package/dist/api/program/site.d.ts +469 -13
- package/dist/api/program/site.d.ts.map +1 -1
- package/dist/api/program/spreadsheet.d.ts +365 -41
- package/dist/api/program/spreadsheet.d.ts.map +1 -1
- package/dist/api/workspace/index.d.ts +505 -0
- package/dist/api/workspace/index.d.ts.map +1 -0
- package/dist/errors/codes.d.ts +34 -0
- package/dist/errors/codes.d.ts.map +1 -0
- package/dist/errors/envelope.d.ts +56 -0
- package/dist/errors/envelope.d.ts.map +1 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/plugin-error.d.ts +69 -0
- package/dist/errors/plugin-error.d.ts.map +1 -0
- package/dist/handles.d.ts +97 -25
- package/dist/handles.d.ts.map +1 -1
- package/dist/host-utils.d.ts +4 -0
- package/dist/host-utils.d.ts.map +1 -1
- package/dist/index.cjs +4582 -1422
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4171 -1411
- package/dist/index.js.map +1 -1
- package/package.json +4 -2
- package/scripts/generate-manifest.mjs +45 -0
- package/scripts/generate-manifest.test.mjs +103 -4
- package/src/api/analysis/daylight.ts +470 -0
- package/src/api/analysis/heatmaps.ts +683 -0
- package/src/api/analysis/illuminance.ts +155 -0
- package/src/api/analysis/index.ts +61 -0
- package/src/api/analysis/shadows.ts +183 -0
- package/src/api/analysis/solar.ts +237 -0
- package/src/api/analysis/sunlightHours.ts +211 -0
- package/src/api/analysis/sunpath.ts +83 -0
- package/src/api/analysis/weather.ts +179 -0
- package/src/api/core/camera/index.ts +268 -0
- package/src/api/core/comment/index.ts +120 -2
- package/src/api/core/geom/create/index.ts +912 -1
- package/src/api/core/geom/delete/index.ts +6 -0
- package/src/api/core/geom/query/brep.ts +119 -0
- package/src/api/core/handles/index.ts +233 -0
- package/src/api/core/index.ts +34 -0
- package/src/api/core/io/export/index.ts +126 -0
- package/src/api/core/io/import/index.ts +496 -0
- package/src/api/core/io/index.ts +42 -0
- package/src/api/core/io/job/index.ts +140 -0
- package/src/api/core/io/query/index.ts +71 -0
- package/src/api/core/io/terrain/index.ts +360 -0
- package/src/api/core/io/underlay/index.ts +705 -0
- package/src/api/core/mode/index.ts +96 -0
- package/src/api/core/project/index.ts +62 -1
- package/src/api/core/proposals/index.ts +569 -0
- package/src/api/core/storeys/index.ts +294 -0
- package/src/api/core/tags.ts +27 -0
- package/src/api/core/user.ts +46 -0
- package/src/api/core/zoom/index.ts +4 -0
- package/src/api/design/create/index.ts +670 -30
- package/src/api/design/delete/index.ts +3 -0
- package/src/api/design/doors/index.ts +208 -0
- package/src/api/design/erase/index.ts +1 -1
- package/src/api/design/family.ts +388 -0
- package/src/api/design/furniture/index.ts +197 -8
- package/src/api/design/index.ts +102 -0
- package/src/api/design/lock.ts +27 -0
- package/src/api/design/materials/index.ts +334 -27
- package/src/api/design/query/geometry/index.ts +125 -3
- package/src/api/design/query/index.ts +217 -7
- package/src/api/design/query/referenceLines.ts +52 -0
- package/src/api/design/query/spaces.ts +143 -0
- package/src/api/design/selection/index.ts +129 -0
- package/src/api/design/transform/index.ts +170 -9
- package/src/api/design/types/index.ts +156 -0
- package/src/api/design/update/index.ts +631 -3
- package/src/api/design/visibility.ts +143 -0
- package/src/api/design/windows/index.ts +128 -2
- package/src/api/entity/buildableEnvelope.ts +4 -0
- package/src/api/entity/referenceLine.ts +8 -0
- package/src/api/entity/story.ts +259 -15
- package/src/api/index.ts +10 -0
- package/src/api/presentation/annotate.ts +385 -0
- package/src/api/presentation/diagrams.ts +118 -8
- package/src/api/presentation/export.ts +108 -0
- package/src/api/presentation/import.ts +51 -4
- package/src/api/presentation/index.ts +66 -1
- package/src/api/presentation/placedViews.ts +1120 -0
- package/src/api/presentation/shapes.ts +274 -0
- package/src/api/presentation/sheets.ts +400 -13
- package/src/api/presentation/slideshow.ts +134 -0
- package/src/api/presentation/tables.ts +84 -0
- package/src/api/presentation/views.ts +376 -8
- package/src/api/program/areas.ts +88 -15
- package/src/api/program/cores.ts +3 -91
- package/src/api/program/index.ts +7 -15
- package/src/api/program/layout.ts +365 -11
- package/src/api/program/site.ts +435 -13
- package/src/api/program/spreadsheet.ts +376 -35
- package/src/api/workspace/index.ts +563 -0
- package/src/errors/codes.ts +136 -0
- package/src/errors/envelope.ts +75 -0
- package/src/errors/index.ts +21 -0
- package/src/errors/plugin-error.ts +134 -0
- package/src/handles.ts +123 -13
- package/src/host-utils.ts +4 -0
- package/src/index.ts +1 -0
- package/test/errors.test.mjs +184 -0
- package/tsconfig.json +7 -2
|
@@ -4,9 +4,10 @@ import { PluginApiReturn } from "../../types"
|
|
|
4
4
|
/**
|
|
5
5
|
* Presentation import — bring external reference assets onto the Present canvas.
|
|
6
6
|
*
|
|
7
|
-
* `import.image` places a reference image
|
|
8
|
-
* page vectorized to SVG)
|
|
9
|
-
*
|
|
7
|
+
* `import.image` places a reference image, `import.pdf` places a PDF (each
|
|
8
|
+
* page vectorized to SVG), and `import.svg` places a validated SVG onto
|
|
9
|
+
* the current Present sheet, returning the created canvas shape ids. Requires
|
|
10
|
+
* Present mode to be open.
|
|
10
11
|
*
|
|
11
12
|
* The host engine takes a browser `File`, which a plugin worker cannot supply,
|
|
12
13
|
* so these accept a `url`/`dataUrl` that the host adapts into a `File`.
|
|
@@ -19,6 +20,9 @@ export abstract class PluginPresentationImportApi {
|
|
|
19
20
|
/**
|
|
20
21
|
* Import a reference image onto the current Present sheet.
|
|
21
22
|
*
|
|
23
|
+
* To place the image as a **scene** underlay to trace over — on a storey,
|
|
24
|
+
* not the Present canvas — use `core.io.import.image` instead.
|
|
25
|
+
*
|
|
22
26
|
* @param source - The asset to import: exactly one of `url` or `dataUrl`.
|
|
23
27
|
* @param options - Optional `position` — where to place the image on the
|
|
24
28
|
* sheet.
|
|
@@ -49,6 +53,9 @@ export abstract class PluginPresentationImportApi {
|
|
|
49
53
|
*
|
|
50
54
|
* Each page is converted to vector SVG and placed as a canvas shape.
|
|
51
55
|
*
|
|
56
|
+
* To bring the PDF into the **scene** as a traceable underlay — on a storey,
|
|
57
|
+
* not the Present canvas — use `core.io.import.pdf` instead.
|
|
58
|
+
*
|
|
52
59
|
* @param source - The asset to import: exactly one of `url` or `dataUrl`.
|
|
53
60
|
* @param options - Optional `position` — where to place the pages on the
|
|
54
61
|
* sheet.
|
|
@@ -72,11 +79,51 @@ export abstract class PluginPresentationImportApi {
|
|
|
72
79
|
source: { url?: string; dataUrl?: string },
|
|
73
80
|
options?: { position?: { x: number; y: number } },
|
|
74
81
|
): PluginApiReturn<PluginPresentationImportResult>
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Import an SVG onto the current Present sheet as a vector asset.
|
|
85
|
+
*
|
|
86
|
+
* An SVG-validating variant of {@linkcode PluginPresentationImportApi.image}:
|
|
87
|
+
* `import.image` already passes SVG sources through, but this method first
|
|
88
|
+
* validates that the source really is an SVG and forces the vector mime
|
|
89
|
+
* type. Throws if the source is not an SVG.
|
|
90
|
+
*
|
|
91
|
+
* **Rendering is vector up to a complexity cap.** Simple SVGs (up to ~1500
|
|
92
|
+
* SVG element nodes and ~2 MB) render true-vector and stay crisp at every
|
|
93
|
+
* zoom. Beyond that cap the shared canvas renderer **intentionally falls
|
|
94
|
+
* back to a 1920px raster** to protect canvas performance, so very complex
|
|
95
|
+
* SVGs can look rasterized when zoomed in. The stored asset is the original
|
|
96
|
+
* SVG either way; only the on-canvas rendering falls back.
|
|
97
|
+
*
|
|
98
|
+
* @param source - The SVG to import: exactly one of `url` or `dataUrl`.
|
|
99
|
+
* @param options - Optional `position` — where to place the SVG on the sheet.
|
|
100
|
+
* @returns A {@linkcode PluginPresentationImportResult} with the created
|
|
101
|
+
* `shapeIds`.
|
|
102
|
+
* @throws If Present mode is not open, the source is not an SVG, or it cannot
|
|
103
|
+
* be loaded.
|
|
104
|
+
*
|
|
105
|
+
* @examplePrompt Import this SVG diagram onto the present canvas
|
|
106
|
+
* @examplePrompt Add a vector logo to my presentation board
|
|
107
|
+
* @examplePrompt Place this SVG floor plan on the current sheet as vectors
|
|
108
|
+
* @examplePrompt Bring a crisp vector graphic into Present mode
|
|
109
|
+
*
|
|
110
|
+
* # Example
|
|
111
|
+
* ```ts
|
|
112
|
+
* const { shapeIds } = await snaptrude.presentation.import.svg({
|
|
113
|
+
* url: "https://example.com/diagram.svg",
|
|
114
|
+
* })
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
public abstract svg(
|
|
118
|
+
source: { url?: string; dataUrl?: string },
|
|
119
|
+
options?: { position?: { x: number; y: number } },
|
|
120
|
+
): PluginApiReturn<PluginPresentationImportResult>
|
|
75
121
|
}
|
|
76
122
|
|
|
77
123
|
/**
|
|
78
124
|
* Arguments for {@linkcode PluginPresentationImportApi.image} /
|
|
79
|
-
* {@linkcode PluginPresentationImportApi.pdf}
|
|
125
|
+
* {@linkcode PluginPresentationImportApi.pdf} /
|
|
126
|
+
* {@linkcode PluginPresentationImportApi.svg}. Provide exactly one source.
|
|
80
127
|
*
|
|
81
128
|
* | Property | Type | Description |
|
|
82
129
|
* |---|---|---|
|
|
@@ -1,8 +1,19 @@
|
|
|
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 {
|
|
13
|
+
PluginPresentationExportResult,
|
|
14
|
+
type PluginPresentationExportFormat,
|
|
15
|
+
type PluginPresentationExportResolution,
|
|
16
|
+
} from "./export"
|
|
6
17
|
|
|
7
18
|
/**
|
|
8
19
|
* Presentation APIs — prepare and assemble presentations.
|
|
@@ -16,7 +27,10 @@ import { PluginPresentationImportApi } from "./import"
|
|
|
16
27
|
*
|
|
17
28
|
* - {@linkcode PluginPresentationApi.views} — Saved 2D/3D views (list, get, capture, activate, create)
|
|
18
29
|
* - {@linkcode PluginPresentationApi.sheets} — Layout sheets (list, get, create, place views)
|
|
19
|
-
* - {@linkcode PluginPresentationApi.
|
|
30
|
+
* - {@linkcode PluginPresentationApi.placedViews} — Views already placed on the canvas (move, scale, crop)
|
|
31
|
+
* - {@linkcode PluginPresentationApi.diagrams} — Generate program/site diagram sheets, place diagram images
|
|
32
|
+
* - {@linkcode PluginPresentationApi.tables} — Place data tables on sheets
|
|
33
|
+
* - {@linkcode PluginPresentationApi.slideshow} — Run the Present-mode slideshow
|
|
20
34
|
* - {@linkcode PluginPresentationApi.import} — Import reference images/PDFs onto the canvas
|
|
21
35
|
* - {@linkcode PluginPresentationApi.aiInspiration} — Present-mode AI image/video generation
|
|
22
36
|
*
|
|
@@ -27,8 +41,18 @@ export abstract class PluginPresentationApi {
|
|
|
27
41
|
public abstract views: PluginPresentationViewsApi
|
|
28
42
|
/** Layout sheets — list/get/create and place views (Present mode). See {@linkcode PluginPresentationSheetsApi}. */
|
|
29
43
|
public abstract sheets: PluginPresentationSheetsApi
|
|
44
|
+
/** Placed views — layout of the view shapes on the canvas: move/scale/setScale/setCrop (Present mode). See {@linkcode PluginPresentationPlacedViewsApi}. */
|
|
45
|
+
public abstract placedViews: PluginPresentationPlacedViewsApi
|
|
30
46
|
/** Program/adjacency/site diagrams — place images on sheets. See {@linkcode PluginPresentationDiagramsApi}. */
|
|
31
47
|
public abstract diagrams: PluginPresentationDiagramsApi
|
|
48
|
+
/** Annotations on Present-mode sheets — text/arrows/notes/geo shapes. See {@linkcode PluginPresentationAnnotateApi}. */
|
|
49
|
+
public abstract annotate: PluginPresentationAnnotateApi
|
|
50
|
+
/** Plugin-owned keyed shapes — upsert/remove/list so reruns update instead of duplicating. See {@linkcode PluginPresentationShapesApi}. */
|
|
51
|
+
public abstract shapes: PluginPresentationShapesApi
|
|
52
|
+
/** Data tables on Present sheets — place string rows as a table shape. See {@linkcode PluginPresentationTablesApi}. */
|
|
53
|
+
public abstract tables: PluginPresentationTablesApi
|
|
54
|
+
/** The Present-mode slideshow — start/stop/getState. See {@linkcode PluginPresentationSlideshowApi}. */
|
|
55
|
+
public abstract slideshow: PluginPresentationSlideshowApi
|
|
32
56
|
/** Import reference images/PDFs onto the Present canvas. See {@linkcode PluginPresentationImportApi}. */
|
|
33
57
|
public abstract import: PluginPresentationImportApi
|
|
34
58
|
/**
|
|
@@ -37,11 +61,52 @@ export abstract class PluginPresentationApi {
|
|
|
37
61
|
*/
|
|
38
62
|
public abstract aiInspiration: PluginPresentationAIInspirationApi
|
|
39
63
|
|
|
64
|
+
/**
|
|
65
|
+
* Export the presentation's layout sheets to a downloadable file (PDF / PNG /
|
|
66
|
+
* JPG) and return the encoded bytes as base64. Wraps the Present-mode Export
|
|
67
|
+
* dialog pipeline headlessly. Requires Present mode to be open.
|
|
68
|
+
*
|
|
69
|
+
* @param format - Output format: `"pdf"`, `"png"`, or `"jpg"`.
|
|
70
|
+
* @param options - Optional `sheetIds` (all sheets when omitted), `combine`
|
|
71
|
+
* (PDF only — one multi-page file vs one per sheet, default `true`),
|
|
72
|
+
* `resolution` (raster target size for `png`/`jpg`), and `fileName`.
|
|
73
|
+
* @returns A {@linkcode PluginPresentationExportResult} — always a `files`
|
|
74
|
+
* array (one entry for a combined PDF, one per sheet otherwise).
|
|
75
|
+
* @throws If Present mode is not open, a `sheetId` is unknown, or a sheet
|
|
76
|
+
* fails to serialize/encode.
|
|
77
|
+
*
|
|
78
|
+
* @examplePrompt Export the presentation as a PDF
|
|
79
|
+
* @examplePrompt Download all sheets as a single PDF
|
|
80
|
+
* @examplePrompt Export sheet 1 as a PNG
|
|
81
|
+
* @examplePrompt Save the presentation sheets as JPG images
|
|
82
|
+
* @examplePrompt Export these sheets to PDF at high resolution
|
|
83
|
+
*
|
|
84
|
+
* # Example
|
|
85
|
+
* ```ts
|
|
86
|
+
* const { files } = await snaptrude.presentation.export("pdf")
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
public abstract export(
|
|
90
|
+
format: PluginPresentationExportFormat,
|
|
91
|
+
options?: {
|
|
92
|
+
sheetIds?: string[]
|
|
93
|
+
combine?: boolean
|
|
94
|
+
resolution?: PluginPresentationExportResolution
|
|
95
|
+
fileName?: string
|
|
96
|
+
},
|
|
97
|
+
): PluginApiReturn<PluginPresentationExportResult>
|
|
98
|
+
|
|
40
99
|
constructor() {}
|
|
41
100
|
}
|
|
42
101
|
|
|
43
102
|
export * from "./views"
|
|
44
103
|
export * from "./sheets"
|
|
104
|
+
export * from "./placedViews"
|
|
45
105
|
export * from "./diagrams"
|
|
106
|
+
export * from "./annotate"
|
|
107
|
+
export * from "./shapes"
|
|
108
|
+
export * from "./tables"
|
|
109
|
+
export * from "./slideshow"
|
|
46
110
|
export * from "./import"
|
|
47
111
|
export * from "./aiInspiration"
|
|
112
|
+
export * from "./export"
|