Measure API

Detailed listing of all measure related features of Svelte Motion. A lot of the wording is directly copied from framer-motion, Copyright (c) 2018 Framer B.V. MIT License.

AnimationCompleteListener

(definition: AnimationDefinition ) => void

AnimationStartListener

() => void

Axis

{ min:number, max: number }
A description of a single axis using non-axis specific terms to denote the min and max
value of any axis.

AxisBox2D

{ x: Axis , y: Axis }
A description of a bounding box describing each axis individually. This allows us
to treate each axis generically.

AxisDelta

interface
The transform delta that, when applied to Axis a will visually transform it to Axis b

BeforeLayoutMeasureListener

(layout: AxisBox2D ) => void

BoundingBox2D

interface
A typically user-facing description of a bounding box using traditional t/l/r/b

BoxDelta

{ x: AxisDelta , y: AxisDelta }
The transform delta that, when applied to Box a will visually transform it to Box b.

LayoutAnimationCompleteListener

() => void

LayoutMeasureListener

(layout: AxisBox2D , prevLayout: AxisBox2D ) => void

LayoutProps

interface

LayoutState

interface
Data about the element's current layout. Contains the latest measurements
as well as the latest calculations of how to project from this layout
into a given TargetProjection.

LayoutUpdateListener

(layout: AxisBox2D , prevLayout: AxisBox2D , config?: SharedLayoutAnimationConfig ) => void

OnViewportBoxUpdate

(box: AxisBox2D , delta: BoxDelta ) => void

Point2D

{x: number, y: number}
A description of a two-dimensional point

RenderListener

() => void

SetAxisTargetListener

() => void

TargetProjection

interface
Represents the size and position we want to project a given visual element into.

TransformPoint2D

(point: Point2D ) => Point2D

UpdateListener

(latest: ResolvedValues ) => void