@ssgoi/core
Version:
Core animation engine for SSGOI - Native app-like page transitions with spring physics
35 lines • 1.04 kB
TypeScript
import { AnimationControls, StyleObject } from './types';
import { Integrator } from '../integrator';
export type RunnerOptions = {
tick?: (value: number) => void;
css?: {
element: HTMLElement;
style: (progress: number) => StyleObject;
};
};
/**
* Common options passed to bound runner
*/
export interface BoundRunnerOptions {
integrator: Integrator;
from: number;
to: number;
velocity?: number;
onComplete: () => void;
onStart?: () => void;
}
/**
* Bound runner - mode-specific options already applied
*/
export type BoundRunner = (options: BoundRunnerOptions) => AnimationControls;
export declare class RunnerProvider {
/**
* Get bound runner based on animation mode
*
* @param options Animation mode options (tick or css)
* @returns Bound runner function (empty runner if no animation mode specified)
* @throws Error if both tick and css are provided
*/
static from(options: RunnerOptions): BoundRunner;
}
//# sourceMappingURL=provider.d.ts.map