Optionalprops: TModuleProps<ISwipeCallbacksMap, ISwipeStaticProps, ISwipeMutableProps, Swipe>Absolute path length since swipe start.
Retrieves the module's callbacks instance.
Coordinate reference element.
Full coordinate snapshot (pointer space + movement).
Current pointer position.
Offset from swipe start to current pointer position.
Whether overflow bounce-back timeline is running.
Whether release inertia is running.
Indicates whether the instance has been destroyed.
After destruction, destroy is a no-op.
Whether a swipe gesture is in progress.
Total displacement in movement space (use for element transforms).
The name of the module, derived from the class name
Optional prefix for classnames used by the module
Previous pointer position.
Current properties. Do not mutate these directly, use updateProps instead.
Current scale modifier.
Pointer position at swipe start.
Offset from previous to current pointer position.
Protected_addAdds prefixed classes to an element and removes them on destroy.
Skips classes that are already present on the element.
Target DOM element.
Unprefixed class name segments.
Protected_cnBuilds one or more prefixed class names.
Unprefixed class name segments.
Space-separated prefixed class string.
Protected_destroyInternal method to handle the destruction of the module. It removes all callbacks, destroys properties, and cleans up event listeners and class names.
Protected_emitEmits a callback event with a fixed payload.
Set default mutable props
Primary swiping axis.
Duration of the bounce-back timeline when movement exceeds bounds and inertia does not run.
Movement limits per axis. Unset axis is unbounded.
Determines whether the swipe is allowed to bounce back.
Minimum swipe distance (px) for directional callbacks.
Edge swipe threshold (px) from the left/right edge.
Enables or disables swipe events.
Shows "grab" and "grabbing" cursors during interaction.
Enables release inertia (RAF-based decay).
Easing factor for pulling inertia back inside bounds (per frame, FPS-independent).
Inertia velocity decay per frame (higher = stops sooner).
Inertia distance modifier. Called when inertia distance is predicted but not yet started.
Multiplier applied to release velocity.
Minimum release speed to start inertia (px/s for x/y, deg/s for angle).
Max release velocity per axis (coord/ms for x/y, deg/ms for angle).
Falsy axis value disables inertia on that axis.
Minimum duration (ms) to trigger swipe move.
Rubber-band distance past bounds (px for x/y, degrees for angle).
Prevents edge swiping (iOS swipe-back gesture).
Prevents touchmove event.
Swipe movement scale.
Enable bounds recalculation when inertia is active
Calculates coordinates relative to the container.
Requires Ctrl key for swipe (mouse only).
Snap targets per axis in movement space.
Max distance to a snap target (same units as the axis). Falsy = no radius limit.
Minimum swipe distance (px) to trigger swipe start.
Returns true to abort before the swipe starts (after threshold / axis checks).
Get default static props
Determines which mouse buttons trigger events.
See MouseEvent.button.
Event listener container.
Disable user selection on drag.
Required pointer count to activate swiping.
An element that triggers the swipe start. Calculations remain relative to the container regardless of this element.
Protected_handleMethod that is called when the module's properties mutate. In most cases, used to handle callbacks.
Recalculates movement bounds from the bounds prop.
Stops overflow bounce animation.
Stops release inertia.
Adds a custom callback to the module.
The event type to listen for (e.g., 'props', 'destroy').
The function to execute when the event is triggered.
Additional settings for the callback.
Registers a function to run when the instance is destroyed.
If the instance is already destroyed, action runs immediately.
Cleanup function (for example remove listeners or DOM classes).
Animates movement back inside bounds after overflow.
OptionaltargetDuration: numberSets programmatic displacement in movement space.
Reapplies rubber, snap, emits move, and cancels overflow bounce.
Sets programmatic scale in movement space.
Optionally zooms toward an origin point and emits move.
Manages swipe interactions:
Gesture lifecycle
Pointers.start→ window move samples → pending (threshold) →start/move→end→ direction → inertia or bounce.If the threshold is never crossed,
startandendare not emitted.Coordinate spaces
start,prev,current,diff,step,accummovement,prevMovement,scale(after rubber / snap)Does not transform elements — only computes coordinates.
Documentation