vant
Version:
Mobile UI Components built on Vue
40 lines (39 loc) • 1.11 kB
TypeScript
import type { ComponentPublicInstance, ComputedRef } from 'vue';
import type { SwipeProps } from './Swipe';
export type SwipeState = {
rect: {
width: number;
height: number;
} | null;
width: number;
height: number;
offset: number;
active: number;
swiping: boolean;
};
export type SwipeToOptions = {
immediate?: boolean;
};
export type SwipeExpose = {
prev: () => void;
next: () => void;
resize: () => void;
swipeTo: (index: number, options?: SwipeToOptions) => void;
/** @private */
state: SwipeState;
};
export type SwipeProvide = {
props: SwipeProps;
size: ComputedRef<number>;
count: ComputedRef<number>;
activeIndicator: ComputedRef<number>;
};
export type SwipeInstance = ComponentPublicInstance<SwipeProps, SwipeExpose>;
export type SwipeThemeVars = {
swipeIndicatorSize?: string;
swipeIndicatorMargin?: string;
swipeIndicatorActiveOpacity?: number | string;
swipeIndicatorInactiveOpacity?: number | string;
swipeIndicatorActiveBackground?: string;
swipeIndicatorInactiveBackground?: string;
};