UNPKG

@splinetool/viewer

Version:

Spline is a collaborative design platform for creating production-ready interactive experiences in multiple dimensions. © 2024 Spline, Inc.

83 lines (82 loc) 2.67 kB
import { LitElement } from 'lit'; export declare type LoadingType = 'auto' | 'lazy' | 'eager'; export declare type EventsTargetType = 'local' | 'global'; export declare type HintType = 'drag'; export declare type PreloaderAnimType = 'spinner-small-dark' | 'spinner-small-light' | 'spinner-big-dark' | 'spinner-big-light'; /** * Spline scene viewer */ export declare class SplineViewer extends LitElement { static styles: import("lit").CSSResult; /** * The url of the .splinecode file as exported from Spline Editor. */ url: string | null; /** * The width of the canvas */ width: number | undefined; /** * The height of the canvas */ height: number | undefined; /** * Background color */ background: string | undefined; /** * Preloading strategy ('auto', 'lazy' or 'eager') */ loading: LoadingType; /** * Enables auto unloading of the canvas / spline when it leaves the viewport */ unloadable: boolean; /** * Target of the mouse events, can either be 'local' (ie the canvas) or global (window) */ eventsTarget: EventsTargetType | undefined; /** * Target of the mouse events, can either be 'local' (ie the canvas) or global (window) */ hint?: boolean; /** * @deprecated Use loading-anim-type instead * When true it displays the spinner preloader. */ loadingAnim: boolean; /** * Type of spinner preloader, can be 'spinner-small-dark', 'spinner-small-light' ,'spinner-big-dark', 'spinner-big-light' or undefined */ loadingAnimType?: PreloaderAnimType; private _spline; protected _intersectionObserver: IntersectionObserver | null; protected _isElementInViewport: boolean; protected _loaded: boolean; protected _container: HTMLElement; protected _canvas: HTMLCanvasElement; protected _logo: HTMLElement; protected _hintDrag: HTMLElement; protected _preloader: HTMLElement; protected _spinner: HTMLElement; protected _slot: HTMLElement; private _loadedUrl; private _wasContextLost; constructor(); private rerender; protected unload(): void; protected _handleContextLost: () => void; protected _handleContextRestored: () => void; protected recreateCanvas(): void; protected load(): void; protected onLoaded: () => void; protected onInteract: () => void; updated(changedProperties: Map<string | number | symbol, any>): void; connectedCallback(): void; disconnectedCallback(): void; } declare global { interface HTMLElementTagNameMap { 'spline-viewer': SplineViewer; } }