@micrio/client 7.5.0-alpha.3 → 7.5.0-alpha.5

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/micrio.min.d.ts CHANGED
@@ -984,6 +984,101 @@ declare module '@micrio/client' {
984
984
  }
985
985
  }
986
986
 
987
+ export namespace Book3D {
988
+ interface FlipOptions {
989
+ /** Flip speed multiplier (default `0.6`; lower = slower dramatic turn, higher = brisk). */
990
+ flipSpeed?: number;
991
+ /** Peak corner lift height in world units (default `0.7`). */
992
+ arcPeak?: number;
993
+ /** Normalized corner grab vertical position `0..1` (0 = top, 1 = bottom). */
994
+ grabRow?: number;
995
+ }
996
+ interface CameraFlyOptions extends Camera.AnimationOptions {
997
+ /** Framing margin multiplier around the target rect (default `1.06`). */
998
+ padding?: number;
999
+ /** Optional target polar angle in radians (`0` = side, `π/2` = overhead). */
1000
+ phi?: number;
1001
+ /** Optional target azimuth angle in radians (`0` = default front orientation). */
1002
+ theta?: number;
1003
+ }
1004
+ interface PoseOptions {
1005
+ /** Normalized zoom scale relative to fit radius (`1` = full fit, `< 1` = zoomed in). */
1006
+ radiusScale?: number;
1007
+ /** Polar angle in radians (`0.08..π*0.495`). */
1008
+ phi?: number;
1009
+ /** Azimuth angle in radians. */
1010
+ theta?: number;
1011
+ /** Flight duration in milliseconds (default `900`). */
1012
+ duration?: number;
1013
+ }
1014
+ interface LightingOptions {
1015
+ /** Cross-fade duration in milliseconds (`0` = immediate snap). */
1016
+ duration?: number;
1017
+ /** Optional preset-specific parameter overrides (e.g. `{ timeOfDay: 17.5 }`). */
1018
+ params?: Record<string, number>;
1019
+ }
1020
+ interface TiltShiftOptions {
1021
+ focusCenter?: number;
1022
+ focusWidth?: number;
1023
+ blurRadius?: number;
1024
+ blurFalloff?: number;
1025
+ }
1026
+ interface DriftOptions {
1027
+ amplitudeTheta?: number;
1028
+ amplitudePhi?: number;
1029
+ speed?: number;
1030
+ }
1031
+ interface PageFlipEvent {
1032
+ pageIndex: number;
1033
+ direction: 1 | -1;
1034
+ speed: number;
1035
+ isCover: boolean;
1036
+ }
1037
+ interface ProjectedRect {
1038
+ x: number;
1039
+ y: number;
1040
+ width: number;
1041
+ height: number;
1042
+ visible: boolean;
1043
+ }
1044
+ interface CameraPose {
1045
+ target: {
1046
+ x: number;
1047
+ y: number;
1048
+ z: number;
1049
+ };
1050
+ radius: number;
1051
+ phi: number;
1052
+ theta: number;
1053
+ }
1054
+ interface Controller {
1055
+ readonly ready: Promise<void>;
1056
+ goto: (pageIdx: number, opts?: FlipOptions) => Promise<void>;
1057
+ nextPage: (opts?: FlipOptions) => void;
1058
+ prevPage: (opts?: FlipOptions) => void;
1059
+ getCurrentPage: () => number;
1060
+ getPageCount: () => number;
1061
+ isZoomedIn: () => boolean;
1062
+ flyToView: (imageId: string, view: Camera.View, opts?: CameraFlyOptions) => Promise<void>;
1063
+ flyToFullView: (opts?: Camera.AnimationOptions) => Promise<void>;
1064
+ flyToPose: (opts: PoseOptions) => Promise<void>;
1065
+ /** Resolve the exact resting, viewport-clamped 3D camera pose for a view on any page without moving the camera. */
1066
+ resolveViewPose: (imageId: string, view: Camera.View, opts?: Omit<CameraFlyOptions, 'duration'>) => CameraPose | null;
1067
+ /** Resolve the viewport-clamped full-spread 3D camera pose without moving the camera. */
1068
+ getFullSpreadPose: (opts?: Omit<PoseOptions, 'duration'>) => CameraPose | null;
1069
+ /** Read the current live 3D camera pose. */
1070
+ getCameraPose: () => CameraPose | null;
1071
+ /** Apply a continuous 3D camera pose immediately (for external spline/timeline camera drivers). */
1072
+ setCameraPose: (pose: CameraPose) => void;
1073
+ setLighting: (preset: string, opts?: LightingOptions) => void;
1074
+ setFlipSpeed: (speed: number) => void;
1075
+ setArcPeak: (peak: number) => void;
1076
+ setTiltShift: (enabled: boolean, opts?: TiltShiftOptions) => void;
1077
+ setCinematicDrift: (enabled: boolean, opts?: DriftOptions) => void;
1078
+ projectRect: (imageId: string, view: Camera.View) => ProjectedRect | null;
1079
+ }
1080
+ }
1081
+
987
1082
  /**
988
1083
  * # Image content data
989
1084
  *
@@ -1573,6 +1668,10 @@ declare module '@micrio/client' {
1573
1668
  'page-closed': ImageData.Menu;
1574
1669
  /** Triggers on album image change, containing the ids of the currently shown image(s) */
1575
1670
  'gallery-show': string[];
1671
+ /** The 3D book viewer is initialized and ready for cinematic control */
1672
+ 'book-ready': Book3D.Controller;
1673
+ /** A 3D book page flip has started (useful for synchronized paper foley audio) */
1674
+ 'book-page-flip': Book3D.PageFlipEvent;
1576
1675
  /** The grid controller has initialized */
1577
1676
  'grid-init': Grid;
1578
1677
  /** All images in the grid have loaded */
@@ -2518,6 +2617,8 @@ declare module '@micrio/client' {
2518
2617
  get hostImage(): MicrioImage | undefined;
2519
2618
  /** The {@link Grid} controller for this gallery, when `type === 'grid'` and attached. */
2520
2619
  get grid(): Grid | undefined;
2620
+ /** The 3D book cinematic controller for this gallery, when `type === 'book3d'` and mounted. */
2621
+ get book3d(): Models.Book3D.Controller | undefined;
2521
2622
  /** Finds a {@link MicrioImage} in this gallery by its Micrio ID. */
2522
2623
  getImage(id: string): MicrioImage | undefined;
2523
2624
  gotoId: (id: string) => Promise<MicrioImage | undefined>;