import withAlbum from "../album/album"; import "./swipe.css"; import SwipeDetector from "./detector"; export interface Swipeable { swipeDetector: SwipeDetector; applySwipeTransform: (offset: { x: number; y: number; }, opts: SwipeOptions) => void; onSwipeStart: (point: { x: number; y: number; }, opts: SwipeOptions) => void; onSwipeEnd: (direction: "left" | "right", opts: SwipeOptions) => void; onSwipeCancel: (opts: SwipeOptions) => void; afterSwipe: () => void; } export interface SwipeOptions { /** Describes how far users have to drag before it's recognized as a drag */ swipeThreshold?: number; /** Describes how far the image can move visually in response to being dragged */ swipeResponseLimit?: number; /** If true, desktop users can drag images using their mouse */ swipeOnDesktop?: boolean; } /** Augments the YAMZ instance to support swiping through albums on mobile */ export default function withSwipe>(_yamz: YamzType): Pick> & Pick<{ defaultLightboxGenerator: ($copiedImg: HTMLElement, opts: Parameters[1] & SwipeOptions, $original: HTMLElement) => HTMLElement; setOptions: (options: Parameters[0] & Partial) => ReturnType; optsFromElm: ($elm: HTMLElement) => ReturnType & SwipeOptions; open: ($img: Parameters[0], opts?: (Parameters[1] & SwipeOptions) | undefined) => ReturnType; replace: ($img: Parameters[0], opts?: (Parameters[1] & SwipeOptions) | undefined) => ReturnType; bind: ($imgs: Parameters[0], opts?: (Parameters[1] & SwipeOptions) | undefined) => ReturnType; options: YamzType["options"] & SwipeOptions; }, "defaultLightboxGenerator" | "setOptions" | "optsFromElm" | "open" | "replace" | "bind" | "options"> & Swipeable;