framer-motion
Version:
An open source and production-ready motion library for React on the web
39 lines (38 loc) • 1.34 kB
TypeScript
import { VariantLabels } from "../../motion/types";
import { TargetAndTransition } from "../../types";
import { VisualElement } from "../types";
import { AnimationOptions } from "./animation";
export interface AnimationState {
animateChanges: (options?: AnimationOptions, type?: AnimationType) => Promise<any>;
setActive: (type: AnimationType, isActive: boolean, options?: AnimationOptions) => Promise<any>;
setAnimateFunction: (fn: any) => void;
isAnimated(key: string): boolean;
getState: () => {
[key: string]: AnimationTypeState;
};
}
export declare enum AnimationType {
Animate = "animate",
Hover = "whileHover",
Tap = "whileTap",
Drag = "whileDrag",
Focus = "whileFocus",
Exit = "exit"
}
export declare type AnimationList = string[] | TargetAndTransition[];
export declare const variantPriorityOrder: AnimationType[];
export declare function createAnimationState(visualElement: VisualElement): AnimationState;
export declare function variantsHaveChanged(prev: any, next: any): boolean;
export interface AnimationTypeState {
isActive: boolean;
protectedKeys: {
[key: string]: true;
};
needsAnimating: {
[key: string]: boolean;
};
prevResolvedValues: {
[key: string]: any;
};
prevProp?: VariantLabels | TargetAndTransition;
}