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 , P> {
getItemAnimation(_context: ItemContext , _animation: Animation ): MaterialContext ;
getItemContext(context: MaterialGameAnimationContext , item: Omit ): {
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 ): {
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 ): {
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 , animation: Animation , originContext: ItemContext , targetContext: ItemContext , animation: Animation