/** * AnimationEngine.ts * * Core animation system for HoloScript+. * Provides keyframe interpolation, easing functions, * and a centralized update loop for all active animations. */ import { AnimClip } from './AnimationClip'; import { BoneSystem } from './BoneSystem'; export type EasingFn = (t: number) => number; export declare const Easing: { readonly linear: (t: number) => number; readonly easeInQuad: (t: number) => number; readonly easeOutQuad: (t: number) => number; readonly easeInOutQuad: (t: number) => number; readonly easeInCubic: (t: number) => number; readonly easeOutCubic: (t: number) => number; readonly easeInOutCubic: (t: number) => number; readonly easeInExpo: (t: number) => number; readonly easeOutExpo: (t: number) => number; readonly easeInOutExpo: (t: number) => number; readonly easeOutBack: (t: number) => number; readonly easeOutElastic: (t: number) => number; readonly easeOutBounce: (t: number) => number; }; export interface Keyframe { time: number; value: T; easing?: EasingFn; } export interface AnimationClip { id: string; property: string; keyframes: Keyframe[]; duration: number; loop: boolean; pingPong: boolean; delay: number; onComplete?: () => void; } export interface ActiveAnimation { clip: AnimationClip; elapsed: number; isPlaying: boolean; isPaused: boolean; direction: 1 | -1; loopCount: number; } export interface SkeletalPoseOptions { /** Map an AnimClip target path to a BoneSystem ID. Identity by default. */ resolveBoneId?: (targetPath: string) => string | undefined; /** Reject missing bones and unsupported pose tracks before mutating the rig. */ strict?: boolean; } export interface SkeletalPlaybackOptions extends SkeletalPoseOptions { delay?: number; onComplete?: () => void; } export interface SkeletalPoseApplication { clipId: string; sampleTime: number; appliedTracks: number; updatedBoneIds: string[]; missingTargets: string[]; unsupportedTrackIds: string[]; } export declare class AnimationEngine { private animations; private propertySetters; private skeletalAnimations; /** * Register an animation clip and start playing it. */ play(clip: AnimationClip, setter: (value: number) => void): void; /** * Register an AnimClip for skeletal playback through the centralized update * loop. AnimClip owns seconds-based sampling, speed, and wrap behavior. */ playSkeletal(clip: AnimClip, bones: BoneSystem, options?: SkeletalPlaybackOptions): void; /** * Sample an engine-native AnimClip and atomically apply its local pose to a * BoneSystem. Strict mode is the default so mapping gaps cannot false-pass * as a valid partial pose. */ applySkeletalPose(clip: AnimClip, bones: BoneSystem, time: number, options?: SkeletalPoseOptions): SkeletalPoseApplication; /** * Stop and remove an animation. */ stop(clipId: string): void; /** * Pause an animation. */ pause(clipId: string): void; /** * Resume a paused animation. */ resume(clipId: string): void; /** * Check if an animation is active. */ isActive(clipId: string): boolean; /** * Get all active animation IDs. */ getActiveIds(): string[]; /** * Update all active animations. Call this every frame. */ update(delta: number): void; /** * Stop all animations. */ clear(): void; } //# sourceMappingURL=AnimationEngine.d.ts.map