import { FadeParameters, BlendType } from '../../data'; import { Animation } from '../animation'; import { Keyframe } from '../keyframe'; import { Track } from './track'; /** * Manages keyframes for animating entity properties over time. * Handles initialization of property paths, registration of entities and paths, sorting of keyframes and weights. * Supports computation of interpolated values between keyframes based on blend types. * Facilitates adding, retrieving, and setting keyframes and weights, enabling precise and flexible property animation. * * @param anim The associated Animation instance. * @param _entityID The ID of the entity associated with the track. * @param _entity The entity itself. * @param property The property or array of properties to be animated. * @param id Optional unique identifier for the PropertyTrack. */ export declare class PropertyTrack extends Track { private _entityID; private _entity; /** * Path representing the property being animated. */ path: string; private _property; private _path; private _keyframes; private _keyframesById; private _keyframesDirty; private _weights; private _weightsById; private _weightsDirty; /** * Optional parameters for fading animation properties. */ fadeParameters?: Partial; /** * Blend type for interpolating values. */ blend: BlendType; /** * Paths influenced by this track. */ influencedPaths: string[]; /** * Creates an instance of PropertyTrack. * @param anim - The associated Animation instance. * @param _entityID - The ID of the entity associated with the track. * @param _entity - The entity itself. * @param property - The property or array of properties to be animated. * @param id - Optional unique identifier for the PropertyTrack. */ constructor(anim: Animation, _entityID: string, _entity: any, property: string | number | (string | number)[], id?: string); /** * Adds a keyframe to manage the property's animation. * * @param k The keyframe to be added. */ addKeyframe(k: Keyframe): void; /** * Retrieves a keyframe by its ID. * * @param id The ID of the keyframe to retrieve. * @returns The keyframe, if found; otherwise undefined. */ getKeyframeById(id: string): Keyframe | undefined; /** * Sets the keyframes for the track using an id-indexed object. * * @param keyframes An object mapping keyframe IDs to keyframes. */ setKeyframesById(keyframes: { [id: string]: Keyframe; }): void; /** * Getter for sorted keyframes by their time values. * * @returns A sorted array of keyframes. */ get sortedKeyframes(): Keyframe[]; /** * Adds a weight keyframe to influence the property's animation. * * @param k The weight keyframe to be added. */ addWeight(k: Keyframe): void; /** * Sets the weight keyframes for the track using an id-indexed object. * * @param weights An object mapping weight keyframe IDs to keyframes. */ setWeightsById(weights: { [id: string]: Keyframe; }): void; /** * Getter for sorted weight keyframes by their time values. * * @returns A sorted array of weight keyframes. */ get sortedWeights(): Keyframe[]; /** * Computes the fade length for a given path. * * @param path The path for which to compute the fade length. * @returns The fade length, defaulting to 0 if not specified. */ getFadeLengthForPath(path: string): number; /** * Computes the property value for a given path at a specific time. * Interpolates between keyframe values based on the specified blend type. * * @param t The time at which to compute the property. * @param p The path of the property to compute. * @param valueBefore The initial value of the property before computation. * @param parentWeight Optional weight from the parent track. * @returns The computed property value. */ computePathProperty(t: number, p: string, valueBefore: any, parentWeight?: number): any; private _computePathProperty; }