framer-motion
Version:
An open source and production-ready motion library for React on the web
28 lines (27 loc) • 1.5 kB
TypeScript
import { ResolvedValues } from "../../types";
import { DOMVisualElementOptions, HTMLMutableState, TransformOrigin } from "../types";
import { MotionProps } from "../../../motion/types";
import { BoxDelta, Point2D } from "../../../types/geometry";
import { LayoutState } from "../../utils/state";
/**
* Build a CSS transform style from individual x/y/scale etc properties.
*
* This outputs with a default order of transforms/scales/rotations, this can be customised by
* providing a transformTemplate function.
*/
export declare function buildTransform({ transform, transformKeys }: HTMLMutableState, { enableHardwareAcceleration, allowTransformNone, }: DOMVisualElementOptions, transformIsDefault: boolean, transformTemplate?: MotionProps["transformTemplate"]): string;
/**
* Build a transformOrigin style. Uses the same defaults as the browser for
* undefined origins.
*/
export declare function buildTransformOrigin({ originX, originY, originZ, }: TransformOrigin): string;
/**
* Build a transform style that takes a calculated delta between the element's current
* space on screen and projects it into the desired space.
*/
export declare function buildLayoutProjectionTransform({ x, y }: BoxDelta, treeScale: Point2D, latestTransform?: ResolvedValues): string;
/**
* Take the calculated delta origin and apply it as a transform string.
*/
export declare function buildLayoutProjectionTransformOrigin({ deltaFinal, }: LayoutState): string;
export declare const identityProjection: string;