import { Interpolation, keyframes, Theme } from '@emotion/react'; import { Animation, Animations } from '@gamepark/react-client'; import { DisplayedItem, GridBoundaries, ItemMove, MaterialGame, MaterialItem, MaterialMove } from '@gamepark/rules-api'; import { ItemContext, MaterialContext } from '../../../locators'; import { MaterialGameAnimationContext } from './MaterialGameAnimations'; import { ElevationConfig, Trajectory, Waypoint } from './Trajectory'; /** * Extended ItemContext that includes trajectory configuration. */ export type ItemContextWithTrajectory

= ItemContext & { trajectory?: Trajectory; }; export declare class ItemAnimations

extends Animations, MaterialMove, P> { getItemAnimation(_context: ItemContext, _animation: Animation>, _boundaries: GridBoundaries): Interpolation; getMaterialContext({ Rules, game, material, locators, playerId }: MaterialGameAnimationContext): MaterialContext; getItemContext(context: MaterialGameAnimationContext, item: Omit, 'displayIndex'>): Omit, 'displayIndex'>; /** * Generate simple from/to keyframes (legacy method). */ protected getTransformKeyframes(origin: string, destination: string, _animation: Animation>, _context: ItemContext): { name: string; styles: string; anim: 1; toString: () => string; } & string; /** * Generate keyframes with only a destination (no origin). * CSS will animate from the element's current visual state. * Used for dropped items where the drag transform is not available in the animation context. */ protected getKeyframesToDestination(destination: string, _animation: Animation>, _context: ItemContext): { name: string; styles: string; anim: 1; toString: () => string; } & string; /** * Generate keyframes with integrated elevation and optional waypoints. * The elevation is prepended to the transform chain so it operates in world coordinates. * * @param originTransforms Array of CSS transforms for the starting position * @param targetTransforms Array of CSS transforms for the ending position * @param animation The animation context * @param context The item context (may include trajectory configuration) */ protected getTrajectoryKeyframes(originTransforms: string[], targetTransforms: string[], animation: Animation>, context: ItemContextWithTrajectory): { name: string; styles: string; anim: 1; toString: () => string; } & string; /** * Generate animation CSS with elevation on the parent div and position on the child div. * * @param animationKeyframes The generated keyframes for position (child div) * @param duration Animation duration in seconds * @param easing CSS easing function * @param elevationConfig Elevation configuration for the parent div arc * @param waypoints Trajectory waypoints — if any define elevation, waypoint-level elevation replaces the global arc */ protected getAnimationCssWithTrajectory(animationKeyframes: ReturnType, duration: number, easing?: string, elevationConfig?: ElevationConfig | false, waypoints?: Pick[]): Interpolation; /** * Compute animation for sibling items whose position depends on a move that hasn't been applied yet. * Simulates the move to get the future state, then animates from current to future position. */ protected getPreMoveSiblingAnimation(context: ItemContext, animation: Animation>): Interpolation; /** * Compute animation for a sibling item given origin and target contexts. * Returns animation CSS if the item's position changed, undefined otherwise. */ protected computeSiblingAnimation(item: MaterialItem, originContext: ItemContext, targetContext: ItemContext, animation: Animation>): Interpolation; }