@google/model-viewer
Version:
Easily display interactive 3D models on the web and in AR!
66 lines (65 loc) • 2.51 kB
TypeScript
import { Vector3 } from 'three';
import ModelViewerElementBase from '../model-viewer-base.js';
import { NumberNode } from '../styles/parsers.js';
import { ChangeSource } from '../three-components/SmoothControls.js';
import { Constructor } from '../utilities.js';
export interface CameraChangeDetails {
source: ChangeSource;
}
export interface SphericalPosition {
theta: number;
phi: number;
radius: number;
}
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 const InteractionPromptStrategy: {
[index: string]: InteractionPromptStrategy;
};
export declare const InteractionPromptStyle: {
[index: string]: InteractionPromptStyle;
};
export declare const InteractionPolicy: {
[index: string]: InteractionPolicy;
};
export declare const DEFAULT_CAMERA_ORBIT = "0deg 75deg 105%";
export declare const fieldOfViewIntrinsics: (element: ModelViewerElementBase) => {
basis: NumberNode<"rad">[];
keywords: {
auto: null[];
};
};
export declare const cameraOrbitIntrinsics: (element: ModelViewerElementBase) => {
basis: (NumberNode<"rad"> | NumberNode<"m">)[];
keywords: {
auto: (NumberNode<"%"> | null)[];
};
};
export declare const cameraTargetIntrinsics: (element: ModelViewerElementBase) => {
basis: NumberNode<"m">[];
keywords: {
auto: null[];
};
};
export declare const DEFAULT_INTERACTION_PROMPT_THRESHOLD = 3000;
export declare const INTERACTION_PROMPT = "Use mouse, touch or arrow keys to control the camera!";
export declare const $controls: unique symbol;
export declare const $promptElement: unique symbol;
export declare const $promptAnimatedContainer: unique symbol;
export declare const $idealCameraDistance: unique symbol;
export interface ControlsInterface {
cameraControls: boolean;
cameraOrbit: string;
cameraTarget: string;
fieldOfView: string;
interactionPrompt: InteractionPromptStrategy;
interactionPromptStyle: InteractionPromptStyle;
interactionPolicy: InteractionPolicy;
interactionPromptThreshold: number;
getCameraOrbit(): SphericalPosition;
getCameraTarget(): Vector3;
getFieldOfView(): number;
jumpCameraToGoal(): void;
}
export declare const ControlsMixin: <T extends Constructor<ModelViewerElementBase>>(ModelViewerElement: T) => Constructor<ControlsInterface> & T;