UNPKG

threepipe

Version:

A modern 3D viewer framework built on top of three.js, written in TypeScript, designed to make creating high-quality, modular, and extensible 3D experiences on the web simple and enjoyable.

118 lines 3.89 kB
import { ValOrFunc } from 'ts-browser-helpers'; import { IUiConfigContainer, UiObjectConfig, UiObjectType } from 'uiconfig.js'; import { AnimationOptions, Easing } from '@repalash/popmotion'; import { EasingFunctionType } from './animation'; import { ThreeViewer } from '../viewer'; import { AnimationResult } from '../plugins'; import { EventDispatcher } from 'three'; export type TUpdaterType = (() => void); export interface IAnimationObject<V> { access?: string; duration?: number; delay?: number; ease?: Easing | EasingFunctionType; updater?: (TUpdaterType)[]; animSet?: IAnimSet; animSetParallel?: boolean; name?: string; options: AnimationOptions<V>; values: V[]; offsets?: number[]; animate?: (delay?: number, canComplete?: boolean) => AnimationResult; result?: AnimationResult; uiRef?: UiObjectConfig; uiObjectType?: UiObjectType; targetObject?: Record<string, any>; } export type IAnimSet = (IAnimationObject<any>)[]; export declare function extractAnimationKey(o: IAnimationObject<any>, extraGetters?: Record<string, (key: string, acc: string[]) => { tar: any; acc: string[]; onChange?: () => void; } | undefined>): { key: undefined; tar: any; onChange?: undefined; } | { key: string; tar: any; onChange: (() => void) | undefined; }; export interface AnimationObjectEventMap { 'animationAdd': { animation: AnimationObject; }; 'animationRemove': { animation: AnimationObject; fromChild: boolean; }; 'update': object; } export declare class AnimationObject<V = any> extends EventDispatcher<AnimationObjectEventMap> implements IAnimationObject<V>, IUiConfigContainer { uuid: string; setDirty: () => void; name: string; access: string; values: V[]; offsets: number[]; options: AnimationOptions<V>; duration: number; delay: number; /** * Number of times to repeat the animation. * Doesn't work right now */ repeat: number; /** * Delay between repeats in milliseconds. * Doesn't work right now */ repeatDelay: number; /** * Type of repeat behavior. * - 'loop': repeats the animation from the beginning. * - 'reverse': plays the animation in reverse after it completes. * - 'mirror': plays the animation in reverse after it completes. todo only mirrors the time, not values? * * Doesn't work right now */ repeatType: 'loop' | 'reverse' | 'mirror'; ease: EasingFunctionType; updater: TUpdaterType[]; uiObjectType?: UiObjectType; get targetObject(): Record<string, any> | undefined; updateScene: boolean; updateCamera: boolean; updateViewer: boolean; updateTarget: boolean; target?: Record<string, any>; readonly viewer?: ValOrFunc<ThreeViewer | undefined>; getViewer(): ThreeViewer | undefined; constructor(target?: object | undefined, viewer?: ValOrFunc<ThreeViewer | undefined>, name?: string); fromJSON(data: any, meta?: any): this; protected _onAccessChanged(): void; private _thisValueCloner; addKeyframe(time: number): { undo: () => void; redo: () => void; } | undefined; updateKeyframe(index: number): { undo: () => void; redo: () => void; } | undefined; refreshUi(): void; parent?: AnimationObject; add(o: AnimationObject): void; remove(o: AnimationObject, fromChild?: boolean): void; private _upfn; animate(delay?: number, canComplete?: boolean): AnimationResult; result: AnimationResult | undefined; stop(): void; removeFromParent2(): Promise<void>; removeFromParent(): void; animSetParallel: boolean; animSet: AnimationObject[]; addAnimation(): AnimationObject<any>; uiConfig: UiObjectConfig; } //# sourceMappingURL=AnimationObject.d.ts.map