import { ByID } from '../../data'; import { Animation } from '../animation'; import { LayerClip } from '../layerclip'; import { StreamState } from '../stream'; import { Track } from './track'; export interface ResolvedFunctionTrackEntity { id: string; obj: any; func: (...args: any[]) => any; t0: number; args: ByID; } /** * Manages the execution of functions at specific times during animation playback. * Maintains a sorted list of function entities, allowing for seeking, pausing, and ticking in the animation stream. * Handles looping and track time boundaries, ensuring functions are triggered at the correct moments. * * @param animation The associated Animation instance. */ export declare class FunctionTrack extends Track { readonly animation: Animation; private _entities; private _entitiesById; private _entitiesDirty; private _lastTick?; /** * Creates an instance of FunctionTrack. * @param animation The associated Animation instance. */ constructor(animation: Animation); /** * Getter for the list of paths influenced by the track. * As this track does not influence any paths, it returns an empty array. * * @returns An empty array. */ get influencedPaths(): string[]; computePathProperty(t: number, p: string, valueBefore: any, parentWeight?: number): any; /** * Adds a function entity to the track. Marks the entities list as dirty. * * @param k The ResolvedFunctionTrackEntity to be added. */ addBlock(k: ResolvedFunctionTrackEntity): void; /** * Sets the function entities for the track using an id-indexed object. Marks the entities list as dirty. * * @param entities An object mapping entity IDs to ResolvedFunctionTrackEntities. */ setBlocksById(weights: { [id: string]: ResolvedFunctionTrackEntity; }): void; /** * Getter for sorted function entities by their start time. * * @returns A sorted array of ResolvedFunctionTrackEntities. */ get sortedBlocks(): ResolvedFunctionTrackEntity[]; /** * Seeks to a specific time in the track's stream. * Updates the last tick time to the specified time. * * @param t The time to seek to. * @param rate The rate of play. * @param isActive Indicates if the streaming is active. * @param active The current active LayerClip, null, or undefined. */ streamSeek(t: number, rate: number, isActive: boolean, active: LayerClip | null | undefined): void; /** * Updates the track's stream based on the current state and time. * Intended to trigger functions at specific times during the animation playback. * * @param clipState The current state of the stream. * @param t The current time. * @param rate The rate of play. * @param isActive Indicates if the streaming is active. * @param active The current active LayerClip, null, or undefined. * @param force Optional flag to force an update. * @param stalled Optional flag indicating if the stream is stalled. * @param parentWeight Optional weight from the parent track. */ streamTick(clipState: StreamState, t: number, rate: number, isActive: boolean, active: LayerClip | null | undefined, force?: boolean, stalled?: boolean, parentWeight?: number): void; /** * Pauses the streaming of this track. This implementation is a no-op for FunctionTrack. * * @param isActive Indicates if the streaming is active. * @param active The current active LayerClip, null, or undefined. */ streamPause(isActive: boolean, active: LayerClip | null | undefined): void; private _resolveBlocksBetween; private _getBoundedT; }