@snaptrude/plugin-core 0.10.0 → 1.0.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.
- package/AGENTS.md +4 -0
- package/CHANGELOG.md +187 -3
- package/api-manifest.json +929 -25
- package/dist/api/analysis/daylight.d.ts +5 -5
- package/dist/api/analysis/solar.d.ts +2 -2
- package/dist/api/core/camera/index.d.ts +463 -0
- package/dist/api/core/camera/index.d.ts.map +1 -1
- package/dist/api/core/geom/create/index.d.ts +942 -101
- package/dist/api/core/geom/create/index.d.ts.map +1 -1
- package/dist/api/core/geom/query/brep.d.ts +59 -2
- package/dist/api/core/geom/query/brep.d.ts.map +1 -1
- package/dist/api/core/geom/query/curve.d.ts +59 -35
- package/dist/api/core/geom/query/curve.d.ts.map +1 -1
- package/dist/api/core/geom/query/edge.d.ts +2 -2
- package/dist/api/core/geom/query/face.d.ts +105 -0
- package/dist/api/core/geom/query/face.d.ts.map +1 -1
- package/dist/api/core/geom/update/contour.d.ts +10 -2
- package/dist/api/core/geom/update/contour.d.ts.map +1 -1
- package/dist/api/core/geom/update/curve.d.ts +5 -5
- package/dist/api/core/geom/update/profile.d.ts +3 -1
- package/dist/api/core/geom/update/profile.d.ts.map +1 -1
- package/dist/api/core/handles/index.d.ts +4 -2
- package/dist/api/core/handles/index.d.ts.map +1 -1
- package/dist/api/core/index.d.ts +4 -4
- package/dist/api/core/index.d.ts.map +1 -1
- package/dist/api/core/io/import/index.d.ts +3 -1
- package/dist/api/core/io/import/index.d.ts.map +1 -1
- package/dist/api/core/layers.d.ts +377 -255
- package/dist/api/core/layers.d.ts.map +1 -1
- package/dist/api/core/mode/index.d.ts +19 -7
- package/dist/api/core/mode/index.d.ts.map +1 -1
- 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 +4 -3
- package/dist/api/core/proposals/index.d.ts.map +1 -1
- package/dist/api/core/storeys/index.d.ts +31 -2
- package/dist/api/core/storeys/index.d.ts.map +1 -1
- package/dist/api/core/storeys/layers.d.ts +408 -0
- package/dist/api/core/storeys/layers.d.ts.map +1 -0
- package/dist/api/core/tags.d.ts +84 -3
- package/dist/api/core/tags.d.ts.map +1 -1
- package/dist/api/core/zoom/index.d.ts +13 -0
- package/dist/api/core/zoom/index.d.ts.map +1 -1
- package/dist/api/design/bim.d.ts +299 -0
- package/dist/api/design/bim.d.ts.map +1 -0
- package/dist/api/design/boolean/index.d.ts +2 -0
- package/dist/api/design/boolean/index.d.ts.map +1 -1
- package/dist/api/design/catalog.d.ts +320 -0
- package/dist/api/design/catalog.d.ts.map +1 -0
- package/dist/api/design/create/bulk-items.d.ts +269 -0
- package/dist/api/design/create/bulk-items.d.ts.map +1 -0
- package/dist/api/design/create/grids.d.ts +132 -0
- package/dist/api/design/create/grids.d.ts.map +1 -0
- package/dist/api/design/create/index.d.ts +752 -78
- package/dist/api/design/create/index.d.ts.map +1 -1
- package/dist/api/design/create/opening-fields.d.ts +38 -0
- package/dist/api/design/create/opening-fields.d.ts.map +1 -0
- package/dist/api/design/delete/index.d.ts +5 -0
- package/dist/api/design/delete/index.d.ts.map +1 -1
- package/dist/api/design/dimensions.d.ts +427 -0
- package/dist/api/design/dimensions.d.ts.map +1 -0
- package/dist/api/design/doors/index.d.ts +24 -23
- package/dist/api/design/doors/index.d.ts.map +1 -1
- package/dist/api/design/family.d.ts +1446 -0
- package/dist/api/design/family.d.ts.map +1 -0
- package/dist/api/design/furniture/index.d.ts +33 -0
- package/dist/api/design/furniture/index.d.ts.map +1 -1
- package/dist/api/design/grids.d.ts +237 -0
- package/dist/api/design/grids.d.ts.map +1 -0
- package/dist/api/design/index.d.ts +30 -0
- package/dist/api/design/index.d.ts.map +1 -1
- package/dist/api/design/networks.d.ts +1703 -0
- package/dist/api/design/networks.d.ts.map +1 -0
- package/dist/api/design/query/geometry/index.d.ts +33 -5
- package/dist/api/design/query/geometry/index.d.ts.map +1 -1
- package/dist/api/design/query/grids.d.ts +287 -0
- package/dist/api/design/query/grids.d.ts.map +1 -0
- package/dist/api/design/query/index.d.ts +143 -34
- package/dist/api/design/query/index.d.ts.map +1 -1
- package/dist/api/design/query/spaces.d.ts +5 -5
- package/dist/api/design/selection/index.d.ts +12 -12
- package/dist/api/design/types/index.d.ts +40 -24
- package/dist/api/design/types/index.d.ts.map +1 -1
- package/dist/api/design/update/index.d.ts +412 -8
- package/dist/api/design/update/index.d.ts.map +1 -1
- package/dist/api/design/visibility.d.ts +28 -0
- package/dist/api/design/visibility.d.ts.map +1 -1
- package/dist/api/design/windows/index.d.ts +8 -8
- package/dist/api/design/windows/index.d.ts.map +1 -1
- package/dist/api/entity/buildableEnvelope.d.ts +84 -2
- package/dist/api/entity/buildableEnvelope.d.ts.map +1 -1
- package/dist/api/entity/referenceLine.d.ts +13 -1
- package/dist/api/entity/referenceLine.d.ts.map +1 -1
- package/dist/api/entity/space.d.ts +12 -12
- package/dist/api/entity/story.d.ts +4 -4
- package/dist/api/presentation/aiInspiration.d.ts +24 -24
- package/dist/api/presentation/annotate.d.ts +38 -22
- package/dist/api/presentation/annotate.d.ts.map +1 -1
- package/dist/api/presentation/camera.d.ts +265 -0
- package/dist/api/presentation/camera.d.ts.map +1 -0
- package/dist/api/presentation/drawingContract.d.ts +32 -0
- package/dist/api/presentation/drawingContract.d.ts.map +1 -0
- package/dist/api/presentation/drawings.d.ts +3523 -0
- package/dist/api/presentation/drawings.d.ts.map +1 -0
- package/dist/api/presentation/export.d.ts +23 -5
- package/dist/api/presentation/export.d.ts.map +1 -1
- package/dist/api/presentation/graphics.d.ts +419 -0
- package/dist/api/presentation/graphics.d.ts.map +1 -0
- package/dist/api/presentation/index.d.ts +66 -12
- package/dist/api/presentation/index.d.ts.map +1 -1
- package/dist/api/presentation/placedViews.d.ts +116 -16
- package/dist/api/presentation/placedViews.d.ts.map +1 -1
- package/dist/api/presentation/sections.d.ts +461 -0
- package/dist/api/presentation/sections.d.ts.map +1 -0
- package/dist/api/presentation/shapes.d.ts +2 -2
- package/dist/api/presentation/sheets.d.ts +175 -19
- package/dist/api/presentation/sheets.d.ts.map +1 -1
- package/dist/api/presentation/standards.d.ts +590 -0
- package/dist/api/presentation/standards.d.ts.map +1 -0
- package/dist/api/presentation/viewPresets.d.ts +222 -0
- package/dist/api/presentation/viewPresets.d.ts.map +1 -0
- package/dist/api/presentation/views.d.ts +144 -9
- package/dist/api/presentation/views.d.ts.map +1 -1
- package/dist/api/presentation/walkthroughs.d.ts +1350 -0
- package/dist/api/presentation/walkthroughs.d.ts.map +1 -0
- package/dist/api/program/departments.d.ts +58 -2
- package/dist/api/program/departments.d.ts.map +1 -1
- package/dist/api/program/index.d.ts +16 -6
- package/dist/api/program/index.d.ts.map +1 -1
- package/dist/api/program/labels.d.ts +355 -0
- package/dist/api/program/labels.d.ts.map +1 -0
- package/dist/api/program/metadata.d.ts +328 -0
- package/dist/api/program/metadata.d.ts.map +1 -0
- package/dist/api/program/site.d.ts +4 -4
- package/dist/api/program/spreadsheet.d.ts +267 -4
- package/dist/api/program/spreadsheet.d.ts.map +1 -1
- package/dist/api/workspace/index.d.ts +49 -2
- package/dist/api/workspace/index.d.ts.map +1 -1
- package/dist/errors/codes.d.ts +3 -1
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/handles.d.ts +32 -3
- package/dist/handles.d.ts.map +1 -1
- package/dist/index.cjs +6539 -2804
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6121 -2801
- package/dist/index.js.map +1 -1
- package/dist/massParameters.d.ts +287 -0
- package/dist/massParameters.d.ts.map +1 -0
- package/dist/massParameters.ops.d.ts +138 -0
- package/dist/massParameters.ops.d.ts.map +1 -0
- package/package.json +14 -13
- package/scripts/check-dist-fresh.mjs +22 -0
- package/scripts/generate-manifest.mjs +5 -0
- package/scripts/generate-manifest.test.mjs +14 -3
- package/src/api/core/camera/index.ts +446 -1
- package/src/api/core/geom/create/index.ts +1037 -102
- package/src/api/core/geom/query/brep.ts +60 -2
- package/src/api/core/geom/query/curve.ts +26 -2
- package/src/api/core/geom/query/edge.ts +2 -2
- package/src/api/core/geom/query/face.ts +109 -4
- package/src/api/core/geom/update/contour.ts +10 -2
- package/src/api/core/geom/update/profile.ts +2 -0
- package/src/api/core/handles/index.ts +3 -2
- package/src/api/core/index.ts +4 -4
- package/src/api/core/io/import/index.ts +11 -3
- package/src/api/core/layers.ts +380 -173
- package/src/api/core/mode/index.ts +19 -7
- package/src/api/core/project/index.ts +62 -1
- package/src/api/core/proposals/index.ts +4 -3
- package/src/api/core/storeys/index.ts +34 -2
- package/src/api/core/storeys/layers.ts +339 -0
- package/src/api/core/tags.ts +76 -0
- package/src/api/core/zoom/index.ts +13 -0
- package/src/api/design/bim.ts +210 -0
- package/src/api/design/boolean/index.ts +2 -0
- package/src/api/design/catalog.ts +203 -0
- package/src/api/design/create/bulk-items.ts +294 -0
- package/src/api/design/create/grids.ts +137 -0
- package/src/api/design/create/index.ts +823 -114
- package/src/api/design/create/opening-fields.ts +40 -0
- package/src/api/design/delete/index.ts +5 -0
- package/src/api/design/dimensions.ts +453 -0
- package/src/api/design/doors/index.ts +64 -41
- package/src/api/design/family.ts +1342 -0
- package/src/api/design/furniture/index.ts +34 -0
- package/src/api/design/grids.ts +237 -0
- package/src/api/design/index.ts +49 -4
- package/src/api/design/networks.ts +607 -0
- package/src/api/design/query/geometry/index.ts +35 -4
- package/src/api/design/query/grids.ts +197 -0
- package/src/api/design/query/index.ts +105 -3
- package/src/api/design/types/index.ts +31 -24
- package/src/api/design/update/index.ts +398 -4
- package/src/api/design/visibility.ts +34 -0
- package/src/api/design/windows/index.ts +40 -22
- package/src/api/entity/buildableEnvelope.ts +77 -2
- package/src/api/entity/referenceLine.ts +25 -12
- package/src/api/presentation/annotate.ts +90 -58
- package/src/api/presentation/camera.ts +289 -0
- package/src/api/presentation/drawingContract.ts +70 -0
- package/src/api/presentation/drawings.ts +1179 -0
- package/src/api/presentation/export.ts +32 -6
- package/src/api/presentation/graphics.ts +324 -0
- package/src/api/presentation/index.ts +73 -14
- package/src/api/presentation/placedViews.ts +119 -28
- package/src/api/presentation/sections.ts +420 -0
- package/src/api/presentation/sheets.ts +181 -20
- package/src/api/presentation/standards.ts +445 -0
- package/src/api/presentation/viewPresets.ts +241 -0
- package/src/api/presentation/views.ts +81 -10
- package/src/api/presentation/walkthroughs.ts +1201 -0
- package/src/api/program/departments.ts +54 -2
- package/src/api/program/index.ts +16 -6
- package/src/api/program/labels.ts +332 -0
- package/src/api/program/metadata.ts +364 -0
- package/src/api/program/spreadsheet.ts +282 -0
- package/src/api/workspace/index.ts +51 -2
- package/src/errors/codes.ts +7 -0
- package/src/handles.ts +42 -3
- package/src/index.ts +2 -0
- package/src/massParameters.ops.ts +246 -0
- package/src/massParameters.ts +427 -0
- package/test/drawingContract.test.mjs +288 -0
- package/test/errors.test.mjs +1 -0
- package/test/massParameters.test.mjs +952 -0
- package/test/paperPensContract.test.mjs +75 -0
- package/test/presentationViewSettings.test.mjs +85 -0
|
@@ -32,14 +32,15 @@ export declare abstract class PluginPresentationAnnotateApi {
|
|
|
32
32
|
* falls back to regular. `fontSizePx` sets an exact pixel size, overriding
|
|
33
33
|
* the `size` preset when both are given (`size` alone keeps working).
|
|
34
34
|
*
|
|
35
|
-
* @param sheetId - The sheet to annotate.
|
|
35
|
+
* @param sheetId - The sheet to annotate, or `undefined` when `options.drawingId` is used.
|
|
36
36
|
* @param text - The label text.
|
|
37
37
|
* @param options - Optional `position` (`{ x, y }`, relative to the sheet's
|
|
38
38
|
* top-left, in canvas units — defaults to the sheet's top-left corner),
|
|
39
39
|
* `size` (`"s" | "m" | "l" | "xl"`, default `"m"`), `color` (a named
|
|
40
40
|
* palette color, default `"black"`), and typography: `fontFamily`,
|
|
41
41
|
* `fontWeight` (numeric string, `-italic` suffix allowed), `fontSizePx`
|
|
42
|
-
* (positive px size overriding the `size` preset)
|
|
42
|
+
* (positive px size overriding the `size` preset), and `drawingId` to parent
|
|
43
|
+
* the annotation to a drawing. Pass exactly one parent: `sheetId` or `drawingId`.
|
|
43
44
|
* @returns A {@linkcode PluginPresentationAnnotateTextResult} with the created
|
|
44
45
|
* `shapeId`.
|
|
45
46
|
* @throws If Present mode is not open or the sheet id is invalid.
|
|
@@ -58,7 +59,7 @@ export declare abstract class PluginPresentationAnnotateApi {
|
|
|
58
59
|
* )
|
|
59
60
|
* ```
|
|
60
61
|
*/
|
|
61
|
-
abstract text(sheetId: string, text: string, options?: {
|
|
62
|
+
abstract text(sheetId: string | undefined, text: string, options?: {
|
|
62
63
|
position?: {
|
|
63
64
|
x: number;
|
|
64
65
|
y: number;
|
|
@@ -68,6 +69,7 @@ export declare abstract class PluginPresentationAnnotateApi {
|
|
|
68
69
|
fontFamily?: string;
|
|
69
70
|
fontWeight?: string;
|
|
70
71
|
fontSizePx?: number;
|
|
72
|
+
drawingId?: string;
|
|
71
73
|
}): PluginApiReturn<PluginPresentationAnnotateTextResult>;
|
|
72
74
|
/**
|
|
73
75
|
* Draw an arrow on a sheet.
|
|
@@ -76,11 +78,12 @@ export declare abstract class PluginPresentationAnnotateApi {
|
|
|
76
78
|
* top-left, in canvas units — the same Arrow tool as the Present toolbar) and
|
|
77
79
|
* returns the id of the created canvas shape. Requires Present mode to be open.
|
|
78
80
|
*
|
|
79
|
-
* @param sheetId - The sheet to annotate.
|
|
81
|
+
* @param sheetId - The sheet to annotate, or `undefined` when `options.drawingId` is used.
|
|
80
82
|
* @param start - Arrow tail position (`{ x, y }`, relative to the sheet's top-left).
|
|
81
83
|
* @param end - Arrow head position (`{ x, y }`, relative to the sheet's top-left).
|
|
82
84
|
* @param options - Optional `color` (a named palette color, default `"black"`)
|
|
83
|
-
*
|
|
85
|
+
* `size` (stroke weight preset, `"s" | "m" | "l" | "xl"`, default `"m"`),
|
|
86
|
+
* and `drawingId` to parent the arrow to a drawing. Pass exactly one parent.
|
|
84
87
|
* @returns A {@linkcode PluginPresentationAnnotateResult} with the created
|
|
85
88
|
* `shapeId`.
|
|
86
89
|
* @throws If Present mode is not open or the sheet id is invalid.
|
|
@@ -99,7 +102,7 @@ export declare abstract class PluginPresentationAnnotateApi {
|
|
|
99
102
|
* )
|
|
100
103
|
* ```
|
|
101
104
|
*/
|
|
102
|
-
abstract arrow(sheetId: string, start: {
|
|
105
|
+
abstract arrow(sheetId: string | undefined, start: {
|
|
103
106
|
x: number;
|
|
104
107
|
y: number;
|
|
105
108
|
}, end: {
|
|
@@ -108,6 +111,7 @@ export declare abstract class PluginPresentationAnnotateApi {
|
|
|
108
111
|
}, options?: {
|
|
109
112
|
color?: PluginAnnotateTextColor;
|
|
110
113
|
size?: PluginAnnotateTextSize;
|
|
114
|
+
drawingId?: string;
|
|
111
115
|
}): PluginApiReturn<PluginPresentationAnnotateResult>;
|
|
112
116
|
/**
|
|
113
117
|
* Add a sticky note to a sheet.
|
|
@@ -116,13 +120,14 @@ export declare abstract class PluginPresentationAnnotateApi {
|
|
|
116
120
|
* fixed-size sticky square that grows with its text) and returns the id of
|
|
117
121
|
* the created canvas shape. Requires Present mode to be open.
|
|
118
122
|
*
|
|
119
|
-
* @param sheetId - The sheet to annotate.
|
|
123
|
+
* @param sheetId - The sheet to annotate, or `undefined` when `options.drawingId` is used.
|
|
120
124
|
* @param text - The note text.
|
|
121
125
|
* @param options - Optional `position` (`{ x, y }`, relative to the sheet's
|
|
122
126
|
* top-left, in canvas units — defaults to the sheet's top-left corner),
|
|
123
127
|
* `color` (a named palette color, default `"black"` — rendered as the
|
|
124
128
|
* note's sticky fill), and `size` (text size preset,
|
|
125
|
-
* `"s" | "m" | "l" | "xl"`, default `"m"`)
|
|
129
|
+
* `"s" | "m" | "l" | "xl"`, default `"m"`), and `drawingId` to parent
|
|
130
|
+
* the note to a drawing. Pass exactly one parent.
|
|
126
131
|
* @returns A {@linkcode PluginPresentationAnnotateResult} with the created
|
|
127
132
|
* `shapeId`.
|
|
128
133
|
* @throws If Present mode is not open or the sheet id is invalid.
|
|
@@ -140,13 +145,14 @@ export declare abstract class PluginPresentationAnnotateApi {
|
|
|
140
145
|
* )
|
|
141
146
|
* ```
|
|
142
147
|
*/
|
|
143
|
-
abstract note(sheetId: string, text: string, options?: {
|
|
148
|
+
abstract note(sheetId: string | undefined, text: string, options?: {
|
|
144
149
|
position?: {
|
|
145
150
|
x: number;
|
|
146
151
|
y: number;
|
|
147
152
|
};
|
|
148
153
|
color?: PluginAnnotateTextColor;
|
|
149
154
|
size?: PluginAnnotateTextSize;
|
|
155
|
+
drawingId?: string;
|
|
150
156
|
}): PluginApiReturn<PluginPresentationAnnotateResult>;
|
|
151
157
|
/**
|
|
152
158
|
* Draw a geo shape (rectangle, ellipse, cloud, …) on a sheet.
|
|
@@ -156,14 +162,15 @@ export declare abstract class PluginPresentationAnnotateApi {
|
|
|
156
162
|
* top-left, in canvas units) and returns the id of the created canvas shape.
|
|
157
163
|
* Requires Present mode to be open.
|
|
158
164
|
*
|
|
159
|
-
* @param sheetId - The sheet to annotate.
|
|
165
|
+
* @param sheetId - The sheet to annotate, or `undefined` when `options.drawingId` is used.
|
|
160
166
|
* @param kind - The shape kind ({@linkcode PluginAnnotateGeoKind}), e.g.
|
|
161
167
|
* `"rectangle"`, `"ellipse"`, `"cloud"`.
|
|
162
168
|
* @param bounds - Placement box `{ x, y, w, h }` — `x`/`y` are the shape's
|
|
163
169
|
* top-left relative to the sheet's top-left; `w`/`h` must be positive.
|
|
164
170
|
* @param options - Optional `color` (a named palette color, default
|
|
165
171
|
* `"black"`) and `fill` ({@linkcode PluginAnnotateFill}, default `"none"` —
|
|
166
|
-
* outline only).
|
|
172
|
+
* outline only), and `drawingId` to parent the shape to a drawing. Pass
|
|
173
|
+
* exactly one parent: `sheetId` or `drawingId`.
|
|
167
174
|
* @returns A {@linkcode PluginPresentationAnnotateResult} with the created
|
|
168
175
|
* `shapeId`.
|
|
169
176
|
* @throws If Present mode is not open or the sheet id is invalid.
|
|
@@ -182,7 +189,7 @@ export declare abstract class PluginPresentationAnnotateApi {
|
|
|
182
189
|
* )
|
|
183
190
|
* ```
|
|
184
191
|
*/
|
|
185
|
-
abstract shape(sheetId: string, kind: PluginAnnotateGeoKind, bounds: {
|
|
192
|
+
abstract shape(sheetId: string | undefined, kind: PluginAnnotateGeoKind, bounds: {
|
|
186
193
|
x: number;
|
|
187
194
|
y: number;
|
|
188
195
|
w: number;
|
|
@@ -190,6 +197,7 @@ export declare abstract class PluginPresentationAnnotateApi {
|
|
|
190
197
|
}, options?: {
|
|
191
198
|
color?: PluginAnnotateTextColor;
|
|
192
199
|
fill?: PluginAnnotateFill;
|
|
200
|
+
drawingId?: string;
|
|
193
201
|
}): PluginApiReturn<PluginPresentationAnnotateResult>;
|
|
194
202
|
}
|
|
195
203
|
/** Text size preset (the same s/m/l/xl scale as the Present-mode text tool). */
|
|
@@ -222,7 +230,8 @@ export type PluginAnnotateTextColor = z.infer<typeof PluginAnnotateTextColor>;
|
|
|
222
230
|
*
|
|
223
231
|
* | Property | Type | Description |
|
|
224
232
|
* |---|---|---|
|
|
225
|
-
* | `sheetId` | `string` | The sheet
|
|
233
|
+
* | `sheetId` | `string \| undefined` | The sheet parent; omit when `drawingId` is set |
|
|
234
|
+
* | `drawingId` | `string \| undefined` | The drawing parent; mutually exclusive with `sheetId` |
|
|
226
235
|
* | `text` | `string` | The label text |
|
|
227
236
|
* | `position` | `{ x: number; y: number } \| undefined` | Where to place it (relative to the sheet) |
|
|
228
237
|
* | `size` | {@linkcode PluginAnnotateTextSize}` \| undefined` | Text size preset |
|
|
@@ -232,7 +241,8 @@ export type PluginAnnotateTextColor = z.infer<typeof PluginAnnotateTextColor>;
|
|
|
232
241
|
* | `fontSizePx` | `number \| undefined` | Exact px size (overrides the `size` preset) |
|
|
233
242
|
*/
|
|
234
243
|
export declare const PluginPresentationAnnotateTextArgs: z.ZodObject<{
|
|
235
|
-
sheetId: z.ZodString
|
|
244
|
+
sheetId: z.ZodOptional<z.ZodString>;
|
|
245
|
+
drawingId: z.ZodOptional<z.ZodString>;
|
|
236
246
|
text: z.ZodString;
|
|
237
247
|
position: z.ZodOptional<z.ZodObject<{
|
|
238
248
|
x: z.ZodNumber;
|
|
@@ -280,11 +290,11 @@ export type PluginPresentationAnnotateTextResult = z.infer<typeof PluginPresenta
|
|
|
280
290
|
* flyout.
|
|
281
291
|
*/
|
|
282
292
|
export declare const PluginAnnotateGeoKind: z.ZodEnum<{
|
|
293
|
+
hexagon: "hexagon";
|
|
283
294
|
rectangle: "rectangle";
|
|
284
295
|
ellipse: "ellipse";
|
|
285
296
|
triangle: "triangle";
|
|
286
297
|
diamond: "diamond";
|
|
287
|
-
hexagon: "hexagon";
|
|
288
298
|
oval: "oval";
|
|
289
299
|
rhombus: "rhombus";
|
|
290
300
|
star: "star";
|
|
@@ -311,14 +321,16 @@ export type PluginAnnotateFill = z.infer<typeof PluginAnnotateFill>;
|
|
|
311
321
|
*
|
|
312
322
|
* | Property | Type | Description |
|
|
313
323
|
* |---|---|---|
|
|
314
|
-
* | `sheetId` | `string` | The sheet
|
|
324
|
+
* | `sheetId` | `string \| undefined` | The sheet parent; omit when `drawingId` is set |
|
|
325
|
+
* | `drawingId` | `string \| undefined` | The drawing parent; mutually exclusive with `sheetId` |
|
|
315
326
|
* | `start` | `{ x: number; y: number }` | Arrow tail (relative to the sheet) |
|
|
316
327
|
* | `end` | `{ x: number; y: number }` | Arrow head (relative to the sheet) |
|
|
317
328
|
* | `color` | {@linkcode PluginAnnotateTextColor}` \| undefined` | Arrow color |
|
|
318
329
|
* | `size` | {@linkcode PluginAnnotateTextSize}` \| undefined` | Stroke weight preset |
|
|
319
330
|
*/
|
|
320
331
|
export declare const PluginPresentationAnnotateArrowArgs: z.ZodObject<{
|
|
321
|
-
sheetId: z.ZodString
|
|
332
|
+
sheetId: z.ZodOptional<z.ZodString>;
|
|
333
|
+
drawingId: z.ZodOptional<z.ZodString>;
|
|
322
334
|
start: z.ZodObject<{
|
|
323
335
|
x: z.ZodNumber;
|
|
324
336
|
y: z.ZodNumber;
|
|
@@ -355,14 +367,16 @@ export type PluginPresentationAnnotateArrowArgs = z.infer<typeof PluginPresentat
|
|
|
355
367
|
*
|
|
356
368
|
* | Property | Type | Description |
|
|
357
369
|
* |---|---|---|
|
|
358
|
-
* | `sheetId` | `string` | The sheet
|
|
370
|
+
* | `sheetId` | `string \| undefined` | The sheet parent; omit when `drawingId` is set |
|
|
371
|
+
* | `drawingId` | `string \| undefined` | The drawing parent; mutually exclusive with `sheetId` |
|
|
359
372
|
* | `text` | `string` | The note text |
|
|
360
373
|
* | `position` | `{ x: number; y: number } \| undefined` | Where to place it (relative to the sheet) |
|
|
361
374
|
* | `color` | {@linkcode PluginAnnotateTextColor}` \| undefined` | Sticky fill color |
|
|
362
375
|
* | `size` | {@linkcode PluginAnnotateTextSize}` \| undefined` | Text size preset |
|
|
363
376
|
*/
|
|
364
377
|
export declare const PluginPresentationAnnotateNoteArgs: z.ZodObject<{
|
|
365
|
-
sheetId: z.ZodString
|
|
378
|
+
sheetId: z.ZodOptional<z.ZodString>;
|
|
379
|
+
drawingId: z.ZodOptional<z.ZodString>;
|
|
366
380
|
text: z.ZodString;
|
|
367
381
|
position: z.ZodOptional<z.ZodObject<{
|
|
368
382
|
x: z.ZodNumber;
|
|
@@ -396,20 +410,22 @@ export type PluginPresentationAnnotateNoteArgs = z.infer<typeof PluginPresentati
|
|
|
396
410
|
*
|
|
397
411
|
* | Property | Type | Description |
|
|
398
412
|
* |---|---|---|
|
|
399
|
-
* | `sheetId` | `string` | The sheet
|
|
413
|
+
* | `sheetId` | `string \| undefined` | The sheet parent; omit when `drawingId` is set |
|
|
414
|
+
* | `drawingId` | `string \| undefined` | The drawing parent; mutually exclusive with `sheetId` |
|
|
400
415
|
* | `kind` | {@linkcode PluginAnnotateGeoKind} | The shape kind |
|
|
401
416
|
* | `bounds` | `{ x: number; y: number; w: number; h: number }` | Placement box (relative to the sheet; `w`/`h` positive) |
|
|
402
417
|
* | `color` | {@linkcode PluginAnnotateTextColor}` \| undefined` | Outline color |
|
|
403
418
|
* | `fill` | {@linkcode PluginAnnotateFill}` \| undefined` | Fill style |
|
|
404
419
|
*/
|
|
405
420
|
export declare const PluginPresentationAnnotateShapeArgs: z.ZodObject<{
|
|
406
|
-
sheetId: z.ZodString
|
|
421
|
+
sheetId: z.ZodOptional<z.ZodString>;
|
|
422
|
+
drawingId: z.ZodOptional<z.ZodString>;
|
|
407
423
|
kind: z.ZodEnum<{
|
|
424
|
+
hexagon: "hexagon";
|
|
408
425
|
rectangle: "rectangle";
|
|
409
426
|
ellipse: "ellipse";
|
|
410
427
|
triangle: "triangle";
|
|
411
428
|
diamond: "diamond";
|
|
412
|
-
hexagon: "hexagon";
|
|
413
429
|
oval: "oval";
|
|
414
430
|
rhombus: "rhombus";
|
|
415
431
|
star: "star";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"annotate.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/annotate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;;GAeG;AACH,8BAAsB,6BAA6B;;IAGjD
|
|
1
|
+
{"version":3,"file":"annotate.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/annotate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAE7C;;;;;;;;;;;;;;;GAeG;AACH,8BAAsB,6BAA6B;;IAGjD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAwCG;aACa,IAAI,CAClB,OAAO,EAAE,MAAM,GAAG,SAAS,EAC3B,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE;QACR,QAAQ,CAAC,EAAE;YAAE,CAAC,EAAE,MAAM,CAAC;YAA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G,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEnE;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW5C,CAAA;AACJ,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW3C,CAAA;AACJ,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,kCAAkC,CAC1C,CAAA;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgB5C,CAAA;AACJ,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,gCAAgC;;iBAE3C,CAAA;AACF,MAAM,MAAM,gCAAgC,GAAG,CAAC,CAAC,KAAK,CACpD,OAAO,gCAAgC,CACxC,CAAA"}
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
import { PluginApiReturn } from "../../types";
|
|
3
|
+
import { PluginPresentationImageFormat } from "./views";
|
|
4
|
+
/**
|
|
5
|
+
* The Present-mode canvas camera — the Present-mode twin of
|
|
6
|
+
* {@linkcode PluginCameraApi} (`core.camera`).
|
|
7
|
+
*
|
|
8
|
+
* Present mode lays sheets out on an infinite 2D canvas; its camera is a pan
|
|
9
|
+
* (`x`, `y`) and a `zoom`. A plugin can screenshot what that canvas currently
|
|
10
|
+
* shows, read the camera, pan/zoom it, or frame all sheets or one shape.
|
|
11
|
+
*
|
|
12
|
+
* These are transient VIEW-STATE changes: not model edits, so they are not
|
|
13
|
+
* write-gated and not undoable. Every method requires **Present mode to be
|
|
14
|
+
* open** (the documentation editor) and throws `PRECONDITION_FAILED` when it is
|
|
15
|
+
* closed. `capture` is the Present-mode counterpart of
|
|
16
|
+
* {@linkcode PluginPresentationViewsApi.capture}, which shoots the Design
|
|
17
|
+
* (3D) canvas; for whole sheets at their own size use
|
|
18
|
+
* {@linkcode PluginPresentationApi.export}.
|
|
19
|
+
*
|
|
20
|
+
* Coordinates are Present canvas page units (pixels at 100% zoom), the same
|
|
21
|
+
* space `sheets`, `placedViews` and `shapes` report positions in. `zoom` is a
|
|
22
|
+
* factor: `1` = 100%, `0.5` = zoomed out to half size.
|
|
23
|
+
*
|
|
24
|
+
* Accessed via `snaptrude.presentation.camera`.
|
|
25
|
+
*/
|
|
26
|
+
export declare abstract class PluginPresentationCameraApi {
|
|
27
|
+
constructor();
|
|
28
|
+
/**
|
|
29
|
+
* Screenshot what the Present canvas currently shows.
|
|
30
|
+
*
|
|
31
|
+
* Captures exactly the visible area — the canvas as clipped by the window,
|
|
32
|
+
* minus the strip under the floating left sidebar — at the current pan and
|
|
33
|
+
* zoom, rendered
|
|
34
|
+
* through the same pipeline as the Present-mode Export dialog, so sheets,
|
|
35
|
+
* placed views, text, annotations and imported images look as they do on
|
|
36
|
+
* screen. Selection handles, cursors and the UI itself are not part of the
|
|
37
|
+
* image. Nothing on screen still yields an image (the export backdrop).
|
|
38
|
+
* Export-pipeline details, as in the Export dialog: sheet frames themselves
|
|
39
|
+
* are not drawn (no paper, margin guides or name label — editor chrome), the
|
|
40
|
+
* backdrop is tldraw's near-white export backdrop rather than the on-screen
|
|
41
|
+
* canvas grey, and with exactly one sheet in view it is white. Only the left
|
|
42
|
+
* sidebar is subtracted from the view; floating right-hand panels are not.
|
|
43
|
+
*
|
|
44
|
+
* @param options - All optional: `format` (`"png"` default, or `"jpeg"`),
|
|
45
|
+
* `pixelRatio` (output pixels per screen pixel, `1`–`4`, default `1`;
|
|
46
|
+
* `2` for a retina-sharp image).
|
|
47
|
+
* @returns A {@linkcode PluginPresentationCameraCaptureResult}: the base64
|
|
48
|
+
* data URL and its pixel size.
|
|
49
|
+
* @throws If Present mode is not open.
|
|
50
|
+
*
|
|
51
|
+
* @examplePrompt Take a screenshot of the Present canvas
|
|
52
|
+
* @examplePrompt Capture what I am looking at in Present mode
|
|
53
|
+
* @examplePrompt Screenshot the presentation canvas as a JPEG
|
|
54
|
+
* @examplePrompt Grab a high-res image of the current sheet view
|
|
55
|
+
*
|
|
56
|
+
* # Example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const { image, width, height } = await snaptrude.presentation.camera.capture({
|
|
59
|
+
* format: "png",
|
|
60
|
+
* pixelRatio: 2,
|
|
61
|
+
* })
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
abstract capture(options?: {
|
|
65
|
+
format?: PluginPresentationImageFormat;
|
|
66
|
+
pixelRatio?: number;
|
|
67
|
+
}): PluginApiReturn<PluginPresentationCameraCaptureResult>;
|
|
68
|
+
/**
|
|
69
|
+
* Read the Present camera: pan, zoom, the visible page-space rectangle and
|
|
70
|
+
* the sheet under the centre of the view.
|
|
71
|
+
*
|
|
72
|
+
* @returns The current {@linkcode PluginPresentationCameraState}.
|
|
73
|
+
* @throws If Present mode is not open.
|
|
74
|
+
*
|
|
75
|
+
* @examplePrompt Where is the Present canvas camera?
|
|
76
|
+
* @examplePrompt What zoom level is Present mode at?
|
|
77
|
+
* @examplePrompt Which sheet is on screen right now?
|
|
78
|
+
* @examplePrompt Read the visible area of the presentation canvas
|
|
79
|
+
*
|
|
80
|
+
* # Example
|
|
81
|
+
* ```ts
|
|
82
|
+
* const { zoom, sheetId } = await snaptrude.presentation.camera.get()
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
abstract get(): PluginApiReturn<PluginPresentationCameraState>;
|
|
86
|
+
/**
|
|
87
|
+
* Pan and/or zoom the Present canvas. Fields left out keep their current
|
|
88
|
+
* value, so `{ zoom: 2 }` changes only the zoom (the page point at the
|
|
89
|
+
* viewport's top-left corner stays put) and `{ x, y }` pans at the current
|
|
90
|
+
* zoom. `zoom` is clamped to the editor's range (1% to 1000%); the requested
|
|
91
|
+
* `x`/`y` are always honoured. Immediate (no animation). View-state only —
|
|
92
|
+
* not undoable.
|
|
93
|
+
*
|
|
94
|
+
* `x`/`y` are the camera offset in page units: the page point that lands at
|
|
95
|
+
* the viewport's top-left corner is `(-x, -y)`. Read them back from
|
|
96
|
+
* {@linkcode PluginPresentationCameraApi.get} to reproduce a framing later.
|
|
97
|
+
*
|
|
98
|
+
* @param camera - Any of `x`, `y`, `zoom` ({@linkcode PluginPresentationCameraSetArgs}); at least one.
|
|
99
|
+
* @returns The resulting {@linkcode PluginPresentationCameraState}.
|
|
100
|
+
* @throws If Present mode is not open, or another Present-mode control has
|
|
101
|
+
* locked the camera (an open style dropdown, AI Inspiration's layout mode).
|
|
102
|
+
*
|
|
103
|
+
* @examplePrompt Zoom the Present canvas to 50%
|
|
104
|
+
* @examplePrompt Pan the presentation canvas to the right
|
|
105
|
+
* @examplePrompt Restore the Present camera I saved earlier
|
|
106
|
+
* @examplePrompt Set the Present zoom to 200% without moving
|
|
107
|
+
*
|
|
108
|
+
* # Example
|
|
109
|
+
* ```ts
|
|
110
|
+
* const saved = await snaptrude.presentation.camera.get()
|
|
111
|
+
* await snaptrude.presentation.camera.set({ zoom: 0.5 })
|
|
112
|
+
* // …later, restore the exact framing
|
|
113
|
+
* await snaptrude.presentation.camera.set({ x: saved.x, y: saved.y, zoom: saved.zoom })
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
abstract set(camera: {
|
|
117
|
+
x?: number;
|
|
118
|
+
y?: number;
|
|
119
|
+
zoom?: number;
|
|
120
|
+
}): PluginApiReturn<PluginPresentationCameraState>;
|
|
121
|
+
/**
|
|
122
|
+
* Frame everything on the Present canvas — every sheet and loose shape — the
|
|
123
|
+
* Present-mode "zoom to fit". View-state only — not undoable.
|
|
124
|
+
*
|
|
125
|
+
* @returns The resulting {@linkcode PluginPresentationCameraState}.
|
|
126
|
+
* @throws If Present mode is not open, or the camera is locked.
|
|
127
|
+
*
|
|
128
|
+
* @examplePrompt Zoom out to see all the sheets
|
|
129
|
+
* @examplePrompt Fit the whole presentation in the Present view
|
|
130
|
+
* @examplePrompt Zoom to fit in Present mode
|
|
131
|
+
*
|
|
132
|
+
* # Example
|
|
133
|
+
* ```ts
|
|
134
|
+
* await snaptrude.presentation.camera.zoomToFit()
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
abstract zoomToFit(): PluginApiReturn<PluginPresentationCameraState>;
|
|
138
|
+
/**
|
|
139
|
+
* Frame one shape on the Present canvas: a sheet, a placed view, a keyed
|
|
140
|
+
* shape or an annotation — any id the other `presentation` namespaces hand
|
|
141
|
+
* out. Pair with {@linkcode PluginPresentationCameraApi.capture} to
|
|
142
|
+
* screenshot a single sheet or placed view as it appears on screen.
|
|
143
|
+
* Immediate, unlike `sheets.setActive`, which animates its move over half a
|
|
144
|
+
* second. View-state only — not undoable.
|
|
145
|
+
*
|
|
146
|
+
* @param shapeId - The id of the sheet or shape to frame.
|
|
147
|
+
* @returns The resulting {@linkcode PluginPresentationCameraState}.
|
|
148
|
+
* @throws If Present mode is not open, the id is unknown, or the camera is locked.
|
|
149
|
+
*
|
|
150
|
+
* @examplePrompt Zoom in on sheet 2 in Present mode
|
|
151
|
+
* @examplePrompt Frame this placed view on the Present canvas
|
|
152
|
+
* @examplePrompt Go to the cover sheet and screenshot it
|
|
153
|
+
* @examplePrompt Centre the presentation view on that table
|
|
154
|
+
*
|
|
155
|
+
* # Example
|
|
156
|
+
* ```ts
|
|
157
|
+
* const { sheets } = await snaptrude.presentation.sheets.list()
|
|
158
|
+
* await snaptrude.presentation.camera.zoomTo(sheets[1].id)
|
|
159
|
+
* const { image } = await snaptrude.presentation.camera.capture()
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
abstract zoomTo(shapeId: string): PluginApiReturn<PluginPresentationCameraState>;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* The visible area of the Present canvas in page units — the canvas as
|
|
166
|
+
* clipped by the window, minus the strip under the floating left sidebar.
|
|
167
|
+
*
|
|
168
|
+
* | Property | Type | Description |
|
|
169
|
+
* |---|---|---|
|
|
170
|
+
* | `x` | `number` | Left edge (page units) |
|
|
171
|
+
* | `y` | `number` | Top edge (page units) |
|
|
172
|
+
* | `width` | `number` | Width (page units) |
|
|
173
|
+
* | `height` | `number` | Height (page units) |
|
|
174
|
+
*/
|
|
175
|
+
export declare const PluginPresentationCameraViewport: z.ZodObject<{
|
|
176
|
+
x: z.ZodNumber;
|
|
177
|
+
y: z.ZodNumber;
|
|
178
|
+
width: z.ZodNumber;
|
|
179
|
+
height: z.ZodNumber;
|
|
180
|
+
}, z.core.$strip>;
|
|
181
|
+
export type PluginPresentationCameraViewport = z.infer<typeof PluginPresentationCameraViewport>;
|
|
182
|
+
/**
|
|
183
|
+
* The Present canvas camera as returned by every
|
|
184
|
+
* {@linkcode PluginPresentationCameraApi} method.
|
|
185
|
+
*
|
|
186
|
+
* | Property | Type | Description |
|
|
187
|
+
* |---|---|---|
|
|
188
|
+
* | `x` | `number` | Camera pan offset (page units): the page point at the tldraw viewport's top-left corner (under the sidebar) is `(-x, -y)` |
|
|
189
|
+
* | `y` | `number` | Camera pan offset (page units) |
|
|
190
|
+
* | `zoom` | `number` | Zoom factor, `1` = 100% |
|
|
191
|
+
* | `viewport` | {@linkcode PluginPresentationCameraViewport} | The visible page-space rectangle |
|
|
192
|
+
* | `sheetId` | `string \| null` | The sheet under the centre of the view, or `null` when none |
|
|
193
|
+
*/
|
|
194
|
+
export declare const PluginPresentationCameraState: z.ZodObject<{
|
|
195
|
+
x: z.ZodNumber;
|
|
196
|
+
y: z.ZodNumber;
|
|
197
|
+
zoom: z.ZodNumber;
|
|
198
|
+
viewport: z.ZodObject<{
|
|
199
|
+
x: z.ZodNumber;
|
|
200
|
+
y: z.ZodNumber;
|
|
201
|
+
width: z.ZodNumber;
|
|
202
|
+
height: z.ZodNumber;
|
|
203
|
+
}, z.core.$strip>;
|
|
204
|
+
sheetId: z.ZodNullable<z.ZodString>;
|
|
205
|
+
}, z.core.$strip>;
|
|
206
|
+
export type PluginPresentationCameraState = z.infer<typeof PluginPresentationCameraState>;
|
|
207
|
+
/**
|
|
208
|
+
* Arguments for {@linkcode PluginPresentationCameraApi.set}. All optional, at
|
|
209
|
+
* least one required; omitted fields keep their current value.
|
|
210
|
+
*
|
|
211
|
+
* | Property | Type | Description |
|
|
212
|
+
* |---|---|---|
|
|
213
|
+
* | `x` | `number \| undefined` | Camera pan offset (page units) |
|
|
214
|
+
* | `y` | `number \| undefined` | Camera pan offset (page units) |
|
|
215
|
+
* | `zoom` | `number \| undefined` | Zoom factor, `> 0` (`1` = 100%); clamped to the editor's range (`0.01`–`10`), `x`/`y` still honoured |
|
|
216
|
+
*/
|
|
217
|
+
export declare const PluginPresentationCameraSetArgs: z.ZodObject<{
|
|
218
|
+
x: z.ZodOptional<z.ZodNumber>;
|
|
219
|
+
y: z.ZodOptional<z.ZodNumber>;
|
|
220
|
+
zoom: z.ZodOptional<z.ZodNumber>;
|
|
221
|
+
}, z.core.$strip>;
|
|
222
|
+
export type PluginPresentationCameraSetArgs = z.infer<typeof PluginPresentationCameraSetArgs>;
|
|
223
|
+
/**
|
|
224
|
+
* Arguments for {@linkcode PluginPresentationCameraApi.zoomTo}.
|
|
225
|
+
*
|
|
226
|
+
* | Property | Type | Description |
|
|
227
|
+
* |---|---|---|
|
|
228
|
+
* | `shapeId` | `string` | The sheet or shape to frame |
|
|
229
|
+
*/
|
|
230
|
+
export declare const PluginPresentationCameraZoomToArgs: z.ZodObject<{
|
|
231
|
+
shapeId: z.ZodString;
|
|
232
|
+
}, z.core.$strip>;
|
|
233
|
+
export type PluginPresentationCameraZoomToArgs = z.infer<typeof PluginPresentationCameraZoomToArgs>;
|
|
234
|
+
/**
|
|
235
|
+
* Arguments for {@linkcode PluginPresentationCameraApi.capture}. All optional.
|
|
236
|
+
*
|
|
237
|
+
* | Property | Type | Description |
|
|
238
|
+
* |---|---|---|
|
|
239
|
+
* | `format` | `"png" \| "jpeg" \| undefined` | Output image format (default `"png"`) |
|
|
240
|
+
* | `pixelRatio` | `number \| undefined` | Output pixels per screen pixel, `1`–`4` (default `1`) |
|
|
241
|
+
*/
|
|
242
|
+
export declare const PluginPresentationCameraCaptureArgs: z.ZodObject<{
|
|
243
|
+
format: z.ZodOptional<z.ZodEnum<{
|
|
244
|
+
png: "png";
|
|
245
|
+
jpeg: "jpeg";
|
|
246
|
+
}>>;
|
|
247
|
+
pixelRatio: z.ZodOptional<z.ZodNumber>;
|
|
248
|
+
}, z.core.$strip>;
|
|
249
|
+
export type PluginPresentationCameraCaptureArgs = z.infer<typeof PluginPresentationCameraCaptureArgs>;
|
|
250
|
+
/**
|
|
251
|
+
* Result of {@linkcode PluginPresentationCameraApi.capture}.
|
|
252
|
+
*
|
|
253
|
+
* | Property | Type | Description |
|
|
254
|
+
* |---|---|---|
|
|
255
|
+
* | `image` | `string` | The screenshot as a base64 data URL (`data:image/png;base64,…`) |
|
|
256
|
+
* | `width` | `number` | Image width in pixels |
|
|
257
|
+
* | `height` | `number` | Image height in pixels |
|
|
258
|
+
*/
|
|
259
|
+
export declare const PluginPresentationCameraCaptureResult: z.ZodObject<{
|
|
260
|
+
image: z.ZodString;
|
|
261
|
+
width: z.ZodNumber;
|
|
262
|
+
height: z.ZodNumber;
|
|
263
|
+
}, z.core.$strip>;
|
|
264
|
+
export type PluginPresentationCameraCaptureResult = z.infer<typeof PluginPresentationCameraCaptureResult>;
|
|
265
|
+
//# sourceMappingURL=camera.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/camera.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EA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AK,CACnD,OAAO,+BAA+B,CACvC,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,kCAAkC;;iBAE7C,CAAA;AACF,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CACtD,OAAO,kCAAkC,CAC1C,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,mCAAmC;;;;;;iBAG9C,CAAA;AACF,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,qCAAqC;;;;iBAIhD,CAAA;AACF,MAAM,MAAM,qCAAqC,GAAG,CAAC,CAAC,KAAK,CACzD,OAAO,qCAAqC,CAC7C,CAAA"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Metric architectural scale denominators (`100` means 1:100), the metric
|
|
4
|
+
* values of the placed view's Scale dropdown.
|
|
5
|
+
*/
|
|
6
|
+
export declare const METRIC_DRAWING_SCALES: readonly [10, 20, 50, 100, 150, 200, 250, 500, 1000];
|
|
7
|
+
/**
|
|
8
|
+
* Imperial detail scale denominators, 1" = 1' (12) to 1/128" = 1' (1536):
|
|
9
|
+
* `48` is 1/4" = 1', `96` is 1/8" = 1'.
|
|
10
|
+
*/
|
|
11
|
+
export declare const IMPERIAL_DETAIL_DRAWING_SCALES: readonly [12, 16, 24, 32, 48, 64, 96, 128, 192, 384, 768, 1536];
|
|
12
|
+
/** Imperial site (engineering) scale denominators, 1" = 10' (120) to 1" = 400' (4800). */
|
|
13
|
+
export declare const IMPERIAL_SITE_DRAWING_SCALES: readonly [120, 240, 360, 480, 600, 1200, 2400, 3600, 4800];
|
|
14
|
+
/**
|
|
15
|
+
* Imperial architectural scale denominators, ascending: the imperial detail
|
|
16
|
+
* and site values of the placed view's Scale dropdown.
|
|
17
|
+
*/
|
|
18
|
+
export declare const IMPERIAL_DRAWING_SCALES: readonly number[];
|
|
19
|
+
/**
|
|
20
|
+
* Every standard architectural scale denominator, metric and imperial,
|
|
21
|
+
* ascending. Drawing and placed-view scale arguments accept only these; the
|
|
22
|
+
* host may further restrict them to the project's unit system.
|
|
23
|
+
*/
|
|
24
|
+
export declare const STANDARD_DRAWING_SCALES: readonly number[];
|
|
25
|
+
/** A standard architectural scale denominator; anything else is rejected with the allowed list. */
|
|
26
|
+
export declare const PluginStandardDrawingScale: z.ZodNumber;
|
|
27
|
+
/**
|
|
28
|
+
* An export base file name without an extension, not ending in a dot or
|
|
29
|
+
* whitespace; the host adds `.pdf`, `.svg`, `.png` or `.jpg`.
|
|
30
|
+
*/
|
|
31
|
+
export declare const PluginExportFileName: z.ZodString;
|
|
32
|
+
//# sourceMappingURL=drawingContract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawingContract.d.ts","sourceRoot":"","sources":["../../../src/api/presentation/drawingContract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,sDAExB,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,8BAA8B,iEAEjC,CAAA;AAEV,0FAA0F;AAC1F,eAAO,MAAM,4BAA4B,4DAE/B,CAAA;AAEV;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAG9B,CAAA;AAEvB;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,EAAE,SAAS,MAAM,EAG9B,CAAA;AAIvB,mGAAmG;AACnG,eAAO,MAAM,0BAA0B,aAKnC,CAAA;AAOJ;;;GAGG;AACH,eAAO,MAAM,oBAAoB,aAQ9B,CAAA"}
|