@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
23 lines (22 loc) • 1.07 kB
TypeScript
import type { ComputeStepOptions, DistanceCalculator, ESLIncrementalScrollOptions } from './incremental-scroll-types';
/**
* ESLIncrementalScrollAxisStepper encapsulates per-axis easing/acceleration logic.
* It receives raw distance to target (signed) and returns incremental delta to apply this frame.
*/
export declare class ESLIncrementalScrollAxisStepper {
private calcDistance;
private options;
protected initialTime: number;
protected startTime: number;
protected lastUnstableTime: number;
protected maxStepIncrement: number;
constructor(calcDistance: DistanceCalculator, options: ESLIncrementalScrollOptions);
/**
* Computes the scroll delta for current animation frame.
* Returns 0 when target is reached (distance less than 1px).
* Gradually increases step size for smooth acceleration.
*/
computeStep(options: ComputeStepOptions): number;
/** Determines if scrolling should continue. Stops when stability threshold is exceeded or timeout is reached */
shouldContinueStepping(): boolean;
}