@cloudcome/utils-core
Version:
cloudcome core utils
47 lines (46 loc) • 2.58 kB
TypeScript
/**
* https://github.com/gre/bezier-easing
* BezierEasing - use bezier curve for transition easing function
* by Gaëtan Renaudeau 2014 - 2015 – MIT License
*/
declare function LinearEasing(x: number): number;
/**
* 创建一个基于贝塞尔曲线的缓动函数。
*
* @param x1 - 贝塞尔曲线的第一个控制点的 X 坐标,必须在 [0, 1] 范围内。
* @param y1 - 贝塞尔曲线的第一个控制点的 Y 坐标,必须在 [0, 1] 范围内。
* @param x2 - 贝塞尔曲线的第二个控制点的 X 坐标,必须在 [0, 1] 范围内。
* @param y2 - 贝塞尔曲线的第二个控制点的 Y 坐标,必须在 [0, 1] 范围内。
* @returns 返回一个缓动函数,该函数接受一个参数 x(范围在 0 到 1 之间),并返回相应的缓动值。
* @throws 如果 mX1 或 mX2 不在 [0, 1] 范围内,则抛出错误。
*/
export declare function createEasingFn(x1: number, y1: number, x2: number, y2: number): typeof LinearEasing;
export declare const easingEase: typeof LinearEasing;
export declare const easingLinear: typeof LinearEasing;
export declare const easingSnap: typeof LinearEasing;
export declare const easingIn: typeof LinearEasing;
export declare const easingOut: typeof LinearEasing;
export declare const easingInOut: typeof LinearEasing;
export declare const easingInQuad: typeof LinearEasing;
export declare const easingInCubic: typeof LinearEasing;
export declare const easingInQuart: typeof LinearEasing;
export declare const easingInQuint: typeof LinearEasing;
export declare const easingInSine: typeof LinearEasing;
export declare const easingInExpo: typeof LinearEasing;
export declare const easingInCirc: typeof LinearEasing;
export declare const easingInBack: typeof LinearEasing;
export declare const easingOutQuad: typeof LinearEasing;
export declare const easingOutCubic: typeof LinearEasing;
export declare const easingOutQuart: typeof LinearEasing;
export declare const easingOutQuint: typeof LinearEasing;
export declare const easingOutSine: typeof LinearEasing;
export declare const easingOutExpo: typeof LinearEasing;
export declare const easingOutCirc: typeof LinearEasing;
export declare const easingOutBack: typeof LinearEasing;
export declare const easingInOutQuart: typeof LinearEasing;
export declare const easingInOutQuint: typeof LinearEasing;
export declare const easingInOutSine: typeof LinearEasing;
export declare const easingInOutExpo: typeof LinearEasing;
export declare const easingInOutCirc: typeof LinearEasing;
export declare const easingInOutBack: typeof LinearEasing;
export {};