import type { Frame } from './frame.js'; import type { Game } from './game.js'; import { Animation } from './animation.js'; import type { Image } from '../display/image.js'; import type { FrameData } from './frame_data.js'; export declare class AnimationManager { sprite: Image; game: Game; currentFrame: Frame | null; currentAnim: Animation | null; updateIfVisible: boolean; isLoaded: boolean; _frameData: FrameData | null; _anims: Record; _outputFrames: number[]; _frameIndex: number; /** * Creates a new AnimationManager instance. * @param {Image} sprite - Reference to the parent Sprite. */ constructor(sprite: Image); /** * Destroys the AnimationManager and cleans up resources. */ destroy(): void; /** * Loads frame data into the AnimationManager. * @param {FrameData} frameData - The FrameData to load. * @param {string|number} frame - The frame index or name to set as current. * @returns {boolean} True if the frame data was loaded successfully, false otherwise. */ loadFrameData(frameData: FrameData | null, frame: string | number): boolean; /** * Copies frame data into the AnimationManager. * @param {FrameData} frameData - The FrameData to copy. * @param {string|number} frame - The frame index or name to set as current. * @returns {boolean} True if the frame data was copied successfully, false otherwise. */ copyFrameData(frameData: FrameData, frame: string | number): boolean; /** * Adds a new animation to the AnimationManager. * @param {string} name - The name of the animation. * @param {number[] | string[] | null | undefined} frameList - The list of frames to include in the animation. * @param {number} frameRate - The frame rate of the animation (frames per second). * @param {boolean} loop - Whether the animation should loop. * @param {boolean | undefined} useNumericIndex - Whether to treat frameList as numeric indices. * @returns {Animation} The created Animation object. */ add(name: string, frameList: number[] | string[] | null | undefined, frameRate?: number, loop?: boolean, useNumericIndex?: boolean): Animation; /** * Validates a list of frames against the current frame data. * @param {string[] | number[]} frames - The list of frames to validate. * @param {boolean} useNumericIndex - Whether to treat frameList as numeric indices. * @returns {boolean} True if all frames are valid, false otherwise. */ validateFrames(frames: string[] | number[], useNumericIndex?: boolean): boolean; /** * Plays an animation by name. * @param {string} name - The name of the animation to play. * @param {number} frameRate - The frame rate (frames per second) to play at, or null to use the animation's default. * @param {boolean} loop - Whether the animation should loop, or null to use the animation's default. * @returns {Animation} The Animation object that was played, or null if not found. */ play(name: string, frameRate?: number | null, loop?: boolean | null): Animation | null; /** * Stops an animation by name. * @param {string} name - The name of the animation to stop, or null to stop the current animation. * @param {boolean} resetFrame - Whether to reset the frame to the first frame of the animation. */ stop(name?: string | null, resetFrame?: boolean): void; /** * Updates the animation manager state. * @returns {boolean} True if an animation was updated, false otherwise. */ update(): boolean; /** * Advances the current animation by a specified number of frames. * @param {number} quantity - The number of frames to advance by. */ next(quantity: number): void; /** * Moves the current animation back by a specified number of frames. * @param {number} quantity - The number of frames to move back by. */ previous(quantity: number): void; /** * Gets an animation by name. * @param {string} name - The name of the animation to retrieve. * @returns {Animation} The Animation object, or null if not found. */ getAnimation(name: string): Animation | null; /** * Refreshes the current frame texture (not implemented). */ refreshFrame(): void; /** * Gets the frame data used by this AnimationManager. * @returns {FrameData} The FrameData object. */ get frameData(): FrameData | null; /** * Gets the total number of frames in the frame data. * @returns {number} The total number of frames. */ get frameTotal(): number; /** * Gets the paused state of the current animation. * @returns {boolean} True if the current animation is paused, false otherwise. */ get paused(): boolean; /** * Sets the paused state of the current animation. */ set paused(value: boolean); /** * Gets the name of the current animation. * @returns {string} The name of the current animation, or null if no animation is active. */ get name(): string | null; /** * Gets the current frame index. * @returns {number} The current frame index. */ get frame(): number; /** * Sets the current frame index. */ set frame(value: number); /** * Gets the current frame name. * @returns {string} The current frame name, or null if no frame is set. */ get frameName(): string | null; /** * Sets the current frame by name. */ set frameName(value: string | null); } //# sourceMappingURL=animation_manager.d.ts.map