UNPKG

@google/model-viewer

Version:

Easily display interactive 3D models on the web and in AR!

92 lines (91 loc) 3.36 kB
import ModelViewerElementBase, { Vector3D } from '../model-viewer-base.js'; import { NumberNode } from '../styles/parsers.js'; import { ChangeSource } from '../three-components/SmoothControls.js'; import { Constructor } from '../utilities.js'; export declare const DEFAULT_FOV_DEG = 30; export declare const OLD_DEFAULT_FOV_DEG = 45; export declare const DEFAULT_CAMERA_ORBIT = "0deg 75deg 105%"; export declare const DEFAULT_INTERACTION_PROMPT_THRESHOLD = 3000; export declare const INTERACTION_PROMPT = ". Use mouse, touch or arrow keys to move."; export interface CameraChangeDetails { source: ChangeSource; } export interface SphericalPosition { theta: number; phi: number; radius: number; toString(): string; } export declare type InteractionPromptStrategy = 'auto' | 'when-focused' | 'none'; export declare type InteractionPromptStyle = 'basic' | 'wiggle'; export declare type InteractionPolicy = 'always-allow' | 'allow-when-focused'; export declare type TouchAction = 'pan-y' | 'pan-x' | 'none'; export declare type Bounds = 'tight' | 'legacy'; export declare const InteractionPromptStrategy: { [index: string]: InteractionPromptStrategy; }; export declare const InteractionPromptStyle: { [index: string]: InteractionPromptStyle; }; export declare const InteractionPolicy: { [index: string]: InteractionPolicy; }; export declare const TouchAction: { [index: string]: TouchAction; }; export declare const fieldOfViewIntrinsics: (element: ModelViewerElementBase & ControlsInterface) => { basis: NumberNode<"rad">[]; keywords: { auto: null[]; }; }; export declare const cameraOrbitIntrinsics: (element: ModelViewerElementBase) => { basis: (NumberNode<"m"> | NumberNode<"rad">)[]; keywords: { auto: (NumberNode<"%"> | null)[]; }; }; export declare const cameraTargetIntrinsics: (element: ModelViewerElementBase) => { basis: NumberNode<"m">[]; keywords: { auto: null[]; }; }; export declare const $controls: unique symbol; export declare const $promptElement: unique symbol; export declare const $panElement: unique symbol; export declare const $promptAnimatedContainer: unique symbol; export declare interface ControlsInterface { cameraControls: boolean; cameraOrbit: string; cameraTarget: string; fieldOfView: string; minCameraOrbit: string; maxCameraOrbit: string; minFieldOfView: string; maxFieldOfView: string; interactionPrompt: InteractionPromptStrategy; interactionPromptStyle: InteractionPromptStyle; interactionPolicy: InteractionPolicy; interactionPromptThreshold: number; orbitSensitivity: number; touchAction: TouchAction; bounds: Bounds; interpolationDecay: number; disableZoom: boolean; enablePan: boolean; getCameraOrbit(): SphericalPosition; getCameraTarget(): Vector3D; getFieldOfView(): number; getMinimumFieldOfView(): number; getMaximumFieldOfView(): number; getIdealAspect(): number; jumpCameraToGoal(): void; updateFraming(): Promise<void>; resetInteractionPrompt(): void; zoom(keyPresses: number): void; } export declare const ControlsMixin: <T extends Constructor<ModelViewerElementBase, object>>(ModelViewerElement: T) => { new (...args: any[]): ControlsInterface; prototype: ControlsInterface; } & object & T;