import { type ReactNode } from "react"; import { Animated, type EasingFunction, type StyleProp, type ViewProps, type ViewStyle } from "react-native"; export interface LoopChannelOptions { /** Cycle length in ms. */ period: number; /** Shape of one cycle: maps the linear 0..1 phase to the channel's 0..1 value * (`thereAndBack`, `keyframes` in src/style/motion.ts). Linear when * omitted, which is the sawtooth a travelling layer wraps on. */ shape?: EasingFunction; /** Points a shaped channel is sampled at per cycle (the native interpolation's * steps and the web keyframes alike). A linear channel needs none. Default 64; * raise it for a shape with a sharp corner. */ samples?: number; } /** What a loop view reads from its channel. Playing: `epoch` is the wall-clock * millisecond at which the current cycle count began at phase 0. Parked: `phase` * is where the channel holds. */ export interface LoopChannelState { playing: boolean; epoch: number; phase: number; } export interface LoopChannel { readonly period: number; /** The sampled shape as an interpolation table, or null for a linear channel. */ readonly shape: { inputRange: number[]; outputRange: number[]; } | null; /** The linear cycle position as an Animated.Value. It advances on iOS and Android * only; on the web the channel runs on CSS time and this value stays parked, so * bind through `LoopView` rather than through `Animated` for anything that must * move on every platform. */ readonly phase: Animated.Value; /** Start playing from `phase`, or resume from where the channel last stopped. */ play(phase?: number): void; /** Stop and hold at `phase`, remembering the resume point a stop captured. */ park(phase: number): void; /** Stop where the channel is now, capturing the phase for the next `play()`. */ stop(): void; /** The cycle position, 0..1, at `now` (wall-clock ms; defaults to Date.now()). */ position(now?: number): number; subscribe(listener: () => void): () => void; state(): LoopChannelState; } export declare function createLoopChannel(options: LoopChannelOptions): LoopChannel; /** A piecewise-linear map of a channel's value onto a style value, the way * `Animated.interpolate` reads it: `inputRange` rises from 0 to 1 across the channel's * value, `outputRange` carries the matching style values, and the segments between * are straight. `offset` reads the channel that many cycles ahead (wrapping), so * sibling layers on one channel stagger without a channel each. */ export interface LoopTrack { channel: LoopChannel; inputRange: readonly number[]; outputRange: readonly number[]; offset?: number; } /** Evaluate a track's map at a channel value, clamped at the ends. */ export declare function trackAt(track: Pick, value: number): number; /** A track's style value at cycle position `phase`. */ export declare function trackValueAt(track: LoopTrack, phase: number): number; /** The channel values a track is sampled at over one cycle of its own timeline (the * channel's cycle shifted by the track's offset): the track's own breakpoints on a * linear channel, which is exact, or the channel's shape grid on a shaped one. Each * entry pairs the cycle position with the channel value there. */ export declare function trackSamples(track: LoopTrack): Array<{ at: number; value: number; }>; /** The view's own props pass through to the host view (accessibility flags, testID, * pointer events); the tracks are the only additions. */ export interface LoopViewProps extends Omit { style?: StyleProp; children?: ReactNode; opacity?: LoopTrack; /** Transform components, applied translate, rotate, then scale. A number is a * constant. Every animated transform component on one view must ride the same * channel with the same offset: a transform is one property on both platforms. */ scale?: LoopTrack | number; /** Degrees. */ rotate?: LoopTrack | number; translateX?: LoopTrack | number; translateY?: LoopTrack | number; } declare function WebLoopView({ style, children, opacity, scale, rotate, translateX, translateY, ...rest }: LoopViewProps): import("react").JSX.Element; /** A view whose opacity and transform loop with a channel, on the native driver on * iOS and Android and as a compositor-run CSS animation on the web. */ export declare const LoopView: typeof WebLoopView; export {}; //# sourceMappingURL=loop.d.ts.map