aura-glass
Version:
A comprehensive glassmorphism design system for React applications with 142+ production-ready components
101 lines • 2.88 kB
TypeScript
export interface InterpolationPoint {
x: number;
y: number;
tension?: number;
bias?: number;
continuity?: number;
}
export interface InterpolationConfig {
type: 'linear' | 'cubic' | 'hermite' | 'bezier' | 'spline';
tension?: number;
bias?: number;
continuity?: number;
alpha?: number;
}
export declare class InterpolationUtils {
/**
* Linear interpolation between two points
*/
static lerp(a: number, b: number, t: number): number;
/**
* Linear interpolation for 2D points
*/
static lerp2D(p1: {
x: number;
y: number;
}, p2: {
x: number;
y: number;
}, t: number): {
x: number;
y: number;
};
/**
* Cubic interpolation using Catmull-Rom spline
*/
static catmullRom(p0: InterpolationPoint, p1: InterpolationPoint, p2: InterpolationPoint, p3: InterpolationPoint, t: number, alpha?: number): {
x: number;
y: number;
};
private static getT;
/**
* Hermite interpolation
*/
static hermite(p0: InterpolationPoint, p1: InterpolationPoint, m0: {
x: number;
y: number;
}, m1: {
x: number;
y: number;
}, t: number): {
x: number;
y: number;
};
/**
* Cubic Bezier interpolation
*/
static bezier(p0: InterpolationPoint, p1: InterpolationPoint, p2: InterpolationPoint, p3: InterpolationPoint, t: number): {
x: number;
y: number;
};
/**
* B-spline interpolation
*/
static bSpline(points: InterpolationPoint[], t: number, degree?: number): {
x: number;
y: number;
};
private static bSplineBasis;
/**
* Smooth step interpolation
*/
static smoothStep(edge0: number, edge1: number, x: number): number;
/**
* Smoother step interpolation
*/
static smootherStep(edge0: number, edge1: number, x: number): number;
/**
* Interpolate along a path defined by points
*/
static interpolatePath(points: InterpolationPoint[], config: InterpolationConfig, t: number): {
x: number;
y: number;
};
private static interpolateLinear;
private static interpolateCubic;
private static interpolateHermite;
private static calculateTangent;
private static interpolateBezier;
}
export declare const interpolate: {
linear: (a: number, b: number, t: number) => number;
smooth: (a: number, b: number, t: number) => number;
smoother: (a: number, b: number, t: number) => number;
color: (color1: string, color2: string, t: number) => string;
path: (points: InterpolationPoint[], config: InterpolationConfig, t: number) => {
x: number;
y: number;
};
array: (arr1: number[], arr2: number[], t: number) => number[];
};
//# sourceMappingURL=interpolation.d.ts.map