import { LottieInstance } from "../animation/types.js";
import { LottieInteraction } from "./types.js";
//#region src/interactions/lottieScrollScrub.d.ts
/** What {@link lottieScrollScrub} can be told. */
interface LottieScrollScrubOptions {
  /**
   * The stretch of the element's journey the animation maps onto, as
   * fractions 0 to 1 of it. Below the range the animation holds its first
   * frame and above it its last, which is what clamping does. The whole
   * journey unless narrowed.
   */
  range?: readonly [number, number];
  /** Which axis the journey runs along. The block axis unless said otherwise. */
  axis?: "block" | "inline";
  /** Called as the playhead's band is entered, with the travel direction. */
  onRangeEnter?: (direction: "forward" | "backward", lottie: LottieInstance) => void;
  /** Called as the band is left: at its far edge forward, its near edge back. */
  onRangeLeave?: (direction: "forward" | "backward", lottie: LottieInstance) => void;
}
/**
 * Ties the playhead to how far the animation has travelled through the
 * viewport, so scrolling scrubs it instead of time playing it.
 *
 * ```jsx
 * <LottieInteractions
 *   interactions={[
 *     lottieScrollScrub({
 *       range: [0.2, 0.45],
 *       onRangeLeave: (direction, lottie) => {
 *         if (direction === "forward") lottie.playSegments([[45, 60]]);
 *       },
 *     }),
 *   ]}
 * >
 *   <Lottie src={story} autoplay={false} />
 * </LottieInteractions>
 * ```
 *
 * Progress is the platform's own scroll timeline where the browser has one
 * and its scroller is one that scrolls, and the same arithmetic measured by
 * hand against the viewport where it does not; the numbers agree by
 * construction. While the animation is out of view nothing samples
 * at all, and playback state is held by the scrub gesture, so whatever was
 * true before the scrub is restored when it leaves.
 */
declare function lottieScrollScrub(options?: LottieScrollScrubOptions): LottieInteraction;
//#endregion
export { LottieScrollScrubOptions, lottieScrollScrub };