@snaptrude/plugin-core 0.9.15 → 0.9.16

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.
@@ -9,6 +9,13 @@ import { Vec3Handle } from "../../../handles";
9
9
  * canvas view menu and the 2D/3D toggle. Like {@linkcode PluginZoomApi}, these
10
10
  * are transient VIEW-STATE changes: they are not model edits, so they are not
11
11
  * write-gated and are not undoable. Accessed via `snaptrude.core.camera`.
12
+ *
13
+ * Read and set the full camera pose (`getPose`/`setPose`), walk and turn it the
14
+ * way the arrow keys do (`move`/`rotate`), and read or change the arrow-key
15
+ * navigation settings (`getNavigationSettings`/`updateNavigationSettings`).
16
+ * Positions are world coordinates in internal `babylon` units (1 unit =
17
+ * 0.254 m, Y up); yaw is degrees clockwise from +z seen from above, pitch is
18
+ * degrees above level.
12
19
  */
13
20
  export declare abstract class PluginCameraApi {
14
21
  constructor();
@@ -168,6 +175,162 @@ export declare abstract class PluginCameraApi {
168
175
  * ```
169
176
  */
170
177
  abstract zoomSelection(): PluginApiReturn<boolean>;
178
+ /**
179
+ * Read where the camera is and where it looks: the eye and target positions
180
+ * (world coordinates, internal `babylon` units), the view direction as yaw
181
+ * and pitch, the vertical field of view, the projection and the 2D/3D mode.
182
+ * Paired with {@linkcode PluginCameraApi.setPose}.
183
+ *
184
+ * @returns The current {@linkcode PluginCameraPose}.
185
+ * @throws PRECONDITION_FAILED when there is no active camera.
186
+ *
187
+ * @examplePrompt Where is the camera right now?
188
+ * @examplePrompt Remember this viewpoint so we can come back to it
189
+ * @examplePrompt Which way is the camera facing?
190
+ * @examplePrompt How high above the ground is the camera?
191
+ *
192
+ * # Example
193
+ * ```ts
194
+ * const pose = await snaptrude.core.camera.getPose()
195
+ * console.log(pose.eye, pose.yawInDegrees, pose.pitchInDegrees)
196
+ * ```
197
+ */
198
+ abstract getPose(): PluginApiReturn<PluginCameraPose>;
199
+ /**
200
+ * Place the camera, optionally easing there over `options.durationInSeconds`,
201
+ * and resolve once the new view has been drawn, so a capture that follows sees
202
+ * it without a fixed wait. `pose` is one of:
203
+ *
204
+ * - `{ eye, target }`: stand at `eye` looking at `target`, as
205
+ * {@linkcode PluginCameraApi.lookFrom} does with handles;
206
+ * - `{ eye, yawInDegrees, pitchInDegrees }`: stand at `eye` looking along a
207
+ * direction;
208
+ * - `{ standAt, yawInDegrees? }`: stand on the floor, stair, terrain or
209
+ * ground at or below `standAt`, at the user's eye height above it (the `I`
210
+ * key), facing `yawInDegrees` (the current yaw when omitted).
211
+ *
212
+ * Stops a playing walkthrough and switches from 2D plan view to 3D first.
213
+ * View-state only: not write-gated, not undoable.
214
+ *
215
+ * @param pose - Where to put the camera ({@linkcode PluginCameraPoseInput})
216
+ * @param options - `durationInSeconds`: ease over this long (0 to 10, default 0 jumps)
217
+ * @returns The camera's {@linkcode PluginCameraPose} once it has arrived.
218
+ * @throws PRECONDITION_FAILED when there is no active camera, while a
219
+ * walkthrough export is recording, or when `standAt` lies below the ground
220
+ * with nothing under it. VALIDATION when `eye` and `target` coincide or a
221
+ * pitch is beyond ±89°.
222
+ *
223
+ * @examplePrompt Stand in the living room at eye level facing the window
224
+ * @examplePrompt Move the camera to (40, 12, 30) looking at the entrance
225
+ * @examplePrompt Fly the camera smoothly over to the courtyard
226
+ * @examplePrompt Put me back at the viewpoint we saved earlier
227
+ *
228
+ * # Example
229
+ * ```ts
230
+ * const { camera } = snaptrude.core
231
+ * await camera.setPose({ standAt: { x: 20, y: 0, z: 35 }, yawInDegrees: 90 })
232
+ * await camera.setPose(
233
+ * { eye: { x: 60, y: 25, z: 60 }, target: { x: 0, y: 5, z: 0 } },
234
+ * { durationInSeconds: 1.5 },
235
+ * )
236
+ * ```
237
+ */
238
+ abstract setPose(pose: PluginCameraPoseInput, options?: PluginCameraSetPoseOptions): PluginApiReturn<PluginCameraPose>;
239
+ /**
240
+ * Walk or fly the camera by a displacement in its own frame: `forward` along
241
+ * the level view direction, `right` to its side and `up` vertically, in
242
+ * internal `babylon` units. The view direction does not change. With
243
+ * `options.followsFloor` the camera keeps its height above the floor as it
244
+ * goes, climbing and descending stairs and ramps the way the arrow keys do.
245
+ * Stops a playing walkthrough and switches from 2D plan view to 3D first.
246
+ * View-state only: not write-gated, not undoable.
247
+ *
248
+ * @param displacement - {@linkcode PluginCameraMoveDisplacement}; omitted components are 0
249
+ * @param options - `followsFloor` (default `false`) and `durationInSeconds` (0 to 10, default 0)
250
+ * @returns The camera's {@linkcode PluginCameraPose} after the move.
251
+ * @throws PRECONDITION_FAILED when there is no active camera, or while a
252
+ * walkthrough export is recording.
253
+ *
254
+ * @examplePrompt Walk forward 3 metres
255
+ * @examplePrompt Step to the right a little
256
+ * @examplePrompt Walk up the stairs ahead
257
+ * @examplePrompt Raise the camera by 2 metres
258
+ *
259
+ * # Example
260
+ * ```ts
261
+ * const metre = 1 / 0.254
262
+ * await snaptrude.core.camera.move(
263
+ * { forward: 3 * metre },
264
+ * { followsFloor: true, durationInSeconds: 2 },
265
+ * )
266
+ * ```
267
+ */
268
+ abstract move(displacement: PluginCameraMoveDisplacement, options?: PluginCameraMoveOptions): PluginApiReturn<PluginCameraPose>;
269
+ /**
270
+ * Turn the camera in place by signed angles: `yawInDegrees` to the right
271
+ * (clockwise seen from above) and `pitchInDegrees` up. The eye does not move;
272
+ * the resulting pitch is kept within ±89°. Stops a playing walkthrough and
273
+ * switches from 2D plan view to 3D first. View-state only: not write-gated,
274
+ * not undoable.
275
+ *
276
+ * @param yawInDegrees - Turn to the right by this much (negative turns left)
277
+ * @param pitchInDegrees - Tilt up by this much (negative tilts down; default 0)
278
+ * @param options - `durationInSeconds` (0 to 10, default 0)
279
+ * @returns The camera's {@linkcode PluginCameraPose} after turning.
280
+ * @throws PRECONDITION_FAILED when there is no active camera, or while a
281
+ * walkthrough export is recording.
282
+ *
283
+ * @examplePrompt Turn around
284
+ * @examplePrompt Look 45 degrees to the left
285
+ * @examplePrompt Tilt the camera down a bit
286
+ *
287
+ * # Example
288
+ * ```ts
289
+ * await snaptrude.core.camera.rotate(180, 0, { durationInSeconds: 1 })
290
+ * ```
291
+ */
292
+ abstract rotate(yawInDegrees: number, pitchInDegrees?: number, options?: PluginCameraRotateOptions): PluginApiReturn<PluginCameraPose>;
293
+ /**
294
+ * Read the arrow-key navigation settings: whether the arrow keys walk the
295
+ * camera, the eye height used by `setPose`'s `standAt` and by walkthroughs
296
+ * that follow the floor, the walking speed, and whether walking stops at
297
+ * walls. Paired with {@linkcode PluginCameraApi.updateNavigationSettings}.
298
+ *
299
+ * @returns The current {@linkcode PluginCameraNavigationSettings}.
300
+ *
301
+ * @examplePrompt Is arrow-key navigation on?
302
+ * @examplePrompt What eye height does the camera use?
303
+ *
304
+ * # Example
305
+ * ```ts
306
+ * const { isKeyboardNavigationEnabled } =
307
+ * await snaptrude.core.camera.getNavigationSettings()
308
+ * ```
309
+ */
310
+ abstract getNavigationSettings(): PluginApiReturn<PluginCameraNavigationSettings>;
311
+ /**
312
+ * Change arrow-key navigation settings; only the fields given change.
313
+ * `isKeyboardNavigationEnabled` is the user's Project Settings switch and is
314
+ * saved on this device; the other settings last for the session.
315
+ * Write-gated: this changes the user's preferences, not just the view.
316
+ *
317
+ * @param patch - The settings to change ({@linkcode PluginCameraNavigationSettingsPatch})
318
+ * @returns The {@linkcode PluginCameraNavigationSettings} after the change.
319
+ * @throws METHOD_NOT_PERMITTED when plugin writes are disabled.
320
+ *
321
+ * @examplePrompt Turn off arrow-key navigation
322
+ * @examplePrompt Use a 1.6 m eye height
323
+ * @examplePrompt Make walking stop at walls
324
+ *
325
+ * # Example
326
+ * ```ts
327
+ * await snaptrude.core.camera.updateNavigationSettings({
328
+ * eyeHeight: 1.6 / 0.254,
329
+ * isCollisionEnabled: true,
330
+ * })
331
+ * ```
332
+ */
333
+ abstract updateNavigationSettings(patch: PluginCameraNavigationSettingsPatch): PluginApiReturn<PluginCameraNavigationSettings>;
171
334
  }
172
335
  /**
173
336
  * A standard camera view: the five orthographic elevations (`top`/`front`/
@@ -258,4 +421,259 @@ export declare const PluginCameraSetProjectionArgs: z.ZodObject<{
258
421
  }>;
259
422
  }, z.core.$strip>;
260
423
  export type PluginCameraSetProjectionArgs = z.infer<typeof PluginCameraSetProjectionArgs>;
424
+ /**
425
+ * The camera's pose — result of {@linkcode PluginCameraApi.getPose},
426
+ * {@linkcode PluginCameraApi.setPose}, {@linkcode PluginCameraApi.move} and
427
+ * {@linkcode PluginCameraApi.rotate}.
428
+ *
429
+ * | Property | Type | Description |
430
+ * |---|---|---|
431
+ * | `eye` | `{ x, y, z }` | Camera position (world, `babylon` units) |
432
+ * | `target` | `{ x, y, z }` | Point the camera looks at |
433
+ * | `yawInDegrees` | `number` | View direction, degrees clockwise from +z seen from above (-180 to 180) |
434
+ * | `pitchInDegrees` | `number` | View direction, degrees above level (negative looks down) |
435
+ * | `fieldOfViewInDegrees` | `number` | Vertical field of view |
436
+ * | `projection` | {@linkcode PluginCameraProjection} | `"perspective"` or `"orthographic"` |
437
+ * | `mode` | {@linkcode PluginCameraMode} | `"2d"` or `"3d"` |
438
+ */
439
+ export declare const PluginCameraPose: z.ZodObject<{
440
+ eye: z.ZodObject<{
441
+ x: z.ZodNumber;
442
+ y: z.ZodNumber;
443
+ z: z.ZodNumber;
444
+ }, z.core.$strip>;
445
+ target: z.ZodObject<{
446
+ x: z.ZodNumber;
447
+ y: z.ZodNumber;
448
+ z: z.ZodNumber;
449
+ }, z.core.$strip>;
450
+ yawInDegrees: z.ZodNumber;
451
+ pitchInDegrees: z.ZodNumber;
452
+ fieldOfViewInDegrees: z.ZodNumber;
453
+ projection: z.ZodEnum<{
454
+ perspective: "perspective";
455
+ orthographic: "orthographic";
456
+ }>;
457
+ mode: z.ZodEnum<{
458
+ "2d": "2d";
459
+ "3d": "3d";
460
+ }>;
461
+ }, z.core.$strip>;
462
+ export type PluginCameraPose = z.infer<typeof PluginCameraPose>;
463
+ /**
464
+ * Where {@linkcode PluginCameraApi.setPose} puts the camera — exactly one of:
465
+ *
466
+ * | Shape | Meaning |
467
+ * |---|---|
468
+ * | `{ eye, target }` | Stand at `eye` looking at `target` |
469
+ * | `{ eye, yawInDegrees, pitchInDegrees }` | Stand at `eye` looking along a direction (pitch within ±89°) |
470
+ * | `{ standAt, yawInDegrees? }` | Stand at eye height on the floor, stair, terrain or ground at or below `standAt`, facing `yawInDegrees` (default: current yaw) |
471
+ *
472
+ * Points are plain `{ x, y, z }` world coordinates in `babylon` units.
473
+ */
474
+ export declare const PluginCameraPoseInput: z.ZodUnion<readonly [z.ZodObject<{
475
+ eye: z.ZodObject<{
476
+ x: z.ZodNumber;
477
+ y: z.ZodNumber;
478
+ z: z.ZodNumber;
479
+ }, z.core.$strip>;
480
+ target: z.ZodObject<{
481
+ x: z.ZodNumber;
482
+ y: z.ZodNumber;
483
+ z: z.ZodNumber;
484
+ }, z.core.$strip>;
485
+ }, z.core.$strict>, z.ZodObject<{
486
+ eye: z.ZodObject<{
487
+ x: z.ZodNumber;
488
+ y: z.ZodNumber;
489
+ z: z.ZodNumber;
490
+ }, z.core.$strip>;
491
+ yawInDegrees: z.ZodNumber;
492
+ pitchInDegrees: z.ZodNumber;
493
+ }, z.core.$strict>, z.ZodObject<{
494
+ standAt: z.ZodObject<{
495
+ x: z.ZodNumber;
496
+ y: z.ZodNumber;
497
+ z: z.ZodNumber;
498
+ }, z.core.$strip>;
499
+ yawInDegrees: z.ZodOptional<z.ZodNumber>;
500
+ }, z.core.$strict>]>;
501
+ export type PluginCameraPoseInput = z.infer<typeof PluginCameraPoseInput>;
502
+ /**
503
+ * Options for {@linkcode PluginCameraApi.setPose}.
504
+ *
505
+ * | Property | Type | Description |
506
+ * |---|---|---|
507
+ * | `durationInSeconds` | `number \| undefined` | Ease to the pose over this long (0 to 10; default 0 jumps) |
508
+ */
509
+ export declare const PluginCameraSetPoseOptions: z.ZodObject<{
510
+ durationInSeconds: z.ZodOptional<z.ZodNumber>;
511
+ }, z.core.$strict>;
512
+ export type PluginCameraSetPoseOptions = z.infer<typeof PluginCameraSetPoseOptions>;
513
+ /**
514
+ * Arguments for {@linkcode PluginCameraApi.setPose}.
515
+ */
516
+ export declare const PluginCameraSetPoseArgs: z.ZodObject<{
517
+ pose: z.ZodUnion<readonly [z.ZodObject<{
518
+ eye: z.ZodObject<{
519
+ x: z.ZodNumber;
520
+ y: z.ZodNumber;
521
+ z: z.ZodNumber;
522
+ }, z.core.$strip>;
523
+ target: z.ZodObject<{
524
+ x: z.ZodNumber;
525
+ y: z.ZodNumber;
526
+ z: z.ZodNumber;
527
+ }, z.core.$strip>;
528
+ }, z.core.$strict>, z.ZodObject<{
529
+ eye: z.ZodObject<{
530
+ x: z.ZodNumber;
531
+ y: z.ZodNumber;
532
+ z: z.ZodNumber;
533
+ }, z.core.$strip>;
534
+ yawInDegrees: z.ZodNumber;
535
+ pitchInDegrees: z.ZodNumber;
536
+ }, z.core.$strict>, z.ZodObject<{
537
+ standAt: z.ZodObject<{
538
+ x: z.ZodNumber;
539
+ y: z.ZodNumber;
540
+ z: z.ZodNumber;
541
+ }, z.core.$strip>;
542
+ yawInDegrees: z.ZodOptional<z.ZodNumber>;
543
+ }, z.core.$strict>]>;
544
+ options: z.ZodOptional<z.ZodObject<{
545
+ durationInSeconds: z.ZodOptional<z.ZodNumber>;
546
+ }, z.core.$strict>>;
547
+ }, z.core.$strip>;
548
+ export type PluginCameraSetPoseArgs = z.infer<typeof PluginCameraSetPoseArgs>;
549
+ /**
550
+ * A displacement in the camera's own frame, for {@linkcode PluginCameraApi.move}
551
+ * (`babylon` units; omitted components are 0).
552
+ *
553
+ * | Property | Type | Description |
554
+ * |---|---|---|
555
+ * | `forward` | `number \| undefined` | Along the level view direction (negative walks back) |
556
+ * | `right` | `number \| undefined` | To the camera's right (negative steps left) |
557
+ * | `up` | `number \| undefined` | Vertically (negative descends) |
558
+ */
559
+ export declare const PluginCameraMoveDisplacement: z.ZodObject<{
560
+ forward: z.ZodOptional<z.ZodNumber>;
561
+ right: z.ZodOptional<z.ZodNumber>;
562
+ up: z.ZodOptional<z.ZodNumber>;
563
+ }, z.core.$strict>;
564
+ export type PluginCameraMoveDisplacement = z.infer<typeof PluginCameraMoveDisplacement>;
565
+ /**
566
+ * Options for {@linkcode PluginCameraApi.move}.
567
+ *
568
+ * | Property | Type | Description |
569
+ * |---|---|---|
570
+ * | `followsFloor` | `boolean \| undefined` | Keep the height above the floor, climbing stairs and ramps (default `false`) |
571
+ * | `durationInSeconds` | `number \| undefined` | Walk over this long (0 to 10; default 0 jumps) |
572
+ */
573
+ export declare const PluginCameraMoveOptions: z.ZodObject<{
574
+ followsFloor: z.ZodOptional<z.ZodBoolean>;
575
+ durationInSeconds: z.ZodOptional<z.ZodNumber>;
576
+ }, z.core.$strict>;
577
+ export type PluginCameraMoveOptions = z.infer<typeof PluginCameraMoveOptions>;
578
+ /**
579
+ * Arguments for {@linkcode PluginCameraApi.move}.
580
+ */
581
+ export declare const PluginCameraMoveArgs: z.ZodObject<{
582
+ displacement: z.ZodObject<{
583
+ forward: z.ZodOptional<z.ZodNumber>;
584
+ right: z.ZodOptional<z.ZodNumber>;
585
+ up: z.ZodOptional<z.ZodNumber>;
586
+ }, z.core.$strict>;
587
+ options: z.ZodOptional<z.ZodObject<{
588
+ followsFloor: z.ZodOptional<z.ZodBoolean>;
589
+ durationInSeconds: z.ZodOptional<z.ZodNumber>;
590
+ }, z.core.$strict>>;
591
+ }, z.core.$strip>;
592
+ export type PluginCameraMoveArgs = z.infer<typeof PluginCameraMoveArgs>;
593
+ /**
594
+ * Options for {@linkcode PluginCameraApi.rotate}.
595
+ *
596
+ * | Property | Type | Description |
597
+ * |---|---|---|
598
+ * | `durationInSeconds` | `number \| undefined` | Turn over this long (0 to 10; default 0 jumps) |
599
+ */
600
+ export declare const PluginCameraRotateOptions: z.ZodObject<{
601
+ durationInSeconds: z.ZodOptional<z.ZodNumber>;
602
+ }, z.core.$strict>;
603
+ export type PluginCameraRotateOptions = z.infer<typeof PluginCameraRotateOptions>;
604
+ /**
605
+ * Arguments for {@linkcode PluginCameraApi.rotate}.
606
+ */
607
+ export declare const PluginCameraRotateArgs: z.ZodObject<{
608
+ yawInDegrees: z.ZodNumber;
609
+ pitchInDegrees: z.ZodOptional<z.ZodNumber>;
610
+ options: z.ZodOptional<z.ZodObject<{
611
+ durationInSeconds: z.ZodOptional<z.ZodNumber>;
612
+ }, z.core.$strict>>;
613
+ }, z.core.$strip>;
614
+ export type PluginCameraRotateArgs = z.infer<typeof PluginCameraRotateArgs>;
615
+ /**
616
+ * How fast the arrow keys walk: the Slow / Normal / Fast navigation setting.
617
+ */
618
+ export declare const PluginCameraWalkSpeed: z.ZodEnum<{
619
+ normal: "normal";
620
+ slow: "slow";
621
+ fast: "fast";
622
+ }>;
623
+ export type PluginCameraWalkSpeed = z.infer<typeof PluginCameraWalkSpeed>;
624
+ /**
625
+ * The arrow-key navigation settings — result of
626
+ * {@linkcode PluginCameraApi.getNavigationSettings} and
627
+ * {@linkcode PluginCameraApi.updateNavigationSettings}.
628
+ *
629
+ * | Property | Type | Description |
630
+ * |---|---|---|
631
+ * | `isKeyboardNavigationEnabled` | `boolean` | Whether the arrow keys walk the camera (Project Settings) |
632
+ * | `eyeHeight` | `number` | Eye height above the floor, `babylon` units |
633
+ * | `walkSpeed` | {@linkcode PluginCameraWalkSpeed} | Arrow-key walking speed |
634
+ * | `isCollisionEnabled` | `boolean` | Whether walking stops at walls |
635
+ */
636
+ export declare const PluginCameraNavigationSettings: z.ZodObject<{
637
+ isKeyboardNavigationEnabled: z.ZodBoolean;
638
+ eyeHeight: z.ZodNumber;
639
+ walkSpeed: z.ZodEnum<{
640
+ normal: "normal";
641
+ slow: "slow";
642
+ fast: "fast";
643
+ }>;
644
+ isCollisionEnabled: z.ZodBoolean;
645
+ }, z.core.$strip>;
646
+ export type PluginCameraNavigationSettings = z.infer<typeof PluginCameraNavigationSettings>;
647
+ /**
648
+ * The settings to change in {@linkcode PluginCameraApi.updateNavigationSettings};
649
+ * omitted fields keep their value. `eyeHeight` is in `babylon` units, between
650
+ * 0.8 m and 2.5 m (3.15 to 9.84 units).
651
+ */
652
+ export declare const PluginCameraNavigationSettingsPatch: z.ZodObject<{
653
+ isKeyboardNavigationEnabled: z.ZodOptional<z.ZodBoolean>;
654
+ eyeHeight: z.ZodOptional<z.ZodNumber>;
655
+ walkSpeed: z.ZodOptional<z.ZodEnum<{
656
+ normal: "normal";
657
+ slow: "slow";
658
+ fast: "fast";
659
+ }>>;
660
+ isCollisionEnabled: z.ZodOptional<z.ZodBoolean>;
661
+ }, z.core.$strict>;
662
+ export type PluginCameraNavigationSettingsPatch = z.infer<typeof PluginCameraNavigationSettingsPatch>;
663
+ /**
664
+ * Arguments for {@linkcode PluginCameraApi.updateNavigationSettings}.
665
+ */
666
+ export declare const PluginCameraUpdateNavigationSettingsArgs: z.ZodObject<{
667
+ patch: z.ZodObject<{
668
+ isKeyboardNavigationEnabled: z.ZodOptional<z.ZodBoolean>;
669
+ eyeHeight: z.ZodOptional<z.ZodNumber>;
670
+ walkSpeed: z.ZodOptional<z.ZodEnum<{
671
+ normal: "normal";
672
+ slow: "slow";
673
+ fast: "fast";
674
+ }>>;
675
+ isCollisionEnabled: z.ZodOptional<z.ZodBoolean>;
676
+ }, z.core.$strict>;
677
+ }, z.core.$strip>;
678
+ export type PluginCameraUpdateNavigationSettingsArgs = z.infer<typeof PluginCameraUpdateNavigationSettingsArgs>;
261
679
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/core/camera/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C;;;;;;;;GAQG;AACH,8BAAsB,eAAe;;IAGnC;;;;;;;;;;;;;;;;;;OAkBG;aACa,QAAQ,CACtB,GAAG,EAAE,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;;;;;;;;;kBAOrC,CAAA;AACX,MAAM,MAAM,mCAAmC,GAAG,CAAC,CAAC,KAAK,CACvD,OAAO,mCAAmC,CAC3C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,wCAAwC;;;;;;;;;;;iBAEnD,CAAA;AACF,MAAM,MAAM,wCAAwC,GAAG,CAAC,CAAC,KAAK,CAC5D,OAAO,wCAAwC,CAChD,CAAA"}
@@ -10,6 +10,7 @@ import { PluginPresentationShapesApi } from "./shapes";
10
10
  import { PluginPresentationTablesApi } from "./tables";
11
11
  import { PluginPresentationSlideshowApi } from "./slideshow";
12
12
  import { PluginPresentationImportApi } from "./import";
13
+ import { PluginPresentationWalkthroughsApi } from "./walkthroughs";
13
14
  import { PluginPresentationExportResult, type PluginPresentationExportFormat, type PluginPresentationExportResolution } from "./export";
14
15
  /**
15
16
  * Presentation APIs — prepare and assemble presentations.
@@ -30,6 +31,7 @@ import { PluginPresentationExportResult, type PluginPresentationExportFormat, ty
30
31
  * - {@linkcode PluginPresentationApi.slideshow} — Run the Present-mode slideshow
31
32
  * - {@linkcode PluginPresentationApi.import} — Import reference images/PDFs onto the canvas
32
33
  * - {@linkcode PluginPresentationApi.aiInspiration} — Present-mode AI image/video generation
34
+ * - {@linkcode PluginPresentationApi.walkthroughs} — Camera paths through the model: create, play, capture, export as video
33
35
  *
34
36
  * Accessed via `snaptrude.presentation`.
35
37
  */
@@ -59,6 +61,12 @@ export declare abstract class PluginPresentationApi {
59
61
  * {@linkcode PluginPresentationAIInspirationApi}.
60
62
  */
61
63
  abstract aiInspiration: PluginPresentationAIInspirationApi;
64
+ /**
65
+ * Walkthroughs — camera paths through the model: create (keyframes, floor
66
+ * points, camera-move presets), play, capture and export as video onto the
67
+ * Present canvas. See {@linkcode PluginPresentationWalkthroughsApi}.
68
+ */
69
+ abstract walkthroughs: PluginPresentationWalkthroughsApi;
62
70
  /**
63
71
  * Export the presentation's layout sheets to a downloadable file (PDF / PNG /
64
72
  * JPG) and return the encoded bytes as base64. Wraps the Present-mode Export
@@ -103,5 +111,6 @@ export * from "./tables";
103
111
  export * from "./slideshow";
104
112
  export * from "./import";
105
113
  export * from "./aiInspiration";
114
+ export * from "./walkthroughs";
106
115
  export * from "./export";
107
116
  //# 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,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,kCAAkC,EAAE,MAAM,iBAAiB,CAAA;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,gCAAgC,EAAE,MAAM,eAAe,CAAA;AAChE,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,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EAAE,8BAA8B,EAAE,MAAM,aAAa,CAAA;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA;AACtD,OAAO,EACL,8BAA8B,EAC9B,KAAK,8BAA8B,EACnC,KAAK,kCAAkC,EACxC,MAAM,UAAU,CAAA;AAEjB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,8BAAsB,qBAAqB;IACzC,qEAAqE;IACrE,SAAgB,KAAK,EAAE,0BAA0B,CAAA;IACjD,4JAA4J;IAC5J,SAAgB,MAAM,EAAE,2BAA2B,CAAA;IACnD,mHAAmH;IACnH,SAAgB,MAAM,EAAE,2BAA2B,CAAA;IACnD,4JAA4J;IAC5J,SAAgB,WAAW,EAAE,gC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