import { Obj } from '@mathigon/core'; import { ElementView } from './elements'; export type AnimationCancel = () => void; export type AnimationCallback = (p: number, dt: number, cancel: AnimationCancel) => void; export type AnimationResponse = { cancel: AnimationCancel; promise: Promise; }; export declare const ResolvedAnimation: { cancel: () => undefined; promise: Promise; }; /** * Runs an animation. If no duration is provided, the animation will run * indefinitely, and call `callback` with the time since start as first * argument. If a duration is provided, the first callback argument is instead * the proportion of the duration passed (between 0 and 1). The second callback * argument is the time difference since the last animation frame, and the * third callback argument is a `cancel()` function to stop the animation. */ export declare function animate(callback: AnimationCallback, duration?: number): AnimationResponse; /** * Applies an easing function to a number `t` between 0 and 1. Options include * `quad`, `cubic`, `quart`, `quint`, `circ`, `sine`, `exp`, `back`, `elastic`, * `swing`, `spring` and `bounce`, optionally followed by `-in` or `-out`. The * `s` parameter is only used by `back` and `elastic` easing. */ export declare function ease(type: string, t?: number, s?: number): number; type AnimationValue = string | number; export type AnimationProperties = Obj; export declare function transition($el: ElementView, properties: AnimationProperties, duration?: number, _delay?: number, easing?: string): AnimationResponse; export declare function enter($el: ElementView, effect?: string, duration?: number, _delay?: number): AnimationResponse; export declare function exit($el: ElementView, effect?: string, duration?: number, delay?: number, remove?: boolean): AnimationResponse; export {};