material-motion
Version:
Makes it easy to add rich, interactive motion to your application.
39 lines (38 loc) • 1.59 kB
TypeScript
import { MotionProperty } from '../observables';
import { State } from '../enums/State';
import { ObservableWithMotionOperators, Point2D, Spring } from '../types';
import { NumericSpring } from './NumericSpring';
/**
* `Point2DSpring` is a spring that accepts and emits `Point2D`s for its
* configuration values. Internally, it is composed of two independent
* `NumericSpring`s.
*
* Because each internal spring emits independently, `value$` will emit
* intermediate values (e.g. changing `initialValue` from `{ x: 0, y: 0 }` to
* `{ x: 5, y: 4 }` will cause 2 emissions, one when `x` changes and one when
* `y` changes.) This may be corrected in a future release, when emits could be
* batched into one per frame.
*/
export declare class Point2DSpring implements Spring<Point2D> {
readonly xSpring: NumericSpring;
readonly ySpring: NumericSpring;
readonly destination$: MotionProperty<Point2D>;
destination: Point2D;
readonly initialValue$: MotionProperty<Point2D>;
initialValue: Point2D;
readonly initialVelocity$: MotionProperty<Point2D>;
initialVelocity: Point2D;
readonly stiffness$: MotionProperty<number>;
stiffness: number;
readonly damping$: MotionProperty<number>;
damping: number;
readonly threshold$: MotionProperty<number>;
threshold: number;
readonly enabled$: MotionProperty<boolean>;
enabled: boolean;
readonly state$: ObservableWithMotionOperators<State>;
readonly state: State;
readonly value$: ObservableWithMotionOperators<Point2D>;
constructor();
}
export default Point2DSpring;