import { ComponentClass } from 'react' import { CommonEventFunction, CommonEvent } from '@tarojs/components/types/common' import AtComponent from './base' export interface SwipeActionOption { /** * 选项名称 */ text/*;文本*/: string /** * 选项样式 */ style/*;样式*/?: object | string /** * 选项样式类名 */ className/*;样式类*/?: object | string | string[] } export interface AtSwipeActionProps extends AtComponent { /** * 是否开启 * @default false */ isOpened/*;是已开*/?: boolean /** * 是否禁止滑动 * @default false */ disabled/*;禁用*/?: boolean /** * 点击选项时,是否自动关闭 * @default false */ autoClose/*;自动关闭*/?: boolean /** * 展示的选项数组 */ options/*;选项*/?: SwipeActionOption[] /** * 点击触发事件 */ onClick/*;当点*/?: (item: SwipeActionOption, index: number, event: CommonEvent) => void /** * 完全打开时触发 */ onOpened/*;当已开*/?: CommonEventFunction /** * 完全关闭时触发 */ onClosed/*;当已关*/?: CommonEventFunction /** * 滑块最大滑动距离,一般是按钮个数乘以按钮宽度 */ maxDistance/*;最大距离*/: number /** * SwipeAction 组件宽度 */ areaWidth/*;域宽*/: number /** * 判断是否需要打开的比例阈值,即 滑块滑动距离 / 滑块最大滑动距离, 默认为 0.5 */ moveRatio/*;移动比例*/?: number } export interface AtSwipeActionState { componentId/*;组件号*/: string offsetSize/*;偏移量*/: number _isOpened/*;_是已开*/: boolean needAnimation/*;需要动画*/: boolean } export interface AtSwipeActionOptionsProps extends AtComponent { componentId/*;组件号*/: string options/*;选项集*/: SwipeActionOption[] } declare const AtSwipeAction: ComponentClass export default AtSwipeAction