UNPKG

svelte-swipeout

Version:

iOS-style swipeable list component for Svelte 5 with delete animations and mobile-optimized touch handling

33 lines (32 loc) 1.17 kB
import type { SwipeoutContextValue, SwipeoutConfig, SwipeoutItemState } from './swipeout.types'; /** * Swipeout context manager class */ export declare class SwipeoutContext implements SwipeoutContextValue { config: SwipeoutConfig; activeItem: string | null; private items; constructor(config?: Partial<SwipeoutConfig>); setActiveItem: (id: string | null) => void; closeAll: () => void; closeItem: (id: string) => void; openItem: (id: string, side: "left" | "right") => void; registerItem: (id: string) => SwipeoutItemState; unregisterItem: (id: string) => void; getItemState: (id: string) => SwipeoutItemState | undefined; updateItemState: (id: string, updates: Partial<SwipeoutItemState>) => void; isItemOpen: (id: string) => boolean; getOpenSide: (id: string) => "left" | "right" | null; } /** * Set swipeout context */ export declare function setSwipeoutContext(config?: Partial<SwipeoutConfig>): SwipeoutContext; /** * Get swipeout context */ export declare function getSwipeoutContext(): SwipeoutContext; /** * Check if swipeout context exists */ export declare function hasSwipeoutContext(): boolean;