/** * Easing -- pure math easing functions. * * All functions map t in [0,1] to value in [0,1]. * Zero dependencies -- pure arithmetic. * * @module */ type EasingFnShape = (t: number) => number; interface SpringConfigShape { /** Default: 170. */ readonly stiffness?: number; /** Default: 26. */ readonly damping?: number; /** Default: 1. */ readonly mass?: number; } interface EasingFns { readonly linear: EasingFnShape; readonly easeInCubic: EasingFnShape; readonly easeOutCubic: EasingFnShape; readonly easeInOutCubic: EasingFnShape; readonly easeOutExpo: EasingFnShape; readonly easeOutBack: EasingFnShape; readonly easeOutElastic: EasingFnShape; readonly easeOutBounce: EasingFnShape; readonly ease: EasingFnShape; readonly easeIn: EasingFnShape; readonly easeOut: EasingFnShape; readonly easeInOut: EasingFnShape; spring(config: SpringConfigShape): EasingFnShape; cubicBezier(x1: number, y1: number, x2: number, y2: number): EasingFnShape; springToLinearCSS(config: SpringConfigShape, sampleCount?: number): string; springNaturalDuration(config: SpringConfigShape, epsilon?: number): number; } /** * Easing -- pure math easing functions mapping t in [0,1] to value in [0,1]. * Includes standard CSS easings, cubic-bezier, spring physics, and CSS linear() export. * * @example * ```ts * const t = 0.5; * Easing.easeOutCubic(t); // 0.875 * Easing.linear(t); // 0.5 * const spring = Easing.spring({ stiffness: 200, damping: 15 }); * spring(t); // spring-physics interpolated value * const css = Easing.springToLinearCSS({ stiffness: 200, damping: 15 }); * ``` */ export declare const Easing: EasingFns; export declare namespace Easing { /** Signature of an easing function: `(t: [0..1]) => [0..1]`. */ type Fn = EasingFnShape; /** Spring parameters: stiffness, damping, mass. */ type Config = SpringConfigShape; } /** * The ONE spring config both the CSS `linear()` path and the JS floor default to * when a spring easing is authored without explicit parameters. Kept here (not in * `@czap/compiler`) so the native compiler (`resolveEasing`) and the runtime * sampler ({@link sampleRuntimeEasing}) read the SAME default — Law 4: one kernel, * never forked. */ export declare const DEFAULT_MOTION_SPRING: SpringConfigShape; /** * Self-describing easing descriptor carried in the runtime motion plan * (`RuntimeWritePlan.easing`) so the JS floor is driver-independent: it reads its * own curve rather than being handed one. `kind` mirrors the authoring * vocabulary (`'linear' | 'ease' | 'spring'`); `spring` carries the physics * config for the spring arm (defaulting to {@link DEFAULT_MOTION_SPRING}). */ export interface RuntimeEasing { readonly kind: 'linear' | 'ease' | 'spring'; readonly spring?: SpringConfigShape; } /** * Build the `(t) => value` sampler for a {@link RuntimeEasing} descriptor. * * This is the RUNTIME half of the one-kernel law (Law 4): the `spring` arm * delegates to `Easing.spring` — the EXACT function `Easing.springToLinearCSS` * samples to build the CSS `linear()` timing function — so a browser scrubbing * the JS floor and a browser running native CSS `linear()` read one identical * curve. `linear`/`ease` map to `Easing.linear` / `Easing.ease` * (the latter being `cubic-bezier(0.25, 0.1, 0.25, 1)`, i.e. CSS `ease`). */ export declare function sampleRuntimeEasing(easing: RuntimeEasing): EasingFnShape; export {}; //# sourceMappingURL=easing.d.ts.map