@mcmhomes/panorama-viewer
Version:
Provides React components to render panoramas.
77 lines (76 loc) • 3.25 kB
TypeScript
/**
* @exports
* @typedef {Object} PanoramaViewerProps
* @property {string} homeId
* @property {string|null} [homeVersion]
* @property {string|null} [host]
* @property {string|null} [styleId]
* @property {string|null} [locationId]
* @property {Object.<string|symbol,string>|null} [skus]
* @property {((error:{canRetry:boolean, retry:()=>void, message:string, reason:string, id:string, data:Object})=>void)|null} [onError]
* @property {((error:{canRetry:boolean, retry:()=>void, message:string, reason:string, id:string, data:Object})=>import('react').ReactNode)|null} [errorWidget]
* @property {(()=>import('react').ReactNode)|null} [loadingWidget]
* @property {number|null} [minFov]
* @property {number|null} [maxFov]
* @property {((aspectRatio:number)=>number)|null} [calculateFov] With this you can override how the field of view is calculated from the aspect ratio, for example: (aspectRatio) => 109.22 - (16.69 * aspectRatio)
* @property {((newFov:number)=>void)|null} [onFovChanged]
* @property {{yaw:number, pitch:number}|null} [initialCameraRotation]
* @property {((newRotation:{yaw:number, pitch:number})=>void)|null} [onCameraRotationChanged]
* @property {number|null} [lookSpeed]
* @property {number|null} [lookSpeedX]
* @property {number|null} [lookSpeedY]
* @property {number|null} [zoomSpeed]
* @property {string|null} [basisTranscoderPath]
*/
/**
* The PanoramaViewer component is the main component for rendering a panoramic home.
*
* @component
* @type {import('react').NamedExoticComponent<PanoramaViewerProps>}
*/
export const PanoramaViewer: import("react").NamedExoticComponent<PanoramaViewerProps>;
export type PanoramaViewerProps = {
homeId: string;
homeVersion?: string | null | undefined;
host?: string | null | undefined;
styleId?: string | null | undefined;
locationId?: string | null | undefined;
skus?: any | null;
onError?: ((error: {
canRetry: boolean;
retry: () => void;
message: string;
reason: string;
id: string;
data: any;
}) => void) | null | undefined;
errorWidget?: ((error: {
canRetry: boolean;
retry: () => void;
message: string;
reason: string;
id: string;
data: any;
}) => import("react").ReactNode) | null | undefined;
loadingWidget?: (() => import("react").ReactNode) | null | undefined;
minFov?: number | null | undefined;
maxFov?: number | null | undefined;
/**
* With this you can override how the field of view is calculated from the aspect ratio, for example: (aspectRatio) => 109.22 - (16.69 * aspectRatio)
*/
calculateFov?: ((aspectRatio: number) => number) | null | undefined;
onFovChanged?: ((newFov: number) => void) | null | undefined;
initialCameraRotation?: {
yaw: number;
pitch: number;
} | null | undefined;
onCameraRotationChanged?: ((newRotation: {
yaw: number;
pitch: number;
}) => void) | null | undefined;
lookSpeed?: number | null | undefined;
lookSpeedX?: number | null | undefined;
lookSpeedY?: number | null | undefined;
zoomSpeed?: number | null | undefined;
basisTranscoderPath?: string | null | undefined;
};